Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Distancia entre dos EMA

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

    Distancia entre dos EMA

    Hola, estoy preparando una estrategia en la que necesito saber el valor de la diferencia entre dos EMAs en un determinado momento ( barra actual ) u otras.
    Tengo el Ninjatrader 7 y no sé cómo hacer esto,
    Gracias.

    #2
    Hello deividfor,

    Thanks for your post and welcome to the NinjaTrader forums!

    You stated, "...I need to know the value of the difference between two EMAs at a given time (current bar) or others..."

    You would be able to do this in Ninjascript code by subtracting the values of the EMAs and storing the difference in a variable. For example:

    double diff = EMA(13)[0] - EMA(20)[0]; // diff will hold the difference between the two.

    In the above example [0] is the bars ago reference and 0 (zero) refers to the current bar, you can change the "bars ago" reference as needed.

    If the value of the variable "diff" is negative then that would show that the EMA(13) is below the EMA(20) while a positive value would indicate that the EMA(13) is above the EMA(20).

    Comment


      #3
      Muchas gracias Paul, entiendo lo que me dices, pero... hay alguna forma de colocarlo como setup en una estrategia sin tener que escribir el código manualmente?
      Hay alguna forma de hacer con las opciones que te deja el programa?
      Lo que quiero es poner como setup algo así:
      Que la diferencia entre EMA13 y EMA39 sea menor de 1 punto

      Comment


        #4
        Hello deividfor,

        Thanks for your reply.

        For example, using an instrument where 1 point = 10 ticks.

        You can use the strategy wizard in NinjaTrader7 to create the condition of comparing the EMA(39) to the EMA(13)+10 * TickSize and comparing the EMA(39) to the EMA(13) - 10 * TickSize.

        Please see the attached examples of strategy wizard conditions and on chart demonstration.
        Attached Files

        Comment


          #5
          Hola deividfor
          ¿Tal vez puedas usar el indicador "Price oscillator" con parámetros 13 / 39 / 1 ?
          Es exactamente lo que tú quieres - EMA(39) menos EMA(13)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          85 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          47 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          29 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          67 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X