Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I do not understand why this code does not work

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

    I do not understand why this code does not work

    Hola. Tengo este código que funciona bien:

    if (EMA(100)[0] > EMA(250)[0] && EMA(250)[0] > EMA(380)[0])
    {
    if(Close[0] < Low[1])
    {
    Draw.Diamond(this, CurrentBar.ToString(), true, 0, High[0] + TickSize*8, Brushes.Blue);
    }
    }

    But if I modify it this way it doesn't work and I don't understand why. Can someone explain it to me? Thanks.

    if(Close[0] < Low[1])
    {
    Draw.Diamond(this, CurrentBar.ToString(), true, 0, High[0] + TickSize*8, Brushes.Blue);
    }

    #2
    before other code shown,insert this line.

    if (CurrentBar < 2)return;
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      Thanks for your reply. The problem was that Ninjascript editor was not compiling correctly. I have reinstalled Ninja and problem solved.
      I incorporate your advice into my indicator. Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      589 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      342 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
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X