Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
DataLoaded question about when in a series is updated
Collapse
X
-
DataLoaded question about when in a series is updated
In my strategy I have a series in the Dataloaded section , that is an indicator with certain arguments: ie MyIndicator( minValue, Maxvalue) based on time of day I want to adjust one or more arguments to different values. I have this in a procedure in the OnBarUpdate. and as the strategy processes, it will be during various times. So is the Dataloaded only processed during initial enabling of the strategy or can the data be manipulated during the live trading? or do I need to place this under OnBarUpdate section
Tags: None
-
I think I understand the DataLoaded is one time deal, so I created a series of IF statements under OnBarUpdate, and added the MyIndicator(minVal,Maxval) I just wonder if it takes any extra processing and if its reloading the data each bar. I still have the indicator in the Dataloaded section.
-
Hello set2win,
Thanks for your post.
State.DataLoaded is called only once after all data series have been loaded. It is used for logic that needs to access data-related objects like Bars, Instruments, BarsPeriod, TradingHours or instantiating indicators, notifies that all data series have been loaded, and initializes any class level variables (including custom Series<T> objects).
If you would like to adjust the values passed into the indicator during certain times, you must do so in the OnBarUpdate() method as you have described.
See this help guide page for more information about NinjaScript States: https://ninjatrader.com/support/help...tatechange.htm
And, see this help guide page for more information about the NinjaScript Lifecycle: https://ninjatrader.com/support/help...fecycle_of.htm
Let me know if I may assist further.
Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pibrew, Today, 06:37 AM
|
0 responses
0 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
12 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
11 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
Comment