I am new to pine script & would like to ask you the simple code where it should buy at the pivotHigh & sell at the pivotLow. Thanks in advance for your help…
`//@version=5
strategy("pivot High & Low Trade", overlay = true)
leftbars = 5
rightbars = 5
pivLow = ta.pivotlow(leftbars, rightbars)
pivHigh = ta.pivothigh(leftbars, rightbars)
plotshape(pivHigh, style = shape.labelup, location = location.abovebar, offset = - rightbars)
plotshape(pivLow, style = shape.labelup, location = location.belowbar, offset = - rightbars)`
`
Please suggest the code for the same.
New contributor
bipin mahale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.