Kindly, FREEN
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
Bars.BarsInSession property?
Collapse
X
-
Unfortunately there would not be a supported property to query those ahead...you can use Bars.BarsSinceSession on the last of the first session completed to know the value. Alternatively for time based you would know the # of bars provided it's a liquid instrument.BertrandNinjaTrader Customer Service
-
Thanks Bertrand! Yes, I´m aware this:
if(Bars.LastBarOfSession)
{
Print((Bars.BarsSinceSession+1).ToString());
}
Sorry to ask without having tried yet, would it be possible to trigger the OnBarUpdate events only at first session, do the Initializing/declaring with collected data from that session, then run the the OnBarUpdate events as usually?Last edited by FREEN; 07-20-2012, 07:09 AM.
Comment
-
"Although this method is called once on the start of an indicator or strategy, there are times that this method is also called (Opening an indicator dialog) when you may not expect it to."
Q 1: Is it possible to do the Initializing after OnBarUpdate event/-s?:
OnBarUpdate
-collect data
First Session end flag
Initialize
OnBarUpdate
-main code
Q 2: List.Add during first session? Thanks, I´ll look into if that does the trick.
Comment
-
FREEN, the event sequence seen is Initialize(), OnStartUp(), OnBarUpdate() - this could not be changed unfortunately.
Correct you would add to your list as the OnBarUpdate() runs, it would dynamically size as needed (contrary to classic array)
BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by hazylizard, Today, 08:38 AM
|
1 response
8 views
0 likes
|
Last Post Today, 08:53 AM | ||
Started by geddyisodin, Today, 05:20 AM
|
2 responses
17 views
0 likes
|
Last Post
by geddyisodin
Today, 08:44 AM
|
||
Started by Max238, Today, 01:28 AM
|
5 responses
45 views
0 likes
|
Last Post
by Max238
Today, 08:30 AM
|
||
Started by giulyko00, Yesterday, 12:03 PM
|
3 responses
13 views
0 likes
|
Last Post Today, 08:26 AM | ||
Started by habeebft, Today, 07:27 AM
|
1 response
16 views
0 likes
|
Last Post Today, 08:08 AM |
Comment