Platform differencescTrader C# to NinjaScript: What Changes and How We Handle It
cTrader and NinjaTrader 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 cTraderIn NinjaTraderHow we handle it
Language and API
C# on cTrader’s Automate API
NinjaScript — C# on NinjaTrader’s API
Platform-independent calculations and classes can often be kept; code tied to cTrader’s API, events, data and trading is rebuilt in NinjaScript.
Instruments
Forex, CFDs and other symbols from your cTrader broker
Futures, and forex or stocks on some connections
If the instrument changes, we agree which one replaces each cTrader symbol and adapt sizes, price distances and sessions.
Trade size
Volume in units, from the symbol’s lot size and volume step
Contracts, or units on forex connections
Sizes are recalculated for the NinjaTrader instrument and checked against your risk rules.
Positions
Positions found by label, on a hedging or netting account
The strategy’s own position in an instrument, tracked separately from the account’s
Each entry and its exits are mapped to the strategy’s position; hedged positions are redesigned, and the strategy’s start behaviour and how it works alongside manual trades and other strategies are agreed.
Calculation
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
OnBarUpdate on bar close, on each tick or on price change; history on bar close unless intrabar data is added
We match which bar each piece of logic reads — forming or closed — and when orders are sent, and check historical and real-time behaviour separately.
Trading hours and time zone
The cBot’s time zone setting and the symbol’s sessions
The trading hours template, such as RTH or ETH, and the platform time zone
We compare sessions, bar timestamps and the time zone each version’s logic uses — matching chart clocks alone isn’t enough.
.NET
Runs on modern .NET
Runs on .NET Framework
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: cTrader Cloud has no NinjaTrader counterpart; forex and CFD symbols your NinjaTrader connection doesn’t offer; and libraries built for modern .NET, web requests and file access, which are checked one by one. A NinjaScript strategy can trade several instruments added as extra data series: a cBot that trades symbols independently can run as separate strategies, while cross-market signals or a shared risk limit can be kept in one multi-instrument strategy — which approach fits, and how it is tested, is agreed before work starts. We point these out before work starts and agree the closest NinjaTrader equivalent with you.