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 proptrade13, Today, 11:06 AM
          0 responses
          2 views
          0 likes
          Last Post proptrade13  
          Started by kulwinder73, Today, 10:31 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by RookieTrader, Today, 09:37 AM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by terofs, Yesterday, 04:18 PM
          1 response
          24 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by CommonWhale, Today, 09:55 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X