Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position.Close uses Open price for bar

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

    Position.Close uses Open price for bar

    Using Kinetick EOD data, While processing OnBarUpdate, a call is made to position.close(). The time of the call is 4PM according to Time[0], however, the price that the position is closed using the open price of the bar (presumably the price from market open that day). This totally throws off the profitability of the strategy, making it look extremely profitable when in reality the close prices are back-dated to the beginning of the day when they should be executed using the price at 4PM when the event occurs!

    Please advise on if there is a way to alter this behavior, or if I should be using some other programming construct to close positions.

    Thanks!

    #2
    Jason, with end of day data used this would be the expected outcome unfortunately. For Position.Close please also keep in mind this would be a not supported / documented method. To simulate an intraday exit you would need to use intraday data, which is available from Kinetick per subscription as well.

    Comment


      #3
      THanks for the response Bertrand,

      Seems like a bar update that occurs at the end of the bar should close the position at the end of bar price... Otherwise you close the position with a price that is much older than it should be, and quite inaccurate. In this case a price that is 8 hours old (!). It causes your test conditions to be completely invalid when they are doing analysis at one price and trading on another! I will look into the ability to derive a new class from position that can handle this better, otherwise I guess I'll have to set a flag and trade on a 1 bar delay. Perhaps your development team would be interested in either changing the behavior or creating an overload for the Close() method that could take some parameters to mitigate the issue.

      Regards,

      Jason

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, Yesterday, 04:31 AM
      0 responses
      33 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      286 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      286 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      133 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      91 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X