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 2 years ago by murre87.
-
-
11/29/2021 at 3:00 PM #182475
So weit bin ich heute nicht. Ich denke, M3 auch, oder M2 würde auch funktionieren. Gleicher Zeithorizont, nur schneller. Die Langversion von M3 funktioniert am besten an der Nasdaq. M1 auf SP500 und Dax. Ich habe Dow Jones noch nicht ausprobiert.I’m not that far today. I think M3 too, or M2 would work too. Same time horizon, only faster. The long version of M3 works best on the Nasdaq. M1 on SP500 and Dax. I haven’t tried Dow Jones yet.
11/29/2021 at 3:02 PM #18247611/29/2021 at 3:08 PM #182477I Combined Phonetzs code and made a long/short-version
How to make i better?
Break-H4 Nasdaq M3123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189//Break-H4 Nasdaq M3//================================================DEFPARAM CUMULATEORDERS = falsedefparam preloadbars = 5000//Risk ManagementPositionSize=1timeframe(4hour, updateonclose)barCount = barIndexc1 = highD1 = lowc2 = (Close > Open) //greenc3 = (Close < Open) //redc4 = (high < high[1])//lowerhighc5 = (high > high[1])//higherhigh//MACDLiniex = MACDline[12,26,9](close) > 0MA5xx = Average[3,1](typicalprice) //closeMA10xx = Average[10,1](typicalprice) //closeMA15xx = Average[15,1](typicalprice) //15,1 closemylongx = MA15xx > MA15xx[1] //and MA5xx > MA15xx// and MA10xx > MA15xxMA5xxs = Average[19,1](typicalprice) //close//MA10xx = Average[m2,1](typicalprice)MA15xxs = Average[20,1](typicalprice) //15,1...40,6 close//MA100xx = Average[m3,1](typicalprice) //closemyshortx = MA15xxs < MA15xxs[1] and MA5xxs < MA15xxs //and MA10xx < MA15xx//mylongx2 = MA100xx > MA100xx[1]shortcond = myshortxtimeframe(default)once tradeOn = 1if intradayBarIndex = 0 thentradeOn = 1endiftradeBar = barCountif not onMarket and tradeBar<>tradeBar[1] thentradeOn = 1endif//VolaititätfilterAvgRange = average[20,0](range)TradeOFF = range > (AvgRange * 3) //no trading if the current range > twice its average //3//myshort = MA < MA[1]// trading windowONCE BuyTime = 080000ONCE SellTime = 215500// position managementIF Time >= BuyTime AND Time <= SellTime THENIf not onmarket and close crosses over c1 and mylongx and c3 and tradeOn Then //and not c5Buy PositionSize CONTRACTS AT MARKETSET STOP %LOSS 0.9 //100SET TARGET %PROFIT 1 //125tradeOn = 0ENDIFIf not onmarket and close crosses over c1 and mylongx and c2 and tradeOn Then //and not TradeOFF and c3 close crosses over c1Buy PositionSize CONTRACTS AT MARKETSET STOP %LOSS 0.8 //100SET TARGET %PROFIT 1 //125tradeOn = 0ENDIFIf not onmarket and close crosses under D1 and shortcond and tradeOn Thensellshort PositionSize CONTRACTS AT MARKETSET STOP %LOSS 0.7 //0.8SET TARGET %PROFIT 0.8 //1tradeOn = 0ENDIFendifif time = 220000 and dayofweek=5 and (PositionPerf * PositionPrice / PipSize) >= 5 then //sell at marketexitshort at marketendif////////////////////////////////////////// %trailing stop function incl. cumulative positionsonce trailingstoptype = 1if trailingstoptype then//====================trailingpercentlong = 0.32 // %trailingpercentshort = 0.55 // %once acceleratorlong = 0.015 // typically tst*0.1once acceleratorshort= 0.025 // typically tss*0.1ts2sensitivity = 2 // [1] close [2] high/low [3] low/high [4] typicalprice//====================once steppercentlong = (trailingpercentlong/10)*acceleratorlongonce steppercentshort = (trailingpercentshort/10)*acceleratorshortif onmarket thentrailingstartlong = positionprice*(trailingpercentlong/100)trailingstartshort = positionprice*(trailingpercentshort/100)trailingsteplong = positionprice*(steppercentlong/100)trailingstepshort = positionprice*(steppercentshort/100)endifif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thennewsl = 0mypositionprice = 0endifpositioncount = abs(countofposition)if newsl > 0 thenif positioncount > positioncount[1] thenif longonmarket thennewsl = max(newsl,positionprice * newsl / mypositionprice)elsenewsl = min(newsl,positionprice * newsl / mypositionprice)endifendifendifif ts2sensitivity=1 thents2sensitivitylong=closets2sensitivityshort=closeelsif ts2sensitivity=2 thents2sensitivitylong=hights2sensitivityshort=lowelsif ts2sensitivity=3 thents2sensitivitylong=lowts2sensitivityshort=highelsif ts2sensitivity=4 thents2sensitivitylong=(typicalprice)ts2sensitivityshort=(typicalprice)endifif longonmarket thenif newsl=0 and ts2sensitivitylong-positionprice>=trailingstartlong thennewsl = positionprice+trailingsteplong + 0.2endifif newsl>0 and ts2sensitivitylong-newsl>=trailingsteplong thennewsl = newsl+trailingsteplongendifendifif shortonmarket thenif newsl=0 and positionprice-ts2sensitivityshort>=trailingstartshort thennewsl = positionprice-trailingstepshortendifif newsl>0 and newsl-ts2sensitivityshort>=trailingstepshort thennewsl = newsl-trailingstepshortendifendifif barindex-tradeindex>1 thenif longonmarket thenif newsl>0 thensell at newsl stopendifif newsl>0 thenif low crosses under newsl thensell at marketendifendifendifif shortonmarket thenif newsl>0 thenexitshort at newsl stopendifif newsl>0 thenif high crosses over newsl thenexitshort at marketendifendifendifendifmypositionprice = positionpriceendifif (shortonmarket and newsl > 0) or (longonmarket and newsl>0) thenif positioncount > positioncount[1] thenif longonmarket thennewsl = max(newsl,positionprice * newsl / mypositionprice)endifif shortonmarket thennewsl = min(newsl,positionprice * newsl / mypositionprice)endifendifendif//////////////////////////////////////////////////////////////11/29/2021 at 3:13 PM #182479Mein Plan wäre, beide Versionen, lang und kurz, einzeln laufen zu lassen. Ohne eine Vollversion daraus zu machen.My plan would be to run both versions, long and short, individually. Without making a full version out of it.
11/29/2021 at 4:01 PM #182483Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Thank you 🙂
11/29/2021 at 4:03 PM #182484Maybe one more question for the great masters … Nicolas? Robertogozzi? If you manage entries from large time units with a trailing stop … which TF is best used for this? M1… 5? Is more data history better or faster reaction to a trailing stop?
I usually use 5-minute or 10-minute TFs for the trailing stop, mainly because they grants more data history, compared to smaller TFs.
1 user thanked author for this post.
11/29/2021 at 4:36 PM #182488I made a quick attempt to add short to this but it didn’t seem worth it, I’ll have another try when I get time.
This is a minor revision to my long version, trying to get the DD as low as poss (positionsize = 0.5)
These are the key changes:
12345678910111213141516timeframe(4 hour, updateonclose)H4 = highMA = Average[p,t](close)cb1 = MA > MA[1]timeframe(15 minutes)mb = average[p1,t1](typicalprice)cb4 = mb > mb[1]timeframe(default)ST = SuperTrend[m,n]STa = SAR[q,w,e]cb2 = (close > ST) or (close > STa)cb3 = close crosses over H411/30/2021 at 9:46 AM #18251011/30/2021 at 11:47 AM #182517You can have a go if you have time to crunch the numbers. The core of it would look like this:
123456789101112131415161718192021222324timeframe(4 hour, updateonclose)H4 = highL4 = LowMA = Average[p,t](close)cb1 = MA > MA[1]MAs = Average[p2,t2](close)cs1 = MAs < MAs[1]timeframe(15 minutes)mb = average[p3,t3](typicalprice)cb2 = mb > mb[1]mbs = average[p4,t4](typicalprice)cs2 = mbs < mbs[1]timeframe(default)ST = SuperTrend[m,n]STa = SAR[q,w,e]cb3 = (close > ST) or (close > STa)cs3 = (close < ST) or (close < STa)cb4 = close crosses over H4cs4 = close crosses under L41 user thanked author for this post.
11/30/2021 at 12:08 PM #18252012/02/2021 at 3:52 PM #182728Thanks alot for the input nonetheless. I made an attempt for long/short-version.
Do u guys see any improvements? nonetheless, robertogozzi, phoentzs?
I want to get rid of the big drawdown in december 2021.Backtest with Size 0.5
CUMULATEORDERS = false1 user thanked author for this post.
12/02/2021 at 4:50 PM #182736In the itf both the % trail and ATR trail are active, which one did you want to use?
12/02/2021 at 5:00 PM #18273712/02/2021 at 5:13 PM #182739I am not sure if the idea is a good one. Isn’t that what affects each other? Unfortunately, due to the sudden drop in the Nasdaq over the last few days, the SL had to take action. That’s why the last few days lost in long mode. I personally help myself with this by splitting the risk over several systems. In that case I use half a position in TF M3 and a half position in TF M1. M1 made a profit from the faster trailing stop, M3 a loss.
12/02/2021 at 5:20 PM #182741that sounds weird to me, I think there will be conflicts in the code, I’ll have a closer look at it later.
-
AuthorPosts
Find exclusive trading pro-tools on