Episodic Pivot
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © yogy.frestarahmawan
// original idea by stockbee episodic pivot screen 1

//@version=4
study("Episodic Pivot", overlay = false)

cond1 = if close / close[1] > 1.04 
    true 
else 
    false

sma50vol = sma(volume, 50)
cond2 = if volume > 3 * sma50vol 
    true 
else 
    false
    
cond3 = if volume > 300000
    true 
else 
    false 
    
val = if cond1 and cond2 and cond3
    1
else 
    0
    
plot(series=val, style = plot.style_columns, color=val > 0 ? color.green : color.red)