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 kinfxhk, 07-14-2026, 09:39 AM
      0 responses
      127 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      105 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      85 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      105 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      86 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X