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

Triple HMA in multiple time frames

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

    Triple HMA in multiple time frames

    Attached is my ninjascript code for an indicator I need help with. My intention is to calculate two triple HMA's off of a 5 minute chart and display the relationship between these two HMA's using the background color on my trading chart (which happens to be a 322 tick chart).

    I'm having a problem with the way I am calculating the HMA's. When I print out the values of my variables, the HMA's are being set to my 322 tick chart. I need them to be based on the 5 minute chart. Below is the print out of my HMA variables. I cannot determine why this is the case. Any assistance is greatly appreciated!

    hma1 HMA(TF 12-12 (322 Tick),12) hma2 HMA(HMA(TF 12-12 (322 Tick),12),12) hma3 HMA(HMA(HMA(TF 12-12 (322 Tick),12),12),12)
    hma1t HMA(TF 12-12 (322 Tick),12) hma2t HMA(HMA(TF 12-12 (322 Tick),12),12) hma3t HMA(HMA(HMA(TF 12-12 (322 Tick),12),12),12)
    Attached Files

    #2
    pman777, some of your logic in the script will be called on both series updates, as it's not filtered by any BarsInProgress check, is that intended?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thanks Bertrand, that should be be fine I updated the code so that actions are taken only when a specific bar is being processed. However, I am still having a problem with my HMA calculation as per the original posting.
      Attached Files

      Comment


        #4
        Thanks, let's take it back a step - are you worried about the actual values you calculate or about the printing you listed?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          ok ... the values are not correct

          Comment


            #6
            The reason for the incorrect values is that you're custom data series used is not synched to your added 5 min chart - here's a sample for how to do this step : http://www.ninjatrader.com/support/f...ead.php?t=3572
            BertrandNinjaTrader Customer Service

            Comment


              #7
              tx ... I saw this sample yesterday and didn't understand how to incorporate the 'synching' concept in my code

              Comment


                #8
                got it ... tx you Bertrand!

                Comment


                  #9
                  Ok, glad to hear pman777.
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Sparkyboy, Today, 10:57 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Sparkyboy  
                  Started by TheMarlin801, 10-13-2020, 01:40 AM
                  21 responses
                  3,917 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by timmbbo, 07-05-2023, 10:21 PM
                  3 responses
                  152 views
                  0 likes
                  Last Post grayfrog  
                  Started by Lumbeezl, 01-11-2022, 06:50 PM
                  30 responses
                  811 views
                  1 like
                  Last Post grayfrog  
                  Started by xiinteractive, 04-09-2024, 08:08 AM
                  3 responses
                  11 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Working...
                  X