Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Distance between EMA and SMA

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

    Distance between EMA and SMA

    I would appreciate help with a simple matter, at least I think it is simple:

    Here is what I want to do:

    Build a condition where I want to have a distance of a minimum of 4 ticks between the EMA 13 and the SMA 20. I believe I can do so in the Strategy wizard's condition builder. But how?

    I chose EMA 13 on the left side, and SMA 20 on the right side. Let's say to go long so I chose in the middle the "is larger than" symbol.

    The parameter fields below then ask for:

    For the EMA 13:
    InputSeries DefaultInput
    Plot BuyPressure
    Bars ago 0
    Offset type Ticks
    Offset 0
    Plot on chart False

    For the SMA 20:
    InputSeries DefaultInput
    Plot BuyPressure
    Bars ago 0
    Offset type Ticks
    Offset 0
    Plot on chart False

    What do I have to input where in these two parameter fields to accomplish what I said above (wanting a distance of 4 ticks between the two MAs.)

    sandman

    #2
    sandman, you'll have to set the offset to 4 to get what you want. However, you will need to create two sets of conditions because sometimes the EMA will be above the SMA and sometimes it will be the other way around. You'll need to create an offset that depends on the relative positions of the moving averages.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you Austin.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmoran13, Yesterday, 01:02 PM
      0 responses
      27 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      18 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      160 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      95 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      148 views
      2 likes
      Last Post CaptainJack  
      Working...
      X