//PRC_Hoffman's scalp TIP
//version = 0
//14.03.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//////////////////////////////////////////////////////////////////////
//---------------------------Inputs-------------------------------
usevol = 0 //Use volume oscillator for signals
z = 45 // Inventory Retracement Percentage %
//--------------------------------------------------------------
//------------------Moving Averages-------------------------------
sma5 = average[5](close)
ema18 = average[18,1](close)
ema20 = average[20,1](close)
sma50 = average[50](close)
ema144 = average[144,1](close)
//--------------------------------------------------------------
//---------------Hoffmans bar retracements-----------------------
// Candle Range
a = abs(high - low)
// Candle Body
b = abs(close - open)
// Percent to Decimal
c = z/100
// Range Verification
rv = b < c*a
// Price Level for Retracement
x = low + (c * a)
y = high - (c * a)
sl = rv=1 and high > y and close < y and open < y
ss = rv=1 and low < x and close > x and open > x
//--------------------------------------------------------------
//-----------Volume Oscillator----------------------------------
once cumvol = 0
cumvol = volume+cumvol
shortlen = 5 //Short Length
longlen = 10 //Long Length
short = average[shortlen,1](volume)
long = average[longlen,1](volume)
osc = 100*(short-long)/long
//--------------------------------------------------------------
//-------------Plot Statement-----------------------------------
LongHoff = sl and sma5>ema18 and ema18>ema20 and ema20>ema144 and low>sma5
ShortHoff = ss and sma5<ema18 and ema18<ema20 and ema20<ema144 and high<sma5
if useVOL then
longcondition = LongHoff and close > sma50 and osc > 0
shortcondition = ShortHoff and close < sma50 and osc > 0
else
longcondition = LongHoff and close > sma50
shortcondition = ShortHoff and close < sma50
endif
screener[longcondition or shortcondition](longcondition as "LG",shortcondition as "SH")