Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error: PlaceOrder: entry execution for existing position missing

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

    Error: PlaceOrder: entry execution for existing position missing

    I have a strategy that was working fine in live data but fails in Playback data. It is a strategy that only swaps from long to short and always has a stop loss, so it is always in a position. Also, for the reverse position code I make sure that the Exit*() finishes by testing in OnOrderUpdate that the contract count for the order and for the stop loss has gone to zero, only then do I submit another SetStopLoss() and Enter*() in the opposite direction. So it should be back to a flat position when I enter again. What does this error message mean? Thanks for any help. See image:
    Click image for larger version

Name:	Screen Shot 2022-11-12 at 9.25.29 PM.png
Views:	155
Size:	445.7 KB
ID:	1223308

    #2
    To fix this I simplified things a bit and made the SetStopLoss() call once in OnStateChange(), changing it from using a calculated Price to simply a Ticks offset. That still didn't fix it. But moving the Enter*() call from OnOrderUpdate to OnBarUpdate right after the call to Exit*() seems to have done the trick. I'll try it out again on live data when the futures open up again. It seems to be working now with Playback data.​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    51 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    129 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X