• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrect marketPosition in OnExecutionUpdate()

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

    Incorrect marketPosition in OnExecutionUpdate()

    Hello,

    I have come across an discrepancy with between the OnExecutionUpdate() and the NT8 documentation.

    Documentation states that the marketPosition value passed into OnExecutionUpdate will be the market position After the Execution.

    It seems when an "Exit on session close" order is found (execution.order.name == "Exit on session close") the marketPosition is other than MarketPosition.Flat. It gives MarketPosition.Long when exiting a Short Position and MarketPosition.Short when exiting a Long Position.

    Thanks,

    #2
    Hello,

    Thank you for the post.

    I looked at the description and the Printed:

    Print("1 " + execution.MarketPosition + " 2 " + marketPosition + " 3 " + Position.MarketPosition);

    In the script, it is simply entering long and then waiting 10 bars to Exit, this was the output I received:


    Entered internal SubmitOrderManaged() method Action=Buy OrderType=Market
    1 Long 2 Long 3 Long
    Entered internal SubmitOrderManaged() method Action=Sell OrderType=Market
    1 Short 2 Short 3 Flat
    Entered internal SubmitOrderManaged() method Action=Buy OrderType=Market
    1 Long 2 Long 3 Long
    Entered internal SubmitOrderManaged() method Action=Sell OrderType=Market
    1 Short 2 Short 3 Flat

    This seems to be in line with nt7 in regard to the executions MarketPosition being reported as the Direction of the execution while the Strategies position is listed as the actual Position, in that case flat should not be reported as the order would need to have a direction.

    I will need to confirm with Product Management on the expected output of the marketPosition overload, execution.MarketPosition property and the strategies Position objects to ensure this should be listed as is, if so the help guide would likely need re worded or I will submit any needed reports in the case this is not correct.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      I just wanted to reply back, it looks like this is working as expected and the Help guide has been updated to reflect what is expected.


      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Duval, Today, 09:27 AM
      0 responses
      3 views
      0 likes
      Last Post Duval
      by Duval
       
      Started by chazyang, Today, 08:11 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by Erwin Beckers, 11-04-2018, 02:39 AM
      6 responses
      79 views
      2 likes
      Last Post koganam
      by koganam
       
      Started by sergey_z, Today, 02:34 AM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by frankduc, Today, 05:24 AM
      6 responses
      20 views
      0 likes
      Last Post frankduc  
      Working...
      X