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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X