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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      72 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      152 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X