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 judysamnt7, 03-13-2023, 09:11 AM
                  4 responses
                  59 views
                  0 likes
                  Last Post DynamicTest  
                  Started by ScottWalsh, Today, 06:52 PM
                  4 responses
                  36 views
                  0 likes
                  Last Post ScottWalsh  
                  Started by olisav57, Today, 07:39 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post olisav57  
                  Started by trilliantrader, Today, 03:01 PM
                  2 responses
                  21 views
                  0 likes
                  Last Post helpwanted  
                  Started by cre8able, Today, 07:24 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post cre8able  
                  Working...
                  X