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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      63 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      90 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      47 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      105 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      63 views
      0 likes
      Last Post PaulMohn  
      Working...
      X