• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieve Indicator Value n BarsAgo

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

    Retrieve Indicator Value n BarsAgo

    How do I retrieve the Value from any Indicator n BarsAgo? The following code leaves the Output Window empty and will not populate the study on the chart. I am using a 20 Period EMA 1 Bar Ago to keep things simple.

    double value = EMA(20)[1];
    Print("The previous EMA value is " + value.ToString());

    PreviousEMA.Set( EMA(eMAPeriod)[eMABarsBack] );


    Thanks

    #2
    If nothing (!) is printed in the Output then the Print statement in your code is not reached. Please always check the logs for error messages.

    Likely:
    double value = EMA(20)[1];
    causes the trouble.

    Please read more here: http://www.ninjatrader-support.com/v...ead.php?t=3170
    DierkNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ahadari28, Today, 04:01 PM
    0 responses
    3 views
    0 likes
    Last Post ahadari28  
    Started by TazoTodua, Today, 06:00 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by TazoTodua, Today, 09:06 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by gbux11, Today, 02:36 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by NinjaCustomer, 05-09-2019, 08:54 AM
    4 responses
    69 views
    0 likes
    Last Post Harry
    by Harry
     
    Working...
    X