Any ideas?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
JesseNinjaTrader Customer Service
-
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); }
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by strategist007, Today, 07:51 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,968 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
58 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
6 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
Comment