Contrats à terme E-mini S&P 500
Long
Mis à jour

Strategia molto semplice su E-mini S&P

347
Questa è una strategia che sfrutta la tendenza mean-reversion presente sugli indici americani da molti anni. Si va long quando la chiusura della barra giornaliera è inferiore alla chiusura di 2 giorni fa. Si esce dal long quando la chiusura della barra giornaliera è superiore a quella di 2 giorni fa. Funziona al meglio su grafici daily, ma potrebbe essere usata anche sul settimanale.
Note
//version=2
strategy("C<C[2]", overlay=true)
testStartYear = input(2003, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(2, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(2020, "Backtest Stop Year")
testStopMonth = input(6, "Backtest Stop Month")
testStopDay = input(30, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

// A switch to control background coloring of the test period
testPeriodBackground = input(title="Color Background?", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na
bgcolor(testPeriodBackgroundColor, transp=97)

testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false
strategy.entry("WR long",true, when = close < close[2] and testPeriod())
strategy.close("WR long", when = close > close[2])

//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.