Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiTimeframe Dataseries smoothing

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

    MultiTimeframe Dataseries smoothing

    Hi, I have a strategy where I am trying to smooth the dataseries of the ADX of a different timeframe. Having a little problem trying to figure out how to use the SMA of a dataseries in a different timeframe. What I have is this (simplified):

    double nADX = ADX(BarsArray(1), 15)[0] ; // ADX in a 5' timeframe
    dsADX.Set(nADX) ; // declared as a Dataseries

    // now what I am trying to do is smooth this with an simple moving average of a higher timeframe.

    double nADXAvg = SMA(BarsArray(1), dsADX, 5) ; // which doesn't work

    I am sure there is a simple fix for this, but I sure can't see it...

    #2
    Hi jrs, please take a look at this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=3572

    Comment


      #3
      Hi Bertrand, I looked at the SampleDataSeries.OnBarUpdate and see where it is indicating using an arbitrary indicator overloaded to sync the primary and secondary DS with. Is this what you meant? As otherwise I don't see where I can get an SMA of a secondary timeframe ADX at. So if I just sync the two (primary and secondary) then run an SMA of the #2 timeframe ADX it will come out correctly?

      if (primarySeries[0] > 0 && secondarySeries[0] > 0)
      double sma_adx2 = SMA(ADX2, 5)[0] ; // this will provide an SMA of the #2 timeframe ADX ?

      Comment


        #4
        Yes, just follow along the sample. First create your dataseries and sync then up in the OnBarUpdate(), this will ensure the references ( [ ] ) to the correct bar for both frames are working.

        Then set your dataseries values with using BarsInProgress to address the correct OnBarUpdate().

        The you should be able to access your SMA ADX and implement further trading logic.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, Yesterday, 10:06 AM
        0 responses
        17 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        16 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        14 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        9 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        36 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X