Using same parameters of trailing stop in simplified creation in programming
Forums › ProRealTime English forum › ProOrder support › Using same parameters of trailing stop in simplified creation in programming
- This topic has 10 replies, 3 voices, and was last updated 5 years ago by
Tintin__.
-
-
05/06/2020 at 9:55 PM #130334
Hi,
I have been trying to work out how to implement the same settings that are used in the trailing stop in the simplified creation, and use them in creation by programming as ProOrder does not allow for combined stops.
The issue seems to be for most of the other trailing stops are based on bar closing data which doesn’t not help this strategy as its done on the daily time frame, so they wait too long to be able to act on the moves. All I am looking for is an exact replica of the trailing stop in the simplified that can be used with the normal stop in programming so it can be tested in auto trading.
I have taken a screenshot of the programming done by the simplified creation to help illustrate what I am using currently. I have looked at the other trailing stops and used them in the back test but for some reason I am getting very different results, which is why I am asking for any idea’s on here. I realise there has been a lot of talk on this already but since they are showing different results I thought I need some help in understanding this.
Here is the code from simplified :
12345678910111213141516171819202122232425262728293031323334// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Conditions to enter long positionsc1 = (close > open)IF c1 THENBUY 1 PERPOINT AT MARKETENDIF// Conditions to exit long positionsc2 = (close CROSSES UNDER open)IF c2 THENSELL AT MARKETENDIF// Conditions to enter short positionsc3 = (close < open)IF c3 THENSELLSHORT 1 PERPOINT AT MARKETENDIF// Conditions to exit short positionsc4 = (close CROSSES OVER open)IF c4 THENEXITSHORT AT MARKETENDIF// Stops and targetsSET STOP pLOSS 10 pTRAILING 5SET TARGET pPROFIT 40I would really appreciate any help or insight into what I need to better understand to make this happen.
Thank you in advance for your time,
05/06/2020 at 10:46 PM #130342Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
1 user thanked author for this post.
05/07/2020 at 5:56 AM #130368Apologies for the miscopied code, here it is in the correct format.
Thank you
MODERATORS EDIT: Your first post was edited by a moderator to insert the code correctly so it was not necessary to post it again. I have deleted the code in this post to shorten the topic and make it easier to read..
05/07/2020 at 7:24 AM #130372That was the same topic, the answers you’ll read there apply to you, as well:
https://www.prorealcode.com/topic/using-set-stop-and-trail-stop/
05/07/2020 at 7:52 AM #130375ProOrder does not allow for combined stops.
Not exactly, should be read as: ProOrder with IG does not allow for combined stops.
05/08/2020 at 5:14 PM #13065005/08/2020 at 5:21 PM #130651Hi,
Yes I have read that post, and used the code in my programming. Maybe I am then asking the wrong question, in fact I probably am, sorry. What settings should I be using in that programming to get the same result as a 5 point/pip trailing stop as was entering in the simplified creation?
In the simplified I only entered one number but I need the trailing step and start in the code and this is where I am going wrong, I have read other feeds but I can’t find something that answers the equivalent question.
I did also read somewhere that it (the code) needs to wait until the end of the bar to reset, or something similar and since I am trading daily bars in the strategy this might be making it hold on to the trade rather than exiting.
I really appreciate any help in this, I hope the above makes sense.
Thank you in advance
05/08/2020 at 5:32 PM #130655At line 33 just remove the second part (after 10). Leave everything else.
In the trailing stop code set 5 for start and 1 for step.
1 user thanked author for this post.
05/16/2020 at 4:16 PM #131871Hi robertogozzi,
Thank you for clarifying that, I have had issues with PRT on my mac and havent been able to access the program recently.
The way to create the same trailing stop as you have suggested removes the profit target, correct?
I would like to keep my profit target, I have tried to find a forum post with this is in but I have found it hard to get more details on this. Essentially I am trying to recreate a strategy that I created in simplified creation to automation but because of the stops and trailing stops IG wont let me but I am struggling to find the right code, and my coding skills are not up to the task right now.
Any help would be much appreciated,Best
05/18/2020 at 9:18 AM #132090Remove the “SET STOP pLOSS 10″ from your code and add a pending stop order with:
12345//long position:sell at tradeprice-10*pointsize stop//short positionexitshort at tradeprice+10*pointsize stop1 user thanked author for this post.
06/02/2020 at 10:02 PM #134305 -
AuthorPosts
Find exclusive trading pro-tools on