BannonMan85
New member
- Platform
-
- TradingView
Could someone convert this from tradingview to TOS?
Code:
// This source code is subject to the terms of John J. Smith, CEO of Top Options Traders Academy
// © TOP OPTIONS TRADERs ACADEMY
//@version=4
study("BUY CALLS/PUTS", overlay=true)
/// Pivots
leftbars = input(title="LeftBars", defval=9)
rightbars = input(title="Rightbars", defval=9)
ph = pivothigh(leftbars, rightbars)
pl = pivotlow(leftbars, rightbars)
/// BUY PUTS
hh = valuewhen(ph, ph, 0) > valuewhen(ph[1], ph[1], 0)
plotshape(hh, title="BUY PUTS", style=shape.labeldown, color=color.red, textcolor=color.white, location=location.abovebar, transp=10, text="BUY PUTS", offset=-rightbars, size=size.auto)
/// BUY CALLS
ll = valuewhen(pl[1], pl[1], 0) > valuewhen(pl, pl, 0)
plotshape(ll, title="BUY CALLS", style=shape.labelup, color=color.green, textcolor=color.white, location=location.belowbar, transp=10, text="BUY CALLS", offset=-rightbars, size=size.auto)