"1 par jour !" Stratégy on DJ H1 ( one par day)
Forums › ProRealTime English forum › ProOrder support › "1 par jour !" Stratégy on DJ H1 ( one par day)
- This topic has 9 replies, 3 voices, and was last updated 7 years ago by Nicolas.
-
-
06/17/2017 at 8:09 PM #38515
Hello ! 🙂
Here is a strategy that takes only one position per day. On the DJ in h1 at the opening.
This is my version of a classic strategy that I am trying to improve.
It is very simple: we take position once a day in the direction of the trend. Trend confirmed by the MACD and an MA100 at the time of opening.
We exit postion with the ATR trailing stop (code on prorealcode) :
12345678910111213141516171819202122232425262728293031// Périodep = 14// Average True Range XATRx = AverageTrueRange[p](close) * 1.5// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRxELSIF close crosses under ATRts THENATRts = close + ATRxENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFreturn ATRts as "ATR Trailing Stop"I did not over-optimize it. I code it on 50 000 unit and i test on 200 000 unit. The Spread of 1.8 is included. Starting capital 1000 usd.
The problem is that there are sometimes long series of losses.
Any ideas to reduce the drawdown or to improve the strategy will be appreciated 🙂
TheAccountant
PS : Google translation is my new friends now 🙂 🙂 🙂
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152// Définition des paramètres du codeDEFPARAM CumulateOrders = False // Cumul des positions désactivé// Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position avant l'heure spécifiéenoEntryBeforeTime = 145000timeEnterBefore = time >= noEntryBeforeTime// Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position après l'heure spécifiéenoEntryAfterTime = 151000timeEnterAfter = time < noEntryAfterTime// Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiésdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// Conditions pour ouvrir une position acheteuseindicator1 = Average[100](close)c1 = (close > indicator1)indicator2 = MACD[12,26,9](close)c2 = (indicator2 > 0)IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions pour fermer une position acheteuseindicator3 = CALL "ATR trailling Stop"c3 = (close CROSSES UNDER indicator3)IF c3 THENSELL AT MARKETENDIF// Conditions pour ouvrir une position en vente à découvertindicator4 = Average[100](close)c4 = (close < indicator4)indicator5 = MACD[12,26,9](close)c5 = (indicator5 < 0)IF (c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Conditions pour fermer une position en vente à découvertindicator6 = CALL "ATR trailling Stop"c6 = (close CROSSES OVER indicator6)IF c6 THENEXITSHORT AT MARKETENDIF// Stops et objectifsSET STOP pLOSS 5006/17/2017 at 8:58 PM #38521Hi Accountant,
Thanks so much for your reply!!!! I will take a look to your system, although I am afraid I am not going to be able to test it for more than 100.000 units, since PRT does not allow more than that.
I can see you have a very narrow timeframe: 14:50-15:10h, so I cannot apply to my system. I operate in M15 from 09:00 to 14:00 and the average time for an operation is 30-60 min, so after that time another one is open. I am browsing the different forums and getting new ideas, but in any case, I do appreciate your help.
As I said, I will review your code and if I see any room for improvement, I will let you know.
Very best,
Juan
P.S.- Good luck with Google translation. I am living in Germany and I can’t live without it ;))))))))
1 user thanked author for this post.
07/04/2017 at 7:01 PM #39817hello !
For now the positions taken directly on the demo account are exactly the same as the backtest !
07/05/2017 at 9:09 AM #3984307/05/2017 at 9:33 AM #39846I do not understand what you mean ? I use the 100sma and the MACD. ( une ptite trad en french de “the slope” ? 🙂 ou une ptite explication de ce que tu veux dire en french ? )
07/05/2017 at 9:39 AM #3984807/05/2017 at 12:53 PM #39874ok thank ! 🙂
I do not know how to do that. I can put price above or below but according to the Slope I do not know
07/05/2017 at 1:02 PM #39877You can compute a simple slope just by comparing if the current period value of the indicator is superior or inferior to the previous one:
12sma100=average[100]bullish=sma100>sma100[1]Or you can also add a filter to know the current slope is bullish since 10 bars for example:
123sma100=average[100]bullish=sma100>sma100[1]longtermbullish=summation[10](bullish)=1007/05/2017 at 3:51 PM #39893Ok thank you Nicolas. I tested both ways and it’s not better for the drawdown.
I also tried to add a 50sma (sma 50> sma100 for buy) and replaced ATR trailing stop by a simple trailing stop : It’s a little better for the winnings but still with a big drawdown 🙁
07/05/2017 at 4:06 PM #39895 -
AuthorPosts
Find exclusive trading pro-tools on