I am trying to write a strategy using Orderflow Cumulative Delta in a strategy but it won’t compile properly. Is is possible to use it in a strategy? If so can you point me to some sample code to execute it?
Can you post the compile error you’re getting, and preferably also the code snippet that the compiler is complaining about? It would help us diagnose your problem.
Here’s the docs link to the delta indicator. Examples are at the bottom of the page.
Yes, the Order Flow+ Cumulative Delta can be used in a strategy so long as you have a valid NinjaTrader Order Flow+ subscription.
You can define a member variable for an “Order Flow Cumulative Delta” indicator in a NinjaScript strategy like this:
private NinjaTrader.NinjaScript.Indicators.OrderFlowCumulativeDelta QX_OrderFlowCumulativeDelta;
You can create the indicator in the “State == State.DataLoaded section” of OnStateChange like this:
QX_OrderFlowCumulativeDelta = OrderFlowCumulativeDelta(Closes[0], NinjaTrader.NinjaScript.Indicators.CumulativeDeltaType.UpDownTick, NinjaTrader.NinjaScript.Indicators.CumulativeDeltaPeriod.Bar, 0);
Here’s an example of a condition that uses the 4 data series of this indicator:
if ((Position.MarketPosition == MarketPosition.Flat)
&&
(QX_OrderFlowCumulativeDelta.DeltaClose[0] > QX_OrderFlowCumulativeDelta.DeltaOpen[0])
&&
(QX_OrderFlowCumulativeDelta.DeltaHigh[0] > QX_OrderFlowCumulativeDelta.DeltaLow[1]))
This indicator requires a secondary data series of single ticks to be added to the NinjaScript strategy to function properly as well. Here is an example of setting up the Order Flow+ Cumulative Delta indicator and a secondary series of ticks in a no-code strategy for NinjaTrader built with the no-code strategy builder for NinjaTrader from Quagensia.
Here’s an example of using the 4 data series that this indicator exposes from inside of the same no-code strategy:
It is not possible to upload .cs or .qsnx files files to this forum, but if you wanted a complete no-code Quagensia N Edition Strategy file (a .qsnx file) that uses the OrderFlow Cumulative Delta indicator and that you can open in Quagensia N Edition with a valid VIP free trial license key, customize with your proprietary logic, and then generate its corresponding plain text NinjaScript strategy and send it to NinjaTrader please see this tweet for more information:


