SuperTrend
3 risposte
Graham Ferguson
5 mesi fa #288840
Ciao,
I am trying (and failing) to build a template in AlgoWizard to mimic the open and close positions as per this indicator.
The indicator uses a simple ATR period and multiplier and a source of hl2.
Is there anyone who can help me construct a template to achieve this?
Graham Ferguson
5 mesi fa #288841
MT5 indicator file attached
Graham Ferguson
5 mesi fa #288842
For some reason I cannot upload the indicator file here, this is a link to it on Google Drive: https://drive.google.com/file/d/19MxBxvAt3K5B21Ix3fNVpxDKZ97eQY6D/view?usp=sharing
Adam Cox
1 mese fa #289900
I have found Supertrend Strategy that i’m using on my tradingview, and take automate trades.
You can check this code:
//@version=5
strategy(‘Supertrend Strategy – PineConnector’, overlay=true)
LicenseID = 601234567890 // 1. change to your PineConnector License ID (required)
riskvalue = input.int(1, ‘Risk Value’) // 2. Change the risk value (optional)
atrPeriod = input(10, ‘ATR Length’)
factor = input(3, ‘Factor’)
[supertrend, direction] = ta.supertrend(factor, atrPeriod)
bodyMiddle = plot((open + close) / 2, display=display.none)
upTrend = plot(direction < 0 ? supertrend : na, ‘Up Trend’, color=color.new(color.green, 0), style=plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, ‘Down Trend’, color=color.new(color.red, 0), style=plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps=false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps=false)
if ta.change(direction) < 0
strategy.entry(‘Long’, strategy.long)
alert(str.tostring(LicenseID)+’,buy,’ + syminfo.ticker + ‘,risk=’ + str.tostring(riskvalue), alert.freq_once_per_bar_close)
if ta.change(direction) > 0
strategy.entry(‘Short’, strategy.short)
alert(str.tostring(LicenseID)+’,sell,’ + syminfo.ticker + ‘,risk=’ + str.tostring(riskvalue), alert.freq_once_per_bar_close)
plotshape(ta.change(direction) < 0, style=shape.labelup, location=location.belowbar, color=color.new(#046ff9, 0), size=size.large, text=’PineConnector \n Buy’, textcolor=color.new(color.white, 0))
plotshape(ta.change(direction) > 0, style=shape.labeldown, location=location.abovebar, color=color.new(#046ff9, 0), size=size.large, text=’PineConnector \n Sell’, textcolor=color.new(color.white, 0))
I have found this code from this sito web.
Stai visualizzando 3 risposte - da 1 a 3 (di 3 totali)