//PRC_Pivot Reversal Strategy indicator - 14.02.2019 - Nicolas @ www.prorealcode.com
//
//DEFPARAM CalculateOnLastBars = 1000
// --- settings
leftp = 4
rightp = 2
//
period=max(leftp,rightp)
hh = highest[period](high)
ll = lowest[period](low)
if hh<>hh[1] then
hhbar=barindex
hhprice=high
endif
if ll<>ll[1] then
llbar=barindex
llprice=low
endif
if barindex-hhbar=rightp then
//drawtext("•",hhbar,hhprice) coloured(168,168,168)
top=hhprice
endif
if barindex-llbar=rightp then
//drawtext("•",llbar,llprice) coloured(168,168,168)
bottom=llprice
endif
if high crosses over top and lastsig<=0 then
//drawarrowup(barindex,low-atr/2) coloured(30,144,255)
lastsig=1
endif
if low crosses under bottom and lastsig>=0 then
//drawarrowdown(barindex,high+atr/2) coloured(255,48,48)
lastsig=-1
endif
SCREENER[lastsig <> lastsig[1]]