Importing from other languages
Pine Script, MQL4 and MQL5, NinjaScript, EasyLanguage, thinkScript and Python.
Paste a script from another platform and AlgoBarsX works out the language, parses the source, maps each construct, and compiles the result before calling it done. An import that does not compile says so.
| Reads | Notes |
|---|---|
| Pine Script | Strategies and indicators. |
| MQL4 and MQL5 | Expert advisors. OnTick becomes the script body, and OrderSend becomes an order with its stop and target attached. |
| NinjaScript | OnBarUpdate carries over. The C# around it comes back as notes. |
| EasyLanguage | TradeStation strategies. |
| thinkScript | Studies and conditions. |
| Python | backtrader, freqtrade, and plain pandas with pandas-ta or TA-Lib. |
Every line comes back with one of three statuses: exact (carried over as is), adapted (changed, with a note saying how), or your call (a decision handed back to you, with the original kept as a comment).
//@version=5strategy("EMA Cross", overlay=true)fast = input.int(20, "Fast")slow = input.int(50, "Slow")if ta.crossover(ta.ema(close, fast), ta.ema(close, slow))strategy.entry("Long", strategy.long)if ta.crossunder(ta.ema(close, fast), ta.ema(close, slow))strategy.close("Long")1
strategy "EMA Cross"2
market: EURUSD3
bars: 1h4
5
input fast = 206
input slow = 507
8
when crosses_above(ema(close, fast), ema(close, slow)):9
buy size: 1 lot, tag: "Long"10
11
when crosses_below(ema(close, fast), ema(close, slow)):12
close_all tag: "Long"| Status | Your line | What happened |
|---|---|---|
| Exact | strategy("EMA Cross", overlay=true) | strategy() became the script header |
| Exact | fast = input.int(20, "Fast") | input() became an input |
| Exact | slow = input.int(50, "Slow") | input() became an input |
| Your call | strategy.entry("Long", strategy.long) | strategy.entry() had no size of its own, so it became one lot: set the size or risk you want |
| Adapted | if ta.crossover(ta.ema(close, fast), ta.ema(close, slow)) | an if that places orders became a rule |
| Exact | strategy.close("Long") | strategy.close() became close_all |
| Adapted | if ta.crossunder(ta.ema(close, fast), ta.ema(close, slow)) | an if that places orders became a rule |
| Your call | strategy(...) | Pine scripts carry no market or bar size, so EURUSD on 1h was filled in: set the ones you want |
Always read an import before you run it. Other platforms leave things unsaid that AlgoBarsX makes explicit, such as the market, the bar size and the position size. Those come back as decisions for you. Check the plain-English description against what your original did, and backtest before you deploy.