Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Duplicated parameters?

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

    Duplicated parameters?

    Hi I would like to ask about signature of this method:

    protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)

    Why there are parameters:
    string executionId, double price, int quantity, string orderId, ....
    when the same values are already contained in the properties of first parameter Execution execution?.

    I found the same situation in other methods like OnOrderUpdate(...)

    Isn't that some duplication - or am I missing something?
    Last edited by misova; 10-08-2015, 07:06 AM.

    #2
    Hello misova,

    Thank you for your post.

    The Execution execution would be the executions current state, where the parameters (string, int, etc.) would be calling the current call to the OnExecutionUpdate().

    This means Execution execution is the state of the execution at this point in real-time. The parameters pull from the queued call to OnExecutionUpdate().

    If someone wants the events in order, they would use the parameters. If they wanted the real-time update on the execution they would use Execution execution.

    Please let me know if you have any questions.

    Comment


      #3
      Thank you Patrick,

      thank you for explanation.
      I am afraid I could understand only partially...

      You want to say, that
      • there can be more OnExecutionUpdate(...) events stacked and waiting to be fired, because for example one big order can be filled in many small executions on various prices. That would require many calls of this method, to inform the strategy about all individual executions.
      • The currently processed event is the 1st parameter Execution execution - that I can imagine, but what the other remaining parameters really mean?



      I didn't understand the blue parts of the explanation completely:

      The Execution execution would be the executions current state, where the parameters (string, int, etc.) would be calling the current call to the OnExecutionUpdate().

      This means Execution execution is the state of the execution at this point in real-time. The parameters pull from the queued call to OnExecutionUpdate().

      If someone wants the events in order, they would use the parameters. If they wanted the real-time update on the execution they would use Execution execution.
      Last edited by misova; 10-08-2015, 12:15 PM.

      Comment


        #4
        Originally posted by misova View Post
        Hi I would like to ask about signature of this method:

        protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)

        Why there are parameters:
        string executionId, double price, int quantity, string orderId, ....
        when the same values are already contained in the properties of first parameter Execution execution?.

        I found the same situation in other methods like OnOrderUpdate(...)

        Isn't that some duplication - or am I missing something?
        Allows you to query historical executions, not only the most current.

        Comment


          #5
          How do you mean that, historical executions can be queried?

          I can imagine, If I simply store all executions into some list - in each OnExecutionUpdate(...) call,
          then I can create such a history of executions...
          Is there any other facility to achieve the same?

          Comment


            #6
            The Execution object will not be updated until the method has completely returned. So if you want to know what your previous execution price was, you could use Execution.Price vs the price parameter. This is limited to just the most recent execution state.

            There is also an Account.Execution[] collection you can query for deeper execution history that exist on the account (such as from the Executions tab of the control center)

            MatthewNinjaTrader Product Management

            Comment


              #7
              Thank you Matthew,
              clear now

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by mattbsea, Today, 05:44 PM
              0 responses
              2 views
              0 likes
              Last Post mattbsea  
              Started by RideMe, 04-07-2024, 04:54 PM
              6 responses
              31 views
              0 likes
              Last Post RideMe
              by RideMe
               
              Started by tkaboris, Today, 05:13 PM
              0 responses
              2 views
              0 likes
              Last Post tkaboris  
              Started by GussJ, 03-04-2020, 03:11 PM
              16 responses
              3,281 views
              0 likes
              Last Post Leafcutter  
              Started by WHICKED, Today, 12:45 PM
              2 responses
              19 views
              0 likes
              Last Post WHICKED
              by WHICKED
               
              Working...
              X