Help

Publish trades straight from MetaTrader 5

Install a small script once, then send your trades to KaiTrader with a double-click and confirmation, no report file or upload form. You choose the broker timezone once when creating the token.

What this is, and what it is not

The publisher is a small script that runs inside MetaTrader 5. When you run it, it reads your closed trades and sends them to your own KaiTrader journal.

It only ever reads. It cannot place, change or close any trade, and it never sees your broker password, it runs inside the terminal you are already logged in to.

It also produces better data than a report upload: MetaTrader tells it exactly which trades belong together, and it never has to guess your broker's timezone.

This needs MetaTrader 5 on a computer. The iPhone and Android apps cannot run scripts, so if you only ever trade on your phone, use the report upload instead.

Step 1: Create your token

  1. In KaiTrader open Settings and find MetaTrader publisher.
  2. Give it a name you will recognise later, such as “Laptop terminal”.
  3. Choose the trading account the trades should go into.
  4. Choose your broker's server timezone, the same one described on the report import page. You only answer this once.
  5. Press Create token and copy the token that appears.

The token is shown once and cannot be retrieved afterwards. If you lose it, revoke it and create a new one, that takes seconds and nothing else is affected.

Step 2: Install the script

  1. In MetaTrader 5 choose File → Open Data Folder.
  2. Open the MQL5 folder, then Scripts.
  3. Copy KaiTraderPublish.mq5 into that folder.
  4. Back in MetaTrader, right-click in the Navigator panel and choose Refresh. The script appears under Scripts.

On a Mac the data folder lives inside the MetaTrader application, not in your Documents folder, so always reach it through File → Open Data Folder rather than by searching in Finder.

Step 3: Allow KaiTrader

MetaTrader blocks programs from contacting the internet unless you explicitly permit each address. This is a safety feature; you only do it once.

  1. Open Tools → Options → Expert Advisors.
  2. Tick Allow WebRequest for listed URL.
  3. Add https://kaitrader.com to the list.
  4. Press OK.

Step 4: Publish

  1. Open any chart, if none is open.
  2. In the Navigator panel, double-click KaiTraderPublish under Scripts.
  3. Paste your token into the KaiTrader token field and press OK.
  4. Open Toolbox → Experts to see the result, for example “done, 12 imported, 0 already known, 0 skipped”.
  5. Your trades are now in KaiTrader, ready to journal.

Run it again whenever you like, after a session, or at the end of the day. It only sends what is new, and sending the same trade twice never creates a duplicate.

Something went wrong

Nothing happens when you double-click, open a chart first; a script needs one. Check Toolbox → Experts rather than the Journal tab, which shows different messages.

“request failed (error 4014)”, the address is not allowed yet. Repeat Step 3 and make sure the entry reads exactly https://kaitrader.com.

“token rejected”, the token was revoked or mistyped. Create a new one in Settings and paste it again.

“subscription is not active”, importing is paused until your subscription is active again.

Some trades were skipped, positions closed using MetaTrader's “Close by” function are not supported yet. Everything else imports normally.

Your journal looks incomplete, run the script again with Resend full history switched on. It re-sends everything; duplicates are ignored.