Breakout M5 / H4 Nasdaq
Forums › ProRealTime English forum › ProOrder support › Breakout M5 / H4 Nasdaq
- This topic has 96 replies, 9 voices, and was last updated 3 years ago by murre87.
-
-
11/03/2021 at 11:36 AM #180852
Can someone please check the functionality of my bot? Unfortunately, my coding skills are a bit limited.
The bot is supposed to
close crosses over (M5 timeframe)
high (the last of a closed candle in the H4 timeframe)
to buy.
The last closed candle in H4 to which the high refers should be red. (close12345678910111213141516171819202122232425262728293031323334353637//Nasdaq M5/H4 Breakout//================================================DEFPARAM CUMULATEORDERS = falsedefparam preloadbars = 5000//Risk ManagementPositionSize=1timeframe(4hour, updateonclose)c1 = highc2 = (Close > Open) //greenc3 = (Close < Open) //redMAxx = Average[20,1](close)mylongx = MAxx > MAxx[1]timeframe(default)// trading windowONCE BuyTime = 050000ONCE SellTime = 210000// position managementIF Time >= BuyTime AND Time <= SellTime THENIf (close crosses over c1) and c3 and mylongx Then //and not TradeOFFBuy PositionSize CONTRACTS AT MARKETSET STOP pLOSS hl //100SET TARGET pPROFIT gl //175ENDIFendifif time = 220000 and dayofweek=5 and (PositionPerf * PositionPrice / PipSize) >= 1 then //sell at marketendif11/03/2021 at 12:31 PM #180858Yes, it works perfectly!
You can append this line to check correct entries:
1graphonprice c11 user thanked author for this post.
11/03/2021 at 10:21 PM #180906thanks for sharing, this looks interesting.
Here’s a variation you might want to try. Quite good over the last 5 years, a bit flat before that – can be improved I’m sure.
Optimized on 100% data so needs more testing etc
2 users thanked author for this post.
11/03/2021 at 11:00 PM #180914this is the performance from 2017, when almost all the gains were made. Might make sense to optimize for just that period.
11/04/2021 at 10:37 AM #18093311/04/2021 at 10:41 AM #180934Yes, i tried it with either of the conditions you had (green or red) and neither seemed to help, so this enters with any break above the 4h.
I was thinking maybe an RSI condition might help, so that it only enters near the bottom of the run? or maybe use a change of direction in the MA?
1ma > ma[1] and ma[1] < ma[2]11/04/2021 at 10:56 AM #18093611/04/2021 at 11:10 AM #180937You mean a succession of lower highs – and then the break above?
1cb3 = high < high [1] and high [1] < high[2]that might work but will result in fewer trades.
11/04/2021 at 11:16 AM #18093811/04/2021 at 3:38 PM #180963Also interesting with cumulateorders = True
123456789101112131415161718timeframe(4 hour, updateonclose)h1 = highMA = Average[p,t](typicalprice)cb1 = MA > MA[1]timeframe(1 hour, updateonclose)h2 = hightimeframe(default)cb2 = close crosses over h1cb3 = close crosses over h2If Tradetime and cb1 and cb2 thenBuy PositionSize CONTRACTS AT MARKETelsif longonmarket and CB1 and cb3 and COUNTOFLONGSHARES < PosMax thenBUY positionsize CONTRACT AT MARKETENDIF11/04/2021 at 5:08 PM #180971Nice setup. It also runs in 3m too.
11/04/2021 at 5:22 PM #180974I’ll have a look tomorrow. I use EMA15> EMA15 [1] as the H4 filter. I tested it over 10 years ago. I think that it is not optimized too much. I’m not sure about the outbreaks yet. I tested red highs when I got a big drawdown in the summer of 2019. But … same with green highs. If you take all the highs, the drawdown is almost gone. Would be nice to know why, of course. Maybe my stop is too close? I’m at 100Pips SL. In my strategies in the M15, that’s usually enough. You use 1.8% … I find that almost too far. Or what do you think?
11/04/2021 at 5:25 PM #180975@Vinzentvega Yes, it looks good in the M3. But also just knows there were no sideways phases in the time. That’s why I’m undecided.
11/04/2021 at 5:54 PM #180978I’m at 100Pips SL
at present values, 100 points is nothing – around 0.6% – your position will close out way too soon.
10 years ago the NAS was at 1600 so at that point your backtest would be working with a stoploss of around 6%, which no one would use. Even 5 years ago 100pts would have been over 2%
% STOP LOSS keeps it relative to the price level, gives a more realistic picture.
1.8% gave the lowest DD in my tests, 2% shows slightly higher profit
11/04/2021 at 6:54 PM #180983 -
AuthorPosts
Find exclusive trading pro-tools on