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.
Please let us know if it does not, or if there are any other ways we can help.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 argusthome, 03-08-2026, 10:06 AM
|
0 responses
116 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
61 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
82 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment