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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
666 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
377 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment