“Guaranteed stop loss” and Partial Closure.
Forums › ProRealTime English forum › ProOrder support › “Guaranteed stop loss” and Partial Closure.
- This topic has 8 replies, 4 voices, and was last updated 3 years ago by Dow Jones.
-
-
08/02/2020 at 1:17 PM #140650
Hi all, I am working on a code as below, am using IG platform to access proOrder:
- Open x number of positions based on criteria of a strategy (usually 4)
- If the price keeps on moving in favourable conditions, keep closing 1 position at every rise of n points(usually 20), meaning all positions closed after a rise of 4*n points(eg, 80) from the level of opening the order.
- If price moves in adverse direction, a guaranteed stop loss is triggered after s points (usually 20)
Could someone please help with step 2 and 3 above, that is, booking partial profit and triggering guaranteed stop loss. Trailing guaranteed SL will be even better but not sure if it is too much to ask from the code.
Thanking you all in advance.
Kaq
08/02/2020 at 3:45 PM #1406562. is not allowed; currently partial closures are not supported by IG.
3. guaranteed stops must be selected when AutoTrading starts the strategy.
1 user thanked author for this post.
08/02/2020 at 4:33 PM #140662Thanks Robertogozzi. I will try solution advised above for point#3.
Regarding point#2, I am able to close partial positions in backtest successfully by putting a simple condition as “proof of concept”, like,
- Open 4 lots
- After every 20 candles keep closing one position…its working fine there.
The simple code is as below:
Partial Closure12345678IF NOT LongOnMarket THENBUY 4 CONTRACTS AT MARKETENDIF// Conditions to exit long positionsIf LongOnMarket AND barindex>20 THENSELL 1 contract AT MARKETENDIFHowever, I am looking for code to replace above “20 candle” condition with “20 points from original price“. please help.
08/02/2020 at 4:43 PM #140666Once guarantee SL is selected, both the initial SL and the trailing stop loss will be also a guaranteed SL. But be careful with it because IG may adjust the minimum distance of guaranteed SL accordingly to market volatility, in some cases to the 5% of the asset value, e.g. DJI during Mar 2020, it was adjusted to >1000 points, so your nearest guaranteed SL would be >1000 points. But I’m not sure if IG in all countries impose the same, it is better to clarify with your broker in advance to better understand it. There is also another discussion about guaranteed stop here, https://www.prorealcode.com/topic/guaranteed-stop-in-volatile-market/
1 user thanked author for this post.
08/02/2020 at 5:10 PM #140667Dow Jones, it seems interesting, I understand the order placed in above post was through automated system, so code may have played some role. But do you know what happens during manual guaranteed stop loss which is already in place but broker increases the minimum distance afterwards? In your example quoted, say, I had an order in place with guaranteed SL at 50 points few days before 20th March, is broker bound to honour this or they will still change to >1000 points?
08/02/2020 at 9:00 PM #140677Regarding point#2, I am able to close partial positions in backtest successfully by putting a simple condition as “proof of concept”
The PRT platform is able to handle partial closure but the broker IG does not allow partial closures via the platform. So you can back test partial closure ideas and code but not actually run any of it live.
08/03/2020 at 12:46 AM #140690what happens during manual guaranteed stop loss which is already in place but broker increases the minimum distance afterwards
Hi, my understanding is whatever is already in place will be respected. But if you intend to change the SL (auto trading or manual) or place a new trade, the minimum distance of SL will be reassessed. Let’s say if you successfully placed the guaranteed SL with 20 points, and minimum distance change to 200 points, 20 points will be still respected if you are being closed out. But if you intended to change the SL to 30 points, in case manually, I believe you can’t do so (from the UI, it won’t allow you), but in case of auto trading, then it may be changed to 200 points. Btw, I’m not saying guaranteed SL should or shouldn’t be used, it is just that important to understand also the minimum stop distance before you decide diligently if it is suitable for your strategy.
08/03/2020 at 9:34 AM #14070608/03/2020 at 10:23 AM #140715Thanks @kaq52 for your confirmation, it has been known that partial closure is not possible, but good to have this confirmation up to date. PRT only can be traded using proorder with IG so far, another broker IB also adopted PRT but doesn’t support proorder, so technically we do not have other broker.
-
AuthorPosts
Find exclusive trading pro-tools on