Any ideas?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
N Bars Up doesn't work for market replay
Collapse
X
-
N Bars Up doesn't work for market replay
I built a strategy in strategy builder using NBars up and NBars Down on the Order Flow Cumulative Delta Indicator. After x amount of Bars up I want to buy or vice versa with the sells. Compiling works without errors. I connected to Playback connection and added the strategy to the chart. When trying to enable the strategy for backtesting it didn't work. It just won't enable. I added this function to another working strategy and upon adding this function the strategy couldn't be enabled anymore.
Any ideas?Tags: None
-
Hello HappyTrader76,
Thank you for posting about this, you actually shouldn't be able to do that. The orderflow tools are not available in the strategy builder due to their data requirements and how they process. You can use them in manual coding but not in the builder. They are normally hidden from the indicators list but it looks like when selected in that use case they show up.
-
Thank you, that clears things up.
Too bad these indicators are not available in Strategy builder. Would be a nice feature for those that have order flow capability. Is it possible to add that in the future?
Comment
-
Hello Jesse
If I unlock the strategy builder and have the code in Strategy Editor, is there an easy way that I can change the code, so that the order Flow indicator which already shows up in the code can be used. I haven't coded much in C# yet and it would be nice if I could start from Strategy Builder and work from there.
Comment
-
Hello HappyTrader76,
It is possible to do that however if you havent worked with manual coding or multi series scripts before this can be a complicated concept at first.
You can find an example of what logic would be needed to call that indicator here:
https://ninjatrader.com/support/help...m_highlightsub =orderflow
If you unlock a strategy builder script it will have the following lines of code:
Code:if (BarsInProgress != 0) return; if (CurrentBars[0] < 0) return;
To make it work with the sample from the help guide you would need to remove those lines and make it look like the following instead:
Code:if (BarsInProgress == 0) { if (CurrentBar < 0) // replace 0 with the maximum BarsAgo your sets uses return; // your sets go here Print("Delta Close: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0]); } else if (BarsInProgress == 1) { // We have to update the secondary series of the cached indicator to make sure the values we get in BarsInProgress == 0 are in sync OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).Update(OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).BarsArray[1].Count - 1, 1); }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
68 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment