It reads itself back
The compiler writes out what the script does in plain English.
Convert · NinjaScript
You have spent years on your NinjaScript 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 26 lines: 5 carried over exactly, 1 were adapted, and 4 came back as choices for you.
namespace NinjaTrader.NinjaScript.Strategies{public class MacdMomentum : Strategy{protected override void OnStateChange(){if (State == State.SetDefaults){Name = "MACD Momentum";}}protected override void OnBarUpdate(){if (CrossAbove(EMA(Close, 12), EMA(Close, 26), 1)){SetStopLoss(CalculationMode.Ticks, 40);SetProfitTarget(CalculationMode.Ticks, 80);EnterLong();}if (CrossBelow(EMA(Close, 12), EMA(Close, 26), 1)){ExitLong();}}}}strategy "MACD Momentum"market: EURUSDbars: 1hinput risk = 1%when crosses_above(ema(close, 12), ema(close, 26)):buy risk: risk, stop: 40 points, target: 80 pointswhen crosses_below(ema(close, 12), ema(close, 26)):close_all side: long| Status | Your line | What happened |
|---|---|---|
| Exact | SetStopLoss ( CalculationMode.Ticks , 40 ) ; | a stop in ticks became points |
| Your call | ;
SetProfitTarget ( CalculationMode.Ticks , 80 ) | this line has no equivalent yet |
| Exact | SetProfitTarget ( CalculationMode.Ticks , 80 ) ; | a stop in ticks became points |
| Your call | ;
EnterLong ( ) ;
} | this line has no equivalent yet |
| Adapted | EnterLong ( ) ;
}
if | NinjaTrader sizes an order by the strategy settings, so this one risks a set share of the balance |
| Your call | ;
}
if ( CrossBelow ( | this line has no equivalent yet |
| Exact | if ( CrossAbove ( EMA ( Close , | a condition became a rule |
| Exact | ExitLong ( ) ;
}
} | an exit carried over |
| Your call | ;
}
}
} | this line has no equivalent yet |
| Exact | if ( CrossBelow ( EMA ( Close , | a condition became a rule |
| In NinjaScript | In AlgoBarsX |
|---|---|
OnBarUpdate() | the body of the script |
EMA(Close, 12) | ema(close, 12) |
CrossAbove(a, b, 1) | crosses_above(a, b) |
SetStopLoss(CalculationMode.Ticks, 40) | stop: 40 points, on the order itself |
SetProfitTarget(CalculationMode.Ticks, 80) | target: 80 points |
EnterLong() | buy |
ExitLong() | close_all side: long |
Instrument, TickSize | market.symbol, market.point_size |
Set a stop with SetStopLoss before the entry. The import sizes the trade by risk, and a risk-based order needs a stop to measure from. The C# around the strategy (namespaces, State handling) comes back as notes, not code.
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.