Pivot Crossover
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © aksharmty

//@version=4
study("Pivot Crossover",shorttitle="Pivot Crossover" ,overlay=true)
pivet2 = (close[2]+low[2]+high[2])/3
plot(pivet2, color=color.yellow, title="2nd last bar pivet", linewidth=4)
pivet1 = (close[1]+low[1]+high[1])/3

orc = pivet2 < pivet1 ? color.green : color.red
plot(pivet1, color=orc, title="last bar pivet", linewidth=4)
pivet = (close[0]+low[0]+high[0])/3
plot(pivet, color=color.white, title="current bar pivet", linewidth=4)
