Stop loss and take profit
Forums › ProRealTime English forum › ProOrder support › Stop loss and take profit
- This topic has 14 replies, 6 voices, and was last updated 6 years ago by Vonasi.
-
-
03/29/2018 at 5:47 AM #66646
I need some help please. In my strategy I would like the stop to be 2 pips lower than the low of the previous candle. It is a fixed stop and should not move. The profit should then be my stop loss in pips * 1.5. I just cannot get it right.
Thank you
03/29/2018 at 7:40 AM #66651Topic moved to automatic trading forum.
Below is an example of how to set a stoploss on the Low of the previous candlestick, minus 2 points below it. With an adjusted takeprofit size calculated with the stoploss distance.
123456if not lononmarket and buycondition thenbuy 1 contract at marketstoploss = close-(Low[1]-2*pointsize)set stop loss stoplossset target profit stoploss*1.5endif03/29/2018 at 8:03 AM #6665507/07/2018 at 6:35 PM #75542Hello Nicolas,
I hope you are doing well, I tried to implement your code* into my program but it doesn’t work. *I removed the 2 first lines, and instead of putting the SL 2 pips below the low of the previous day, I decided to put it at the lowest price of the 2 last candlesticks.
The issue I have is that my code closes my trades straight after opening them.
You can find below your code l implemented after my buying conditions.
SL - TP BUY123456789101112IF c1 AND c2 THENBUY 1 CONTRACT AT MARKETENDIF// Conditions pour fermer une position acheteusec7 = close-(Lowest[2](low))set stop loss c7set target profit c7*2IF c7 THENSELL AT MARKETENDIFI hope you can help me to fix that!
Many thanks in advance,
07/07/2018 at 7:37 PM #75544Remove this part of your code:
123IF c7 THENSELL AT MARKETENDIFc7 will always return a positive value so it will always sell. You do not need it as the SET instructions will set the stoploss at the lowest low of the two candles at the open of each bar.
07/07/2018 at 8:13 PM #75545Lines 6-7-8 will change each bar making your SL and TP mobile, I am not sure it’s what you meant to have.
07/07/2018 at 8:55 PM #75549Lines 6-7-8 will change each bar making your SL and TP mobile, I am not sure it’s what you meant to have.
I thought I would answer the first question before waiting for the second question! 🙂
07/08/2018 at 10:17 AM #75567Good morning,
Thank you both of you for your help !
And no, I dont want any trailing stop or take profit moving at each bar. I want them settled up once at the opening at the trade and that’s it.
How can I make this happen please?
Thank you in advance,
07/08/2018 at 10:34 AM #7556907/14/2018 at 1:51 PM #7598207/14/2018 at 7:46 PM #76008Below is an example of how to set a stoploss on the Low of the previous candlestick, minus 2 points below it. With an adjusted takeprofit size calculated with the stoploss distance
Congratulations you have won a prize for being No 50 in GraHal’s Link Library
The Prize is a BIG THANK YOU to you and all the other contributors to the Link Library
Snippet Link Library07/14/2018 at 8:00 PM #76011The Prize is a BIG THANK YOU to you and all the other contributors to the Link Library
Being statistically motivated I just worked out that 31% of the snippets are mine and the next highest contributors are Nicolas and Robertogozzi on 18% each. So 31% of the prize is technically mine. From my analysis of these results I have concluded that I need to switch off the laptop and go and do something else a bit more often. I will start with switching it off and opening a beer. 🙂
1 user thanked author for this post.
07/14/2018 at 8:07 PM #76012Vonasi, you deserve 31% of the prize for snippets, but 62% of empty cans!
1 user thanked author for this post.
07/14/2018 at 9:01 PM #76017From my analysis of these results I have concluded that I need to switch off the laptop and go and do something else a bit more often. I will start with switching it off and opening a beer.
From seeing the performance of your Demo account in the last few months when you get it Live we will all give you a big thank you (again) but this time for the beers and party aboard your big new Yacht (pass your old boat to Nicolas and Roberto! ) 🙂
07/14/2018 at 9:21 PM #76020 -
AuthorPosts
Find exclusive trading pro-tools on