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).
    Paul H.NinjaTrader Customer Service

    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
        Paul H.NinjaTrader Customer Service

        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 NRITV, Today, 01:15 PM
          2 responses
          8 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Started by frankthearm, Today, 09:08 AM
          7 responses
          31 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by maybeimnotrader, Yesterday, 05:46 PM
          5 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by quantismo, Yesterday, 05:13 PM
          2 responses
          19 views
          0 likes
          Last Post quantismo  
          Started by adeelshahzad, Today, 03:54 AM
          5 responses
          33 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X