Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetCurrentAsk on historical is wrong

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

    GetCurrentAsk on historical is wrong

    Hi,

    I found something strange. On historical data GetCurrentAsk is wrong. As it says on the reference: "Note: When accessed during a historical backtest, the close price of the evaluated bar is subsituted."

    This happens since monday. On real time it works

    UG Day: 20110916 Time: 163244 GetCurrentAsk: 17.77 Close: 18.43
    UG Day: 20110916 Time: 163302 GetCurrentAsk: 17.77 Close: 18.44
    UG Day: 20110916 Time: 163353 GetCurrentAsk: 17.77 Close: 18.47
    UG Day: 20110916 Time: 163355 GetCurrentAsk: 17.77 Close: 18.47
    UG Day: 20110916 Time: 163356 GetCurrentAsk: 17.77 Close: 18.48
    UG Day: 20110916 Time: 163407 GetCurrentAsk: 17.77 Close: 18.51
    UG Day: 20110916 Time: 163408 GetCurrentAsk: 17.77 Close: 18.51
    UG Day: 20110916 Time: 163409 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163413 GetCurrentAsk: 17.77 Close: 18.51
    UG Day: 20110916 Time: 163417 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163444 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163451 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163455 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163458 GetCurrentAsk: 17.77 Close: 18.54
    UG Day: 20110916 Time: 163549 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163553 GetCurrentAsk: 17.77 Close: 18.5
    UG Day: 20110916 Time: 163554 GetCurrentAsk: 17.77 Close: 18.52
    UG Day: 20110916 Time: 163559 GetCurrentAsk: 17.77 Close: 18.5
    UG Day: 20110916 Time: 163604 GetCurrentAsk: 17.77 Close: 18.5
    UG Day: 20110916 Time: 163608 GetCurrentAsk: 17.77 Close: 18.51
    UG Day: 20110916 Time: 163626 GetCurrentAsk: 17.77 Close: 18.48
    UG Day: 20110916 Time: 163629 GetCurrentAsk: 17.77 Close: 18.48
    UG Day: 20110916 Time: 163735 GetCurrentAsk: 17.77 Close: 18.45
    UG Day: 20110916 Time: 163737 GetCurrentAsk: 17.77 Close: 18.46
    UG Day: 20110916 Time: 163739 GetCurrentAsk: 17.77 Close: 18.45
    UG Day: 20110916 Time: 163744 GetCurrentAsk: 17.77 Close: 18.46

    #2
    Hello,

    Thanks for the note.

    Can you please send me your test line you created and I will give it a quick test on my side.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Print(Instrument.FullName + " " + " Day: " + ToDay(Time[0]) + " Time: " + ToTime(Time[0]) + " GetCurrentAsk: " + GetCurrentAsk() + " Close: " + Close[0]);

      I also found another error. On historical data, after entering a position the MarketPosition stays always flat, so it's not possible to exit. Also happens since monday.

      Flat
      Flat
      Flat
      UG Buy Day: 20110829 Time: 105400 AskPrice: 19.91
      Flat
      Flat
      Flat
      Flat
      Flat
      Flat

      Comment


        #4
        Thanks for letting me know.

        I will run a quick test on this shortly.
        BrettNinjaTrader Product Management

        Comment


          #5
          As far as the trace orders.

          If you add TraceOrders = True in the Initialize Method you will be able to trace the orders to see what is happening.

          BrettNinjaTrader Product Management

          Comment


            #6
            Hello,

            What chart are you running this on with how many bars back loaded?

            I tested on my side on a 1minute chart ES 12-11 and works for me.


            ES 12-11 Day: 20110920 Time: 104900 GetCurrentAsk: 1209.5 Close: 1209.5
            ES 12-11 Day: 20110920 Time: 105000 GetCurrentAsk: 1209.75 Close: 1209.75
            ES 12-11 Day: 20110920 Time: 105100 GetCurrentAsk: 1210 Close: 1210
            BrettNinjaTrader Product Management

            Comment


              #7
              Everything solved reinstalling NT from scratch

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              65 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              41 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              23 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              26 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              52 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X