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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
68 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
61 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment