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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          154 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          306 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          345 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          176 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X