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!
See more
See less

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
    BertrandNinjaTrader Customer Service

    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
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        11 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        5 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X