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.

    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.

        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.

          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

            Comment


              #7
              Everything solved reinstalling NT from scratch

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by haas88, 03-21-2024, 02:22 AM
              19 responses
              220 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by ZeroKuhl, Yesterday, 04:31 PM
              4 responses
              30 views
              0 likes
              Last Post ZeroKuhl  
              Started by cupir2, Yesterday, 07:44 PM
              3 responses
              22 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by reynoldsn, Yesterday, 07:26 PM
              2 responses
              16 views
              0 likes
              Last Post reynoldsn  
              Started by MartinT, 05-17-2023, 06:00 AM
              18 responses
              175 views
              0 likes
              Last Post flybuzz
              by flybuzz
               
              Working...
              X