Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

decimal logic breach

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

    decimal logic breach

    NG 60 minute bar series created highest variable prints correctly at 3.054 via an added array TEST60highestPrice = Highs[2][1];
    Testing for if the last one minute bar closes above this level after the one hour mark gives a Close[0] value of 3.029 which falsely enters an order via
    && Close[0]>TEST60highestPrice .

    Clearly the TEST60highestPrice > Close[0] value and should not fire, but upon running a print check:

    Print((Close[0] - TEST60highestPrice); it prints 0.025 which should clearly be a negative value.

    How can 3.029 - 3.054 = +0.025????

    regards to all.
    Last edited by elliot5; 09-29-2020, 05:12 AM.

    #2
    Hello elliot5, thanks for posting.

    More information should be printed out here. What is the exact value of Close[0] and TEST60highestPrice? Try printing both of those individually to find why it's getting that difference.

    Best regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      The two print out values were stated above.
      Close[0] = 3.029
      TEST60highestPrice 3.054.

      When using trade execution logic of: && Close[0]>TEST60highestPrice

      the trade fires when clearly that is false.

      Print((Close[0] - TEST60highestPrice) resulted in a print of 0.0029 SHOULD BE NEGATIVE!
      .

      Comment


        #4
        Hello elliot5, thanks for your reply.

        Printing out: Print(3.029 - 3.054); is negative on my test. The only thing that would prevent a number from being negative is if the holding variable is unsigned.

        Do you have a test script I could try out? Please also let me know the exact data point you are looking at.

        I look forward to hearing from you.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ComfyCouch, Today, 06:04 PM
        0 responses
        4 views
        0 likes
        Last Post ComfyCouch  
        Started by Ousher, Today, 04:35 PM
        0 responses
        4 views
        0 likes
        Last Post Ousher
        by Ousher
         
        Started by Rugosoft, 11-17-2020, 08:22 AM
        3 responses
        37 views
        0 likes
        Last Post Shansen
        by Shansen
         
        Started by hpolthof, Today, 03:48 PM
        0 responses
        7 views
        0 likes
        Last Post hpolthof  
        Started by vivekniwas, Today, 02:26 PM
        1 response
        30 views
        0 likes
        Last Post NinjaTrader_Jermaine  
        Working...
        X