![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Sep 2010
Location: London, UK
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
|
I did a forum search but couldnt find an answer to this....
Is there a way to obtain the timeframe and the type of instrument (forex pair) from within a strategy or indicator? I want my strategy to use preset default values (for MA as an example) depending on the currency pair that the strategy has been applied to and also the timeframe (number of days or mins). Thanks
Last edited by BillyRayValentine; 11-03-2010 at 02:23 AM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
BillyRayValentine, yes you can work with BarsPeriod Id and Value to access this info in your script - http://www.ninjatrader-support.com/H...arsPeriod.html
For the instrument, you can work with the properties of the Instrument Class then - http://www.ninjatrader-support.com/H...mentClass.html
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2010
Location: London, UK
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
|
Excellent, thank you!
A question regarding BarsPeriod; What is the difference between BarsPeriod.BasePeriodType and BarsPeriod.Id? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
You're welcome - this would be relevant for NT7 as this denotes the PeriodType that the newly added chart types would be build from - http://www.ninjatrader.com/support/h...barsperiod.htm
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Tags |
| timeframe |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Instrument / Timeframe within Indicator | r2kTrader | Indicator Development | 1 | 07-09-2010 11:40 AM |
| Multi-timeframe strategy skips lower timeframe bars at one point | adamus | Version 7 Beta General Questions & Bug Reports | 13 | 07-03-2010 01:36 AM |
| Accessing Instrument on Different Timeframe | FatCanary | Strategy Development | 18 | 05-10-2010 03:53 PM |
| Daily data - multi timeframe strategy | drolles | Strategy Development | 1 | 06-02-2009 10:56 AM |
| How to get higher timeframe data to make entry decision at lower timeframe? | cunparis | Strategy Development | 1 | 03-11-2009 12:41 PM |