Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Big bug in ninja trader!!! Please take a look!

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

    Big bug in ninja trader!!! Please take a look!

    Hi,

    there is a really big bug in Ninja:

    I did the following:

    1. Open a 3 Range chart of any instrument.
    2. Put this indicator on your chart
    (It's just:

    if ( Close[0] == Open[0] )
    BarColor = Color.Yellow;

    )

    3. Tell me why not every candle were the Close=Open becomes colored yellow ???

    Here a screenshot:
    Attached Files

    #2
    Originally posted by easyfresh3000 View Post
    Hi,

    there is a really big bug in Ninja:

    I did the following:

    1. Open a 3 Range chart of any instrument.
    2. Put this indicator on your chart
    (It's just:

    if ( Close[0] == Open[0] )
    BarColor = Color.Yellow;

    )


    3. Tell me why not every candle were the Close=Open becomes colored yellow ???

    Here a screenshot:
    It is double.Epsilon issue.

    You can try replacing your condition like this:

    if ( Math.Abs(Close[0] - Open[0]) < TickSize * 0.5 )
    BarColor = Color.Yellow;
    Last edited by roonius; 12-16-2009, 12:58 PM.

    Comment


      #3
      Thanks for your response!

      Now it looks better. That means every Open=Close bar
      is colored yellow.
      But also every bar were Open and Close only one tick away.

      Please look at the screenshot.
      What means double epsilon issue ?
      Attached Files

      Comment


        #4
        Originally posted by easyfresh3000 View Post
        Thanks for your response!

        Now it looks better. That means every Open=Close bar
        is colored yellow.
        But also every bar were Open and Close only one tick away.

        Please look at the screenshot.
        What means double epsilon issue ?
        I just edited my post (see below) to TickSize * 0.5

        double.Epsilon is C# thing when dealing with double values - you have to be careful when comparing them.

        I am grappling with the idea of double.Epsilon. I have written the following test: [Test] public void FuzzyDivisionTest() { double a = 0.33333d; double b = 1d / 3d; Assert.IsFalse(a == b, &quot;Built-in == operator should not be fuzzy&quot;); Assert.IsTrue( a-b &lt; double.Epsilon); Assert.IsTrue( Math.Abs(a-b) &lt; double

        Comment


          #5
          Thank you so much!!!

          I have to clarify:

          IT'S NOT A NINJA TRADER BUG.
          -only a programming issue

          NINJA TRADER IS THE BEST TRADING PLATFORM EVER !!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          51 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          30 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          99 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          177 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          170 views
          0 likes
          Last Post CarlTrading  
          Working...
          X