Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        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?
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            191 views
            0 likes
            Last Post Hasadafa  
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,230 views
            0 likes
            Last Post xiinteractive  
            Started by andrewtrades, Today, 04:57 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            7 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            441 views
            0 likes
            Last Post Delerium  
            Working...
            X