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

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gravityflyer, Today, 09:51 PM
      0 responses
      4 views
      0 likes
      Last Post gravityflyer  
      Started by SmartArtsStudio, Today, 09:41 PM
      0 responses
      7 views
      0 likes
      Last Post SmartArtsStudio  
      Started by ntbone, Today, 09:03 PM
      6 responses
      18 views
      0 likes
      Last Post ntbone
      by ntbone
       
      Started by TheNomadicAspie, Today, 08:27 PM
      2 responses
      10 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by sdauteuil, Yesterday, 06:40 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X