Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why do I lose my plots?

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

    Why do I lose my plots?

    Although I've worked with Tradestation's Easy Language for more than 10 years, I'm having difficulty grasping some of the nuance of NinjaScript.

    Can anyone tell me why the following will work fine and I get the appropriate plot:


    fastEma.Set(SMA(Input, Fast)[0]);
    slowEma.Set(SMA(Input, Slow)[0]);

    double macd = fastEma[0] - slowEma[0];
    double Ymacd = fastEma[1] - slowEma[1];
    double macdAvg = (2.0 / (1 + Smooth)) * macd + (1 - (2.0 / (1 + Smooth))) * Avg[1];

    Value.Set(macd);
    Avg.Set(macdAvg)
    Diff.Set(macd);


    But after I make the following change the indicator compiles just fine but all plots disappear (line #5 is new):



    fastEma.Set(SMA(Input, Fast)[0]);
    slowEma.Set(SMA(Input, Slow)[0]);

    double macd = fastEma[0] - slowEma[0];
    double Ymacd = fastEma[1] - slowEma[1];
    double YYmacd = fastEma[2] - slowEma[2];
    double macdAvg = (2.0 / (1 + Smooth)) * macd + (1 - (2.0 / (1 + Smooth))) * Avg[1];

    Value.Set(macd);
    Avg.Set(macdAvg);
    Diff.Set(macd);

    Thanks in advance.

    Bob

    #2
    Please see the Control Center logs for errors. You likely do not have enough bars loaded. Please see this tip for how to address: http://www.ninjatrader-support2.com/...ead.php?t=3170
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Yep - that was it. Thank you very much for the quick response.

      Bob

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      89 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X