Here is a simple and educational trading system based on moving averages logically mean reverting on the mini S&P500 US index.
// tren=filtro lungo periodo , mml media di corto periodo per le operazioni long , mms media di corto periodo per le operazioni short
tren=average[125](close)
mml=average[14](close)
mms=average[4](close)
// Condizioni per entrare su posizioni long
IF NOT LongOnMarket and close >tren and tren>tren[1] and close<mml THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
// Condizioni per uscire da posizioni long
If LongOnMarket AND close>mml and close>close[1] THEN
SELL AT MARKET
ENDIF
// Stop e target: Inserisci qui i tuoi stop di protezione e profit target
if not shortonmarket and close<tren and tren<tren[1] and close>mms then
sellshort 1 contracts at market
endif
if shortonmarket and close<mms and close<close[1]then
exitshort at market
endif
You must be logged in to post a comment.
Hallo
I am very new at this hole proreal software. Also with trading strategy. I test this one it looks good.
Is this only for uptrend? All the trades show long.
I am trading the South Africa cash 40 witch is the same as the sp500.
Do you have more strategies that I can test?
Thanks Ettienne
Hello,
Nice strategy, indeed ! Thanks for sharing.
Buy I don't understand why it is not profitable before 1994.
Do you have an idea ?
Thanks
Market were not mean reverting before this date (no real normal distribution), but it were also the end of generations of trend followers. Before electronic computer trading & internet generation, market were slow and with less volumes IMO. But perhaps giulomb has another opinion about this :)
E' tanto tempo che non lo guardo , non so neanche se il trading system soffre di iperottimizzazione , come lo scriveresti il listato ?