How do you clear stop orders?
Forums › ProRealTime English forum › ProOrder support › How do you clear stop orders?
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by
juanj.
-
-
06/15/2018 at 8:08 PM #73382
Good Day, I am writing a strategy that opens stop orders at specific times but I want them to expire or be canceled if certain conditions are met. The defparam flatafter function will not suffice as it is a 24h strategy.
So the question is how do I cancel stop orders once placed?
06/15/2018 at 8:22 PM #73384The manual says set the value to zero but it does not work. Which reminds me that Nicolas was supposed to get back with the answer from PRT regarding that!
You could just put in something like:
1SET Stop %Loss 100Then the instrument would have to go to zero to hit the stop.
06/15/2018 at 10:47 PM #73391Pending orders expire each bar and, if needed, must be placed again and again.
So DEFPARAM FLATAFTER/FLATBEFORE do not affect them and CUMULATEORDERS=FALSE doesn’t as well.
If some conditions arise to cancel them, well… just wait the closing of the current bar (you cannot do otherwise, since any strategy is executed only at that very moment)!
06/15/2018 at 11:10 PM #73392I think we need to clarify whether you are placing your stop orders on the market via a SET instruction or via a SELL at x STOP instruction.
I’m guessing the former as otherwise as Robertogozzi says they would just be cancelling themselves anyway.
06/16/2018 at 6:29 PM #73447I am aware of the fact that stop orders have to be placed (renewed) on each execution, however, I have found that even after my criteria is no longer met orders are still being triggered.
I would also love to know how to ‘update’ and ‘cancel’ set stop (stoploss) and set profit (target) levels.
06/16/2018 at 7:01 PM #7344912Sell at x stopExitshort at x stopThese will last only one bar and then be cancelled. If they are still on the market then it is either that your code has placed them again or you have a problem that you should report to PRT.
123SET stop pLoss xSET stop $Loss xSET stop %loss xThese are on the market until the position has been closed.
You can change the value at any time but if you are on a limited risk account then you can only move them closer (don’t get me started on the stupidity of this!)
There are one or two topics on here about the fact that:
1SET stop pLOSS 0is supposed to (according to the PRT documentation) cancel the SET stop but it does not. People normally see fantastic false results if they use a value of zero.
Nicolas spoke to PRT about this but he keeps forgetting to pass the info on to us. Hopefully after his weekend of rest he will be able to! 🙂
It is best to either only use Limit and Stop orders and not put them back on the market if you want to cancel one or if using the SET instruction then do what I said in my first post:
1SET Stop %Loss 10006/16/2018 at 7:39 PM #73450 -
AuthorPosts
Find exclusive trading pro-tools on