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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X