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 rhyminkevin, Today, 04:58 PM
      0 responses
      5 views
      0 likes
      Last Post rhyminkevin  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      5 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      12 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      47 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      15 views
      0 likes
      Last Post bltdavid  
      Working...
      X