A simple n-days breakout system
Forums › ProRealTime English forum › ProOrder support › A simple n-days breakout system
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by Vonasi.
-
-
01/25/2018 at 1:21 PM #60500
Hello everyone Ivan Donatiello Here,
My proposal is to program a trading system similar to the orginal turtles trading rule.
The conditions are simple, they are as follows:
1. Buy buy stop at highest n days
2. Stop loss at lowest n days
3 exit at n daysThe exact opposite for the trade short!
You can help me?
If there was already an equal or similar argument to implement the code, please forgive me and link it to me 🙂
01/25/2018 at 2:11 PM #60510Topic moved to ProOrder support forum, since related to automatic trading. Please use the ProRealTime forum support only for platform related queries.
This strategy is very similar to the “turtle trading strategy” IMO.
It could be coded like this: (not tested)
1234567891011121314defparam cumulateorders=falsen = 20if not longonmarket thenbuy 1 contract at highest[n](high)[1] stopstoploss = close-lowest[n](low)[1]endifset stop loss stoplossif onmarket and barindex-tradeindex(1)>=n thensell at marketendifSince you used the N variable 3 times in your description, I used it also 3 times: for the highest high, lowest low and bars quantity to close order.
01/25/2018 at 5:17 PM #60524I’, sorry for having made a wrong section.
Yes Nicolas, it’s about that system, I’m trying to adapt everything to my operation, I do a search and insert my rules.
If I find something good, I share
Thank you 🙂 🙂 🙂
06/24/2019 at 3:10 PM #101322Greetings to all, I tried to encode the short version of this system. But I couldn’t, this is the code I got but it doesn’t work:
123456789101112131415defparam cumulateorders=falsen = 10n1 = 20if not longonmarket thenSELLSHORT 1 contract at lowest[n](low)[1] stopstoploss = close-highest[n](high)[1]endifset stop loss stoplossif onmarket and barindex-tradeindex(1)>=n1 thensell at marketendifCan anyone help me figure out where the problem is?
06/24/2019 at 5:02 PM #101329Ivan Donatiello – Please use the Insert PRT Code’ button whenever you post code in your replies to make it easier for others to read. I have tidied up your post for you 🙂
Replace SELL with EXITSHORT in your code.
06/24/2019 at 5:05 PM #101330 -
AuthorPosts
Find exclusive trading pro-tools on