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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X