Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Time Frame

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

    Multi-Time Frame

    Hello all,

    In order to enhance results of the 1 minute strategy I wanted it to run also in 2 minute period with the same instrument. To make it in one script I put this row there (in bold):

    … IsInstantiatedOnEachOptimizationIteration = true;
    }
    else if (State == State.Configure)
    {
    SetStopLoss("", CalculationMode.Ticks, 8, false);
    SetProfitTarget("", CalculationMode.Ticks, 2);
    AddDataSeries(Data.BarsPeriodType.Minute, 2);

    }
    else if (State == State.DataLoaded)
    {

    Obviously was not enough. What did I miss?
    Thank you for help
    Michael

    #2
    Hello Michael,

    If your primary interval is 1 minute, then OnBarUpdate is also going to be triggering every 2 minutes as well.

    You could change your logic to trigger actions every other bar if you wanted to and no added series would be necessary.

    When you mention "Obviously was not enough. " what is the behavior you are expecting?

    What is the behavior you experienced?

    What is the issue you are having?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea B.
      Thank oyu for respond.
      I've got results of 1 minute interval strategy performans on 'Strategy Analizer'; than added that row. and got the same results.

      Comment


        #4
        I've expected different amount of trades after adding that row

        Comment


          #5
          Hello Michael,

          Adding a 2 minute series when the primary series is 1 minute would cause OnBarUpdate to updated every 1 minute and also every 2 minutes.

          Since its already updating every 1 minute, it would already be updating every 2 minutes as well. So it is already updating every 2 minutes and the behavior wouldn't change.

          Are you trying to have the logic that places orders evaluate only when the 2 minute series is processing and not every minute?

          Use the BarsInProgress property to run code only when a specific series is processing.
          Below is a public link to the help guide.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Let me ask it this way. I have a strategy that runs on I minute interval. An addition to that I want the same strategy to run on 2 minute interval so I’ll get more situations when conditions are met and trade is available, so eventually it will be more trades. Now, the question is: is it possible to write this in one script? I thought using Multi-Time frame?

            Comment


              #7
              Hello Michael,

              I'm still understanding.

              If OnBarUpdate is running every 1 one, then its also running every 2 minutes.

              Its already running every 2 minutes.

              Adding 2 minutes series isn't going to change anything because its already running every 2 minutes.

              Are you trying to prevent it from running every 1 minute and have it only run every 2 minutes?
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              39 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              64 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X