Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA(200) value

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

    EMA(200) value

    Hello: Can anyone tell me how I can access the value of an EMA (200) from an indicator? I tested with EMA (200). Input [0] but has no worked.

    I need to compare it with the close [0] price.

    Thanks in advance.

    #2
    sometimes seem easier to ask here to read the help, no?I answer myself.

    // Prints the current value of a 20 period EMA using default price type
    double value = EMA(20)[0];
    Print("The current EMA value is " + value.ToString());
    // Prints the current value of a 20 period EMA using high price type
    double value = EMA(High, 20)[0];
    Print("The current EMA value is " + value.ToString());

    Comment


      #3
      Hello AlePaciotti,

      Thank you for your post.

      Glad to hear you resolved your issue. One additional note is that some indicators will not accept a double value as input. It would need to be in a DataSeries. The tutorial below can assist with creating this into a DataSeries.
      Ryan M.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      14 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      13 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,983 views
      3 likes
      Last Post jhudas88  
      Working...
      X