Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Obtain timeframe and instrument data within strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Obtain timeframe and instrument data within strategy

    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, 02:23 AM.

    #2
    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

    Comment


      #3
      Excellent, thank you!

      A question regarding BarsPeriod;
      What is the difference between BarsPeriod.BasePeriodType and BarsPeriod.Id?

      Comment


        #4
        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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        58 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        35 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        103 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        184 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        171 views
        0 likes
        Last Post CarlTrading  
        Working...
        X