A modified version of th ePivot Extension Strategy
//@version=2 strategy("Pivot Extension Strategy", overlay=true) leftBars = input(400) rightBars = input(200) ph = pivothigh(leftBars, rightBars) pl = pivotlow(leftBars, rightBars) if ( na(pl)) strategy.entry("PivExtLE", strategy.long, comment="Long") if (not na(ph)) strategy.entry("PivExtSE", strategy.short, comment="Short") //plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)