see attached
//...................................................................................
// 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 = 50
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
//until then