Hello,
I’ve noticed that if you buy or sell and then check if you are long or shortOnMarket to place connecting limit and stop orders for exit – it takes 1 candle for the linked orders to show up. Which can result in price going against you the stop is not present or target if it rallies and then retrace with you on the wrong side all of a sudden.
I guess i could have set stopp and set target as backup but is there a way to work this out with out that?
Thanks!
That’s right, because the code is read at Close and new orders are set at next Open, it takes one bar to know there are orders at market.
You can set limit and stop every time you launch an order, they will last one bar until you can check if you are ONMARKET or not.
Or you can set ptarget and ploss like you said.