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

Multi time frame problem

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

    Multi time frame problem

    I have some code where I have multiple timeframes. (60 minute and a 5 minute period)
    I have a bool in place that when on the 60 min timeframe some conditions take place. This one goes to true. I want to use this bool in my 5 min period ( which is in the chart. The 60 min bool is triggered in the chart and will show the string "3"). But the bool wil only set the first period of 5 min @ true instead of all the 12 5 min periods. (12*5=60 ).

    How can I get this to fill in all the 12 periods @ true.


    thx

    Bas
    Attached Files

    #2
    Hello basanca,
    Welcome to the forum and I am happy to assist you.

    Are you resetting the boolean value anywhere in your code.


    Can you send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.

    *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi Joydeep,

      Yes I'm resetting the bool at the end of the code. I'll try to make the stripped down version.

      thx

      Comment


        #4
        Hello basanca,
        Historical bars are calculated at the end of the bar. Thus the 12 bars 5 minute bars are processed before one 60 minute bar could be processed. If you reset the boolean value (to false) at the end of the first 5 minute bar then the subsequent 5 minute bars wont get updated. Please refer to our help guide here to know more about multi-series concepts
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I now see what it does, it is indeed the reset of the bool after the 5 min period.
          Will amend..


          thx

          Comment


            #6
            Hello basanca,
            Thanks for your note.

            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,262 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,429 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, 04-16-2024, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            41 views
            0 likes
            Last Post jeronymite  
            Working...
            X