For those interested a pinescript to use in tradingview calculating reversals multi-complex system

written in 10 min, can be improved with elected reversal not being displayed anymore
//@version=2
//decipher11
study("[RS]Reversal", overlay=true)
Mod = input(true, title="box checked : 3-5-13-23 Reversal (Commodities and Dow) - unchecked 4,8,16,26 Reversals (Ind Stocks)")
r1 = Mod ? 3 : 4
r2 = Mod ? 5 : 8
r3 = Mod ? 13 : 16
r4 = Mod ? 23 : 26
topl1 = valuewhen ( high >= highest(high,13), low[r1],0)
toph1 = valuewhen ( low <= lowest(low,13), high[r1], 0)
topl12 = valuewhen (high >=highest(high,13), low[r2], 0)
toph12 = valuewhen (low <= lowest(low,13), high[r2], 0)
topl13 = valuewhen (high >=highest(high,13), low[r3], 0)
toph13 = valuewhen (low <= lowest(low,13), high[r3], 0)
topl14 = valuewhen (high >=highest(high,13), low[r4], 0)
toph14 = valuewhen (low <= lowest(low,13), high[r4], 0)
tl1 = plot(topl1, color =topl1 != topl1[100] ? na : red, linewidth=2, style=linebr, offset=0)
th1 = plot(toph1, color =toph1 != toph1[100] ? na : green, linewidth=2, style=line, offset=0)
tl12 = plot(topl12, color =topl12 != topl12[1] ? na : red, linewidth=2, style=linebr, offset=0)
th12 = plot(toph12, color =toph12 != toph12[1] ? na : green, linewidth=2, style=line, offset=0)
tl13 = plot(topl13, color =topl13 != topl13[1] ? na : red, linewidth=2, style=linebr, offset=0)
th13 = plot(toph13, color =toph13 != toph13[1] ? na : green, linewidth=2, style=line, offset=0)
tl14 = plot(topl14, color =topl14 != topl14[1] ? na : red, linewidth=2, style=linebr, offset=0)
th14 = plot(toph14, color =toph14 != toph14[1] ? na : green, linewidth=2, style=line, offset=0)
//
hey Marty, can you imagine, if I had an hour to lose I would have been able to rewrite SOCRAPS !