It reads itself back
The compiler writes out what the script does in plain English.
Convert · MQL4 and MQL5
You have spent years on your MQL4 and MQL5 scripts. You should not have to start again. Paste one in, and AlgoBarsX rewrites it and tells you what it did to every line.
This is a real run of the importer. The result compiles. It read 11 lines: 6 carried over exactly, 6 were adapted, and 2 came back as choices for you.
#property strictinput int Fast = 20;input int Slow = 50;input double Lots = 0.10;void OnTick(){double f = iMA(NULL, 0, Fast, 0, MODE_EMA, PRICE_CLOSE, 0);double s = iMA(NULL, 0, Slow, 0, MODE_EMA, PRICE_CLOSE, 0);if (f > s && OrdersTotal() == 0)OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, Ask - 250 * Point, Ask + 500 * Point);}strategy "Imported expert advisor"market: EURUSDbars: 1hinput Fast = 20input Slow = 50input Lots = 0.1 lotsf = ema(close, Fast)s = ema(close, Slow)when f > s and trades.open().len == 0:buy size: Lots, stop: close - 250 * market.point_size, target: close + 500 * market.point_size| Status | Your line | What happened |
|---|---|---|
| Exact | input int Fast = 20 ; | an input carried over |
| Exact | input int Slow = 50 ; | an input carried over |
| Exact | input double Lots = 0.10 ; | an input carried over |
| Adapted | void OnTick ( ) | OnTick became the script body, which runs once per bar; add evaluate: tick to run on every tick |
| Exact | double f = iMA ( NULL , 0 , Fast , 0 , MODE_EMA | a variable carried over |
| Exact | double s = iMA ( NULL , 0 , Slow , 0 , MODE_EMA | a variable carried over |
| Adapted | f > s && OrdersTotal ( ) == 0 | OrdersTotal() became the number of open trades |
| Your call | Symbol ( ) | Symbol() has no equivalent yet |
| Adapted | Ask | Ask became the close: a backtest here has one price per bar, and live trading uses the right side of the spread |
| Adapted | Ask - 250 * Point | Ask became the close: a backtest here has one price per bar, and live trading uses the right side of the spread |
| Adapted | Ask + 500 * Point | Ask became the close: a backtest here has one price per bar, and live trading uses the right side of the spread |
| Exact | OrderSend ( Symbol ( ) , OP_BUY , Lots , Ask , 3 , | the order carried over with its stop and target |
| Adapted | if ( f > s && OrdersTotal ( ) == 0 ) OrderSend ( | a condition that places orders became a rule |
| Your call | the script header | an expert advisor runs on whatever chart it is attached to, so EURUSD on 1h was filled in: set the ones you want |
| In MQL4 and MQL5 | In AlgoBarsX |
|---|---|
input int Fast = 20; | input Fast = 20 |
input double Lots = 0.10; | input Lots = 0.1 lots |
iMA(NULL, 0, Fast, 0, MODE_EMA, PRICE_CLOSE, 0) | ema(close, Fast) |
OrdersTotal() == 0 | trades.open().len == 0 |
OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, sl, tp) | buy size: Lots, stop: …, target: … |
Point | market.point_size |
PERIOD_H1, PERIOD_D1 | 1h, 1d |
void OnTick() | the body of the script. Add evaluate: tick to the header if it must run inside the bar. |
Stops written as Ask - 250 * Point carry over literally. They read better, and survive gaps better, as distances: stop: 250 points.
Open the Terminal, choose Import, and paste your code or pick the file.
Each line is marked exact, adapted, or your call. Settle every “your call” before you go on.
Check the plain-English description against what your old script did. Then run a test.
The compiler writes out what the script does in plain English.
Percent, pips, R and money are types. Mix-ups are caught before anything runs.
The same file draws, tests, alerts and trades.
No. Simple, common shapes convert best. An import that does not compile says so, and every changed line carries a note. Always read the result.
No. Your old script is untouched. Lines that needed a choice keep the original as a comment.
AlgoBars is $0 a month with no card. Credits pay for AI, tests and auto trades.
Pick a small one. Paste it in. Read what comes back.
Create my free account$0 a month · No card needed · Not a trial
Trading is risky. You can lose money. It is not right for everyone.