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 NullPointStrategies, Today, 05:17 AM
        0 responses
        25 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        121 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X