Hopefully a simple request for someone with the skill :)
Forums › ProRealTime English forum › ProOrder support › Hopefully a simple request for someone with the skill :)
- This topic has 6 replies, 3 voices, and was last updated 3 years ago by
robertogozzi.
-
-
04/27/2022 at 1:11 PM #192313
Hi all,
I would to create the following set up in Pro Real Time to then trade using IG Index.
Two trades, both entered on the same index at the same given price with defined stop loss.
One of these trades to close once a fixed number of points has been met (e.g. 20 points).
As soon as the first trade closes, move the other to break even
Second trade to close at a predefined level.
Example:
Short Dax @ 14,000
2x £5 per point
Position 1 – close when 20 points in profit
Position 2 – move to break even when Position 1 closes, with a predefined target of 13,950
Stop loss on both at opening of 50 points
The following should be able to be inputted each time:
– Opening Price
– Initial take profit for Position 1
– Take profit target for Position 2
– Stop loss
– Stake
– Valid til
Would be enormously grateful if someone could help me with this
Many thanks in advance,
Karl
<table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”0″ bgcolor=”#fff”>
<tbody>
<tr>
<td><center>
<table width=”550″ cellspacing=”0″ cellpadding=”0″ align=”center” bgcolor=”#ffffff”>
<tbody>
<tr>
<td align=”left”></td>
</tr>
</tbody>
</table>
</center></td>
</tr>
</tbody>
</table>04/28/2022 at 5:47 AM #19235004/28/2022 at 9:30 AM #19235904/29/2022 at 11:58 AM #192408There you go:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273DEFPARAM CumulateOrders = False//OpeningPrice = 14060TP1 = 20TP2 = 50SL = 20ValidTill = 210000 //set to 240000 to never stop it until either SL or TP is hitStake = 2Distance = 6EnterType = 2 //1=Long, 2=Short//OpenLots = abs(CountOfPosition)IF OpenLots < OpenLots[1] THENa = 2ENDIFIF Not OnMarket THENExitPrice = 0Stake = max(2,Stake)ExitStake = floor(Stake / 2,1)//LONG tradeIF EnterType = 1 THENIF close > (OpeningPrice + Distance) THENBUY Stake CONTRACTS AT OpeningPrice LIMITELSIF close < (OpeningPrice - Distance) THENBUY Stake CONTRACTS AT OpeningPrice STOPELSEBUY Stake CONTRACTS AT Market //comment out (or delete) this line not to enter at// market when distance is too close to the current priceENDIFENDIF//SHORT tradeIF EnterType = 2 THENIF close > (OpeningPrice + Distance) THENSELLSHORT Stake CONTRACTS AT OpeningPrice STOPELSIF close < (OpeningPrice - Distance) THENSELLSHORT Stake CONTRACTS AT OpeningPrice LIMITELSESELLSHORT Stake CONTRACTS AT Market //comment out (or delete) this line not to enter at// market when distance is too close to the current priceENDIFENDIF//SET STOP pLOSS SLSET TARGET pPROFIT TP2ENDIF//IF OnMarket AND Not OnMarket[1] THENExitPrice = TradePrice + (TP1 * PipSize)ENDIF//IF OnMarket THENMyProfit = PositionPerf * PositionPrice / PipSizeIF MyProfit >= TP1 AND (abs(CountOfPosition) = Stake) THENIF LongOnMarket THENSELL ExitStake CONTRACTS AT MARKETELSEEXITSHORT ExitStake CONTRACTS AT MARKETENDIFExitPrice = TradePriceENDIF//IF Time >= ValidTill THENSELL AT MARKETEXITSHORT AT MARKETELSIF (abs(CountOfPosition) < Stake) AND MyProfit > 0 THENIF LongOnMarket THENSELL AT ExitPrice STOPELSEEXITSHORT AT ExitPrice STOPENDIFENDIFENDIFgraphonprice ExitPrice1 user thanked author for this post.
05/03/2022 at 8:19 AM #19258005/30/2022 at 5:29 PM #19421305/31/2022 at 11:35 AM #194262There you go:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485DEFPARAM CumulateOrders = False//OpeningPrice = 14060TP1 = 20TP2 = 50SL = 20ValidTill = 210000 //set to 240000 to never stop it until either SL or TP is hitStake = 2Distance = 6EnterType = 2 //1=Long, 2=Short//IF Not OnMarket THENtempSL = SLENDIF//OpenLots = abs(CountOfPosition)IF OpenLots < OpenLots[1] THENa = 2ENDIFIF Not OnMarket THENExitPrice = 0Stake = max(2,Stake)ExitStake = floor(Stake / 2,1)//LONG tradeIF EnterType = 1 THENIF close > (OpeningPrice + Distance) THENBUY Stake CONTRACTS AT OpeningPrice LIMITELSIF close < (OpeningPrice - Distance) THENBUY Stake CONTRACTS AT OpeningPrice STOPELSEBUY Stake CONTRACTS AT Market //comment out (or delete) this line not to enter at// market when distance is too close to the current priceENDIFENDIF//SHORT tradeIF EnterType = 2 THENIF close > (OpeningPrice + Distance) THENSELLSHORT Stake CONTRACTS AT OpeningPrice STOPELSIF close < (OpeningPrice - Distance) THENSELLSHORT Stake CONTRACTS AT OpeningPrice LIMITELSESELLSHORT Stake CONTRACTS AT Market //comment out (or delete) this line not to enter at// market when distance is too close to the current priceENDIFENDIF//SET STOP pLOSS tempSLSET TARGET pPROFIT TP2ENDIF//IF OnMarket AND tempSL = SL THENMyProfit = PositionPrice * PositionPerf / PipSizeIF MyProfit >= 10 THENtempSL = min(15,SL)SET STOP pLOSS tempSLENDIFENDIF//IF OnMarket AND Not OnMarket[1] THENExitPrice = TradePrice + (TP1 * PipSize)ENDIF//IF OnMarket THENMyProfit = PositionPerf * PositionPrice / PipSizeIF MyProfit >= TP1 AND (abs(CountOfPosition) = Stake) THENIF LongOnMarket THENSELL ExitStake CONTRACTS AT MARKETELSEEXITSHORT ExitStake CONTRACTS AT MARKETENDIFExitPrice = TradePriceENDIF//IF Time >= ValidTill THENSELL AT MARKETEXITSHORT AT MARKETELSIF (abs(CountOfPosition) < Stake) AND MyProfit > 0 THENIF LongOnMarket THENSELL AT ExitPrice STOPELSEEXITSHORT AT ExitPrice STOPENDIFENDIFENDIFgraphonprice ExitPrice1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on