Breakout next 5 Bars
Forums › ProRealTime English forum › ProOrder support › Breakout next 5 Bars
- This topic has 46 replies, 5 voices, and was last updated 1 year ago by Chrisinobi.
-
-
01/22/2023 at 11:46 AM #207851
Thx, dont know whats wrong yesterday. Now it works if the first bar behind the popgun breaks out. Do you have any solution for the last 4 bars?
01/22/2023 at 11:59 AM #207852Now it works if the first bar behind the popgun breaks out. Do you have any solution for the last 4 bars?
If you are using a low value for A4 and A6 then likely bar 1 after the popgun will be the bar where a trade is entered.
Please post a screenshot showing an example of where bars 2 to 4 after popgun should enter a trade but do not.
01/22/2023 at 5:05 PM #207887PopGunSystem with TradingZone12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485//...................................................................................// PopGunSystem with Tradingzone// timeframes : all// timezone : all// instuments : all// here dax40 1H// here timezone europe, berlin// coded in january 2023// coded by JohnScher//...................................................................................defparam cumulateorders = trueonce ordersize = 1once tradeon = 0//...................................................................................// indicator PopGunPG = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]// the second outsidecandle determins the possible trade directionPGLong = PG and close > openPGShort = PG and close < open//...................................................................................// percentrangestart = support or resistance from the range High-Low in percent, possible entry into a tradepercentrangestart = 25startlongtrade = (High-Low)*percentrangestart/100startshorttrade = (High-Low)*percentrangestart/100slt = startlongtrade*pipsizesst = startshorttrade*pipsize//...................................................................................// percentrangestart = support or resistance from the range High-Low in percent, possible exit from a tradepercentrangeend = 50endlongtrade = (High-Low)*percentrangeend/100endshorttrade = (High-Low)*percentrangeend/100elt = endlongtrade*pipsizeest = endshorttrade*pipsize//...................................................................................// time_window to trade the PopGun, kick off in daily or higher timeframeststart = 110000 // attention it needs 3 candles for PopGun! - so e.g. in dax40 and timeframe 1H starttime ideal tstart = 110000tend = 210000 // attention the spread in case of an overnightclose//...................................................................................// maincode// determine timeIF time >= tstart and time <= tend then// case longtradeIF not longonmarket and PGLong Thentradeon = 1Entry = sltEndifIF tradeon >5 or longonmarket thentradeon = 0Elsif tradeon[1] > 0 thentradeon = tradeon + 1EndifIf tradeon thenbuy ordersize contracts at Entry Stopset stop loss lowset target profit eltEndif//case shorttradeIF not shortonmarket and PGShort Thentradeon = 1Entry = sstEndifIF tradeon >5 or shortonmarket thentradeon = 0Elsif tradeon[1] > 0 thentradeon = tradeon + 1EndifIf tradeon thensellshort ordersize contracts at Entry Stopset stop loss highset target profit estEndifEndif2 users thanked author for this post.
01/22/2023 at 5:06 PM #207888Hi, heres an example. The third bar should be fill the buy order.
01/22/2023 at 5:11 PM #207891The trade starts at entry stop
the entry stop = high + 25 percent from the range high-low
you can change the entry stop auf 0 percent, so the trade start at high stop
// schönen Gruß an tippi
// und korrigiere mal deinen Namen Killerplautze01/22/2023 at 5:49 PM #207894The third bar should be fill the buy order.
What value were you using for A4?
01/22/2023 at 7:26 PM #207906I have tried out 1, 5 and 10.
01/22/2023 at 7:39 PM #207911Please say what instrument and timeframe and values of A4 to A7 and at exactly what date and time you are analysing then I will set up exactly the same conditions and we can compare notes etc?
If anybody can spot something I’ve missed or you wish to tweak the code further (or rewrite code from scratch) then please feel free.
01/22/2023 at 8:53 PM #207920A popgun is a well-known chart pattern consisting of 3 candles. 2 outside candles that completely enclose an inside candle with its highs and lows.
For the sake of simplicity, the breakout is traded in the trend direction which is determined by the 2nd outside candle. This is where the impulse wave according to the Elliot Wave Theory comes into play. The breakout is determined when the high or low of the 2nd outside candle is exceeded within the next 5 candles. There is a little or no dispute about this.
The difficulties are determining in the target!
The question arises whether to use points in general or points or a percentage of the price of the value or as a percentage of the 2nd outside or even as a percentage of the 1st outside candle or even more so according to some other target profit or a trailings stop or or or….Here we worked with percentages of the 2nd outside.
The author means that one jumps into the impulse coming from the 2nd outside and then takes the impulse over a certain “distance”, e.g. from 25% of the range of the 2nd outside to 50% of the range of the 2nd outside. Cause PopGuns can be traded in all markets and all time frames, so you can take this “distance” very often with gains.1 user thanked author for this post.
01/22/2023 at 9:11 PM #207922see attached
PopGunIndicator with TradingZone123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990//...................................................................................// PopGunIndicator with Tradingzone// timeframes : all// timezone : all// instuments : all// here dax40 1H// coded in january 2023// coded by JohnScher//...................................................................................//..................................................................................// for the graphicsPIP=10*pipsize //defaultLIN=5 //defaultrl=0gl=250bl=0rs=250gs=0bs=0rts = 136gts = 0bts = 255//...................................................................................// indicator PopGunPG = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]// the second outsidecandle determins the possible trade directionPGLong = PG and close > openPGShort = PG and close < open//...................................................................................// percentrangestart = support or resistance from the range High-Low in percent, possible entry into a tradepercentrangestart = 25startlongtrade = (High-Low)*percentrangestart/100// startlongtrade = High+PIP //alternativ in pips instead percentstartshorttrade = (High-Low)*percentrangestart/100// startshorttrade = Low-PIP //alternativ in pips instead percentslt = startlongtrade*pipsizesst = startshorttrade*pipsize//...................................................................................// percentrangestart = support or resistance from the range High-Low in percent, possible entry into a tradepercentrangeend = 50endlongtrade = (High-Low)*percentrangeend/100// startlongtrade = High+PIP //alternativ in pips instead percentendshorttrade = (High-Low)*percentrangeend/100// startshorttrade = Low-PIP //alternativ in pips instead percentelt = endlongtrade*pipsizeest = endshorttrade*pipsize//....................................//...................................................................................// time_window to show and trade the PopGuntstart = 080000 // attention it needs 3 candles for PopGun! - so e.g. in dax40 and timeframe 1H starttime ideal tstart = 110000tend = 220000 // attention the spread in case of an overnightclose//...................................................................................// maincodeIF time >= tstart and time <= tend thenIF PGLong ThenDRAWARROWUP(barindex,Low-PIP)coloured(rl,gl,bl)DRAWSEGMENT(barindex,High,barindex+LIN,High)coloured(rl,gl,bl)DRAWSEGMENT(barindex,Low,barindex+LIN,Low)coloured(rl,gl,bl)DRAWSEGMENT(barindex,High+slt,barindex+LIN, High+slt)coloured(rts,gts,bts) //possible entry into a tradeDRAWSEGMENT(barindex,High+elt,barindex+LIN, High+elt)coloured(rts,gts,bts) //possible exit from a tradeEndifIF PGShort thenDRAWARROWDOWN(barindex,High+PiP)coloured(rs,gs,bs)DRAWSEGMENT(barindex,High,barindex+LIN, High)coloured(rs,gs,bs)DRAWSEGMENT(barindex,Low,barindex+LIN,Low)coloured(rs,gs,bs)DRAWSEGMENT(barindex,Low-sst,barindex+LIN,Low-sst)coloured(rts,gts,bts) //possible entry into a tradeDRAWSEGMENT(barindex,Low-est,barindex+LIN,Low-est)coloured(rts,gts,bts) //possible exit from a tradeEndifEndif//...................................................................................return//until then1 user thanked author for this post.
01/22/2023 at 9:30 PM #20792701/22/2023 at 9:38 PM #20792801/22/2023 at 9:39 PM #20792901/23/2023 at 9:04 AM #207935I’m sorry.
I need to revise the code again. The stop does not work correctly yet.
Will done next weekend.2 users thanked author for this post.
01/27/2023 at 3:57 PM #208499I’m a bit confused now, are you guys talking about an indicator or an algo now???? Find the popgun interesting as an indicator. Even better in Algo, of course ??? Is there a ready made algo as Itf. ????
-
AuthorPosts
Find exclusive trading pro-tools on