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 frslvr, 04-11-2024, 07:26 AM
            8 responses
            111 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by stafe, 04-15-2024, 08:34 PM
            10 responses
            44 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by rocketman7, Today, 09:41 AM
            3 responses
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by traderqz, Today, 09:44 AM
            2 responses
            5 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by rocketman7, Today, 02:12 AM
            7 responses
            31 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X