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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X