Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnOrderUpdate and trade-arrow on chart are different time

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

    OnOrderUpdate and trade-arrow on chart are different time

    On daily chart, in OnOrderUpdate, i have:

    Print(Time[0])

    i.e: 08-Sep-18 (for all states, even filled, like it prints in OnExecution)

    however, comparing the times, Arrow on chart, always drawn on next bar (on 9th sept).

    is which overriden method i can access that moment, when the order actually happens (i want to print 9th september).

    or there is something problem in my timezone settings of chart? (i thinkthat shouldnt be the reason)
    Last edited by ttodua; 09-28-2018, 02:50 AM.

    #2
    Hello TazoTodua,

    Thanks for your post.

    Time[0] will hold the timestamp of the bar that had just closed or the timestamp of the developing bar if you using Calculate.OnEachTick or Calculate.OnPriceChange.

    OnOrderUpdate() and OnExecutionUpdate() have a time parameter that will tell you when that order updated or when that execution has occurred.

    If this information does not help resolve your inquiry, could you elaborate on what time you are trying to get?

    I look forward to being of any further assistance.

    Comment


      #3
      thanks Jim.
      well, as i mentioned, i.e. when on 8th septeber (Calculate.OnClose) on the close, the order is issued, actually it is executed on 9th september open.
      However, with print (everywhere, either in OOU or OEU events) it prints (Time[0]) as 8-09-2018 ....

      however, as i said, i want to know what event to use, which will show me the exact moment actually, when order is filled (and on chart, we see that order is filled on next day - 9th september, on open).
      Originally posted by TazoTodua View Post
      i want to print 9th september

      did i explain it bad? i think it's simple what i mean - order is issued now and executed on next bar open, however all events seem to trigger now and everywhere inside them, print returns current bar time, however, i want to catch the time when it actually was EXECUTED (and that is the next bar).

      tnx much.

      Comment


        #4
        Hello TazoTodua,

        Thanks for clarifying.

        Have you printed the time of the execution in OnExecutionUpdate?

        Code:
        		protected override void OnExecutionUpdate(Cbi.Execution execution, string executionId, double price, int quantity, 
        			Cbi.MarketPosition marketPosition, string orderId, DateTime time)
        		{
        			Print("OEU time: " + time);
        		}
        I look forward to being of further assistance.

        Comment


          #5
          yes, that's what i said, it gives me 8th sept. 10PM

          Comment


            #6
            Hello TazoTodua,

            The time of the execution can be fetched from the time parameter in OnExecutionUpdate(). For realtime data, this will be consistent with the time on your PC clock. The execution marker is placed on the developing bar who's timestamp can be fetched with Time[0] if the strategy is set to Calculate.OnPriceChange or Calculate.OnEachTick.

            With the Calculate mode set to OnPriceChange or OnEachTick, does printing Time[0] in OnExecutionUpdate() give you the time you are looking for?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            62 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            134 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X