Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Issue with Strategy Analyzer
Collapse
X
-
Issue with Strategy Analyzer
While trying to test my first strategy with the Strategy Analyzer, I discovered that the strategy doesn't kick in until 20 bars have passed, is this normal? I discovered this by putting Print(Close[0]); in the OnBarUpdate() function and looked at the output box. The first value that it printed out was the value of the bar 20 bars from the start of the graph.Tags: None
-
Didn't take long, but I have another question:
I want to set the bars required for my strategy in the Initialize() so I don't have to do it every time when I go to run it, but it won't take this.BarsRequired(5);. I looked through the API, but I couldn't find how to call the function
Comment
-
milemike,
Its just :
BarsRequired = 10;
Its a integer value so you just assign some integer to it.
In your code you can check for if ( CurrentBar < BarsRequired) return; for example.
The main thing here is that you want to watch out for array index out of bounds issues.Adam P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
59 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
143 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment