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 aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      4 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Working...
      X