Combining STOP orders with STOP LOSS orders
Forums › ProRealTime English forum › ProOrder support › Combining STOP orders with STOP LOSS orders
- This topic has 6 replies, 3 voices, and was last updated 4 years ago by Nicolas.
-
-
11/06/2019 at 12:16 PM #112264
I have a question that I hope someone on the forum can help me answer.
This is best explained by an example:
Let’s suppose I have a system that issues a buy-order and at the same time sets a stop loss:
1234IF NOT LongOnMarket AND Close > Close[1] THENBUY 1 CONTRACT AT MARKETSET STOP %LOSS 1ENDIFLet’s say I then at a later bar want to issue a different STOP order
123IF BarIndex - TradeIndex >= 2 AND Close > PositionPrice THENSELL AT close STOPENDIFWill the system accept the new order without first cancelling the first STOP LOSS order? Ie will it reject the second STOP order because there is already a STOP order in the system? Or can a system have one STOP LOSS order at the same time as a different SELL STOP order?
In other words do I have to run the below instruction before I can issue the second STOP order?
1SET STOP %LOSS 0Many thanks for any clarification!
/F
11/06/2019 at 1:01 PM #112269You can write the second line 2 as:
1SELL AT MARKETsince that code will be always executed at closing time, thus CLOSE is the current price.
ProOrder does’n care about previous settings, whenever there’s a LONG trade open and you order it to SELL… it.
Your broker may have some objections if you don’t abide to its distance requirements.
1 user thanked author for this post.
11/06/2019 at 1:13 PM #112270Thanks! I didn’t realize it was a bad example! I will change above code to the below to hopefully make it clear what I am trying to do:
1SELL AT close * 0.995 STOPI am aware that I need to respect minimum distance requirements for any STOP or LIMIT orders
11/06/2019 at 1:46 PM #112271It will place the SELL order at your requested price level. As all pending orders it will expire after 1 bar and you will have to place it again, if needed.
But I’m not sure if this will affect your previous SL. in case your SELL order is not triggered and expires and you don’t place it again will your previous SL be remembered or you may end up without a SL.
When I trail stop loss, any time a new pending stop order is executed, IG updates the status of my trade to set a new SL, and it remains there because I set it continuously candle after candle, but I never tried to not place it again to see what happens.
It would be worth trying.
11/06/2019 at 2:11 PM #112272I just tested this strategy, it sets a SL at 200 pips from entry price, then, when onmarket, sets a new SELL pending order at 100 pips from entry price without placing it again next bar.
The original SL is kept, while for just 1 bar there’s a further pending order at -100 pips:
1234567891011ONCE Flag = 0// place a SL to 100 pips for just this time to let it expireIF OnMarket AND Flag = 0 THENSELL AT Tradeprice - 100 * pipsize STOPFlag = 1ENDIFIF Not OnMarket THENBUY AT MARKETSET TARGET pPROFIT 200SET STOP pLOSS 200ENDIF1 user thanked author for this post.
11/06/2019 at 2:21 PM #112273Thanks!
If that is correct, that’s good news for me. I remember seeing an order rejected with error message “Stop order already active”, so therefore my question. But I guess one of my systems managed to issue two stop orders during same instance in that case.
11/06/2019 at 5:28 PM #112282But I guess one of my systems managed to issue two stop orders during same instance in that case.
In that case, the first stop order read in the code is the one that will be set.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on