Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
initialize and onstarup
Collapse
X
-
initialize and onstarup
I am using the indicator OHLC to get yesterdays values. On Initialize the strategy will not activate and if I call the OHLC on onstartup method i get zero values. It will work in on bar update. I just need to get the values once not every bar. what do I do?Tags: None
-
Hello ballboy, and thank you for your question. It sounds like you are trying to get at this indicator's data before it has data in it. You may need to tweak this code sample to fit your code, but I believe this will resolve your query.
Code:[FONT=Courier New] protected override void OnBarUpdate() { foreach(int CurrentBarForSeries in CurrentBars) { if (CurrentBarForSeries < 1) { return; } } // the rest of your OnBarUpdate code goes here }[/FONT]
Jessica P.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
2 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
6 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
Comment