A 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.
//...................................................................................
// PopGunIndicator with Tradingzone
// timeframes : all
// timezone : all
// instuments : all
// here dax40 1H
// coded in january 2023
// coded by JohnScher
//...................................................................................
//..................................................................................
// for the graphics
PIP=10*pipsize //default
LIN=5 //default
rl=0
gl=250
bl=0
rs=250
gs=0
bs=0
rts = 136
gts = 0
bts = 255
//...................................................................................
// indicator PopGun
PG = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]
// the second outsidecandle determins the possible trade direction
PGLong = PG and close > open
PGShort = PG and close < open
//...................................................................................
// percentrangestart = support or resistance from the range High-Low in percent, possible entry into a trade
percentrangestart = 25
startlongtrade = (High-Low)*percentrangestart/100
// startlongtrade = High+PIP //alternativ in pips instead percent
startshorttrade = (High-Low)*percentrangestart/100
// startshorttrade = Low-PIP //alternativ in pips instead percent
slt = startlongtrade*pipsize
sst = startshorttrade*pipsize
//...................................................................................
// percentrangestart = support or resistance from the range High-Low in percent, possible entry into a trade
percentrangeend = 75
endlongtrade = (High-Low)*percentrangeend/100
// startlongtrade = High+PIP //alternativ in pips instead percent
endshorttrade = (High-Low)*percentrangeend/100
// startshorttrade = Low-PIP //alternativ in pips instead percent
elt = endlongtrade*pipsize
est = endshorttrade*pipsize
//....................................
//...................................................................................
// time_window to show and trade the PopGun
tstart = 080000 // attention it needs 3 candles for PopGun! - so e.g. in dax40 and timeframe 1H starttime ideal tstart = 110000
tend = 220000 // attention the spread in case of an overnightclose
//...................................................................................
// maincode
IF time >= tstart and time <= tend then
IF PGLong Then
DRAWARROWUP(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 trade
DRAWSEGMENT(barindex,High+elt,barindex+LIN, High+elt)coloured(rts,gts,bts) //possible exit from a trade
Endif
IF PGShort then
DRAWARROWDOWN(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 trade
DRAWSEGMENT(barindex,Low-est,barindex+LIN,Low-est)coloured(rts,gts,bts) //possible exit from a trade
Endif
Endif
//...................................................................................
return