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!
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
NinjaTrader
Error: PlaceOrder: entry execution for existing position missing
Collapse
X
-
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:
Tags: None
-
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.
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
14 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
||
Started by strategist007, Yesterday, 07:51 PM
|
0 responses
14 views
0 likes
|
Last Post Yesterday, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,983 views
3 likes
|
Last Post
by jhudas88
Yesterday, 06:59 PM
|
Comment