Convert · NinjaScript

Bring your NinjaScript scripts. Keep your work.

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.

  • $0 a month
  • No card needed
  • Not a trial

A real example.

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.

You paste this · NinjaScript
1namespace NinjaTrader.NinjaScript.Strategies
2{
3public class MacdMomentum : Strategy
4{
5protected override void OnStateChange()
6{
7if (State == State.SetDefaults)
8{
9Name = "MACD Momentum";
10}
11}
12protected override void OnBarUpdate()
13{
14if (CrossAbove(EMA(Close, 12), EMA(Close, 26), 1))
15{
16SetStopLoss(CalculationMode.Ticks, 40);
17SetProfitTarget(CalculationMode.Ticks, 80);
18EnterLong();
19}
20if (CrossBelow(EMA(Close, 12), EMA(Close, 26), 1))
21{
22ExitLong();
23}
24}
25}
26}
You get this · AlgoBarsX
1strategy "MACD Momentum"
2market: EURUSD
3bars: 1h
4
5input risk = 1%
6
7when crosses_above(ema(close, 12), ema(close, 26)):
8buy risk: risk, stop: 40 points, target: 80 points
9
10when crosses_below(ema(close, 12), ema(close, 26)):
11close_all side: long
StatusYour lineWhat happened
ExactSetStopLoss ( CalculationMode.Ticks , 40 ) ;a stop in ticks became points
Your call; SetProfitTarget ( CalculationMode.Ticks , 80 )this line has no equivalent yet
ExactSetProfitTarget ( CalculationMode.Ticks , 80 ) ;a stop in ticks became points
Your call; EnterLong ( ) ; }this line has no equivalent yet
AdaptedEnterLong ( ) ; } ifNinjaTrader 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
Exactif ( CrossAbove ( EMA ( Close ,a condition became a rule
ExactExitLong ( ) ; } }an exit carried over
Your call; } } }this line has no equivalent yet
Exactif ( CrossBelow ( EMA ( Close ,a condition became a rule

How the ideas translate.

In NinjaScriptIn 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, TickSizemarket.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.

How to move a script.

  1. Paste or upload

    Open the Terminal, choose Import, and paste your code or pick the file.

  2. Read every note

    Each line is marked exact, adapted, or your call. Settle every “your call” before you go on.

  3. Read it back, then test

    Check the plain-English description against what your old script did. Then run a test.

What you gain.

It reads itself back

The compiler writes out what the script does in plain English.

Units are real

Percent, pips, R and money are types. Mix-ups are caught before anything runs.

One script everywhere

The same file draws, tests, alerts and trades.

Always read an import before you run it. No converter is perfect, and some shapes of code import better than others. Other platforms leave things unsaid that AlgoBarsX makes you state, such as the market, the bar size and the trade size. Compare the plain-English description with what your old script did, and test before you deploy.

Good questions.

Will every script convert cleanly?

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.

Do I lose my original?

No. Your old script is untouched. Lines that needed a choice keep the original as a comment.

Is it free?

AlgoBars is $0 a month with no card. Credits pay for AI, tests and auto trades.

Try it with one script.

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.