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 algospoke, Yesterday, 06:40 PM
      2 responses
      20 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      21 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      181 views
      0 likes
      Last Post jeronymite  
      Working...
      X