Platform differencesNinjaScript to cTrader C#: What Changes and How We Handle It
NinjaTrader and cTrader run C# code in different ways, and can trade different instruments. These are the differences that decide whether a converted script behaves like the original — and what we do about each of them.
In NinjaTraderIn cTraderHow we handle it
Language and API
NinjaScript — C# on NinjaTrader’s API
C# on cTrader’s Automate API
Platform-independent calculations and classes can often be kept; code tied to NinjaTrader’s API, events, data and trading is rebuilt for cTrader.
Instruments
Futures, forex or stocks from your NinjaTrader connection
Forex, CFDs and other symbols from your cTrader broker
If the instrument changes, we agree which one replaces each NinjaTrader instrument and adapt sizes, price distances and sessions.
Trade size
Contracts or units
Volume in units, from the symbol’s lot size and volume step
Sizes are recalculated for the cTrader symbol and checked against your risk rules.
Positions
The strategy’s own position, tracked separately from the account’s
Positions on a hedging or netting account, found by label
We map each entry and its exits for your account type — on netting, with the cBot’s own record of entries — and agree how it works alongside other cBots, manual trades and positions already open at start.
Calculation
Calculation mode per script; history on bar close unless intrabar data is added
OnBar as a new bar opens and OnBarClosed for the last closed bar — both wait for the next bar’s first tick; OnTick for each tick
We match which bar each piece of logic reads — forming or closed — and when orders are sent, and check intrabar behaviour.
Additional data
Extra data series, handled through BarsInProgress
Bars requested per symbol and timeframe, each with its own events
Values from other series are aligned with the chart’s bars, as in the original.
.NET
Runs on .NET Framework
Runs on modern .NET
Libraries are checked for compatibility and retargeted or replaced where needed.
What may not carry over one to one
Some things depend on the platform itself: volumetric order-flow data needs trade-level tick data that many cTrader brokers don’t provide; NinjaTrader add-ons and third-party indicators the code relies on need their source or a replacement; and cTrader Cloud limits some cBot features, so if the cBot should run there, this is checked. We point these out before work starts and agree the closest cTrader equivalent with you.