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
BarsPeriod.Id for Unirenko?
Collapse
X
-
Hello arbuthnot,
If this were in on startup the condition wouldn't be checked on every bar. The performance to check this is minimal and you probably wouldn't notice a difference, but in the end it would have less code to run on every bar update.
Leave a comment:
-
Thanks for your help with this, Chelsea.
I've thought of another approach. If I use only one non-standard bar type, i.e. Unirenko (after declaring a bool IfTime) I could code up something like this:
Code:if ( BarsPeriod.Id == PeriodType.Minute || BarsPeriod.Id == PeriodType.Second ) IfTime = true; else IfTime = false;
My question now is: it probably doesn't make a great deal of difference, but would it be better to keep this code in OnBarUpdate or should it ideally be in something like OnStartUp?
Thanks for letting me know.
Leave a comment:
-
Hello arbuthnot,
You may need to use BarsPeriod.BasePeriodType and BarsPeriod.BasePeriodValue.
Below is a link to the help guide on BarsPeriod.
http://ninjatrader.com/support/helpG...barsperiod.htm
Leave a comment:
-
BarsPeriod.Id for Unirenko?
Hi Folks
If I want code to identify whether the chart is a tick, minute or any standard NT bar type, I can use code such as:
Code:if( BarsPeriod.Id == PeriodType.Tick )
BarsPeriod.Id == PeriodType.Unirenko doesn't work so I doubt this is possible but is there another way of identifying Unirenko in code in a similar way?
Thanks in advance.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bmartz, 03-12-2024, 06:12 AM
|
5 responses
32 views
0 likes
|
Last Post Today, 08:34 AM | ||
Started by Aviram Y, Today, 05:29 AM
|
4 responses
13 views
0 likes
|
Last Post
by Aviram Y
Today, 07:57 AM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
3 responses
28 views
0 likes
|
Last Post Today, 07:41 AM | ||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:30 AM | ||
Started by cls71, Today, 04:45 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:25 AM |
Leave a comment: