Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Separation of two moving averages

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

    Separation of two moving averages

    I can't quite figure out with the strategy builder how to calculate the separation of two moving averages, lets say you have a slow and fast pair of moving averages, if in the shorter moving average the price takes off, they start to separate on the screen and the fast one will be higher by several points than the slow one.

    When the market is in consolidation the two moving averages might not cross but would be closer together, and maybe separated by 1 point instead of many points as it would be in an uptrend.

    There should be some way to compare the two numbers of each moving average and set a condition for the number of points or price difference that would represent the separation of the lines.

    I have been able to figure out the Is rising and Is falling functions in builder for the moving averages which helps, but not the distance of separation of the lines. This may be useful to a lot of people. If you got any ideas about how to set this up in strategy builder, let me know.

    #2
    Hi terminatorT1000,
    It's a bit tricky, but can be done with StrategyBuilder alone, if you really push it to its limit.
    Step 1: Create a Custom Series, e.g. "SMADelta" of type double (tab "Addtional Data").
    Step 2: Set this Custom Series.
    Set 1 - "Do the following": Add -> Misc -> Set SMADelta -> Misc -> Under SMADelta ->
    a: Indicator -> SMA -> ShortPeriod,
    b: Under Properties -> Apply an Offset (math sign -) of
    c: Set -> Indicator -> SMA -> LongPeriod
    That's the first part :-).
    Step 3: Build your strategy logic
    Set 2 - "If All" -> Misc -> Rising -> Misc -> Series1 -> Pick Custom Series -> SMADelta -> Equals True
    and ... SMA Short > Short Long (or whatever additional entry conditions you want to throw in)
    Do the following: Enter Long.
    Give it a try and have some fun with Ninja.
    NT-Roland

    Comment


      #3
      Hello terminatorT1000,

      The strategy builder could trigger a condition if the lines are within a specified distance by using an offset.

      Attached a screenshots that show the first indicator plot to be within 1 point of another indicator plot.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        This looks like a real good way to do this, thank you very much!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        134 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X