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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      36 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      14 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X