Announcement

Collapse
No announcement yet.

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?

    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?

        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

            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.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  574 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  332 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  553 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  551 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X