Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Selecting multiple timeframes in strategy

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

    Selecting multiple timeframes in strategy

    Hi,

    I have created a strategy which is based using multiple timeframes and it seems to work out.

    I now want to change the strategy so that the user can select which timeframes they can use .e.g 5 min + daily + weekly, rather than the hard coded ones I have entered.

    I have looked in the strategies but can not find anything that allows you to select the dataseries type, as per the backtesting of a strategy.

    The only thing that I can think of is using 'coded' user inputs to achieve this e.g. have strings of '5Minute' 'Daily' 'Weekly' to simulate the above.

    If anybody has any suggestions please let me know.

    TIA.

    Graham.

    #2
    I think I would define as all TF bolean variable then I tested it in Script, if True or False. But they should be defined through all the add TF

    Comment


      #3
      Hello,

      I haven't tested this but try adding this in your variables section:
      privateint mytimeframe = 5;

      And this in your Initialization section:
      Add(PeriodType.Minute, mytimeframe);

      I've never tried it, but it may work. Or use bool logic as suggested.
      DenNinjaTrader Customer Service

      Comment


        #4
        Thanks for the replies.

        It looks as if boolean logic seems to be the best way forward.

        Graham.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        55 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X