Here is a simple and educational trading system based on moving averages logically mean reverting on the mini S&P500 US index.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
// 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 |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
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 🙂
Questa e’ una ottimizzazione di lungo periodo , non esiste la taratura che funzione sempre perchè i mercati cambiamo
Per Nicolas , non sono uno statistico , mi sembra funzionare e questo mi basta
Questa e’ una ottimizzazione di lungo periodo , non esiste la taratura che funzione sempre perchè i mercati cambiamo
I saw you have optimized the moving average period for this period. That’s a better explanation for Doctrading’s question, it’s equity curve-fitted sadly.
good the basic idea, although I do not agree on optimization of the moving average because I think it overfitting, to improve the system work better on other factors
Per valutare se c’ è overfitting , provare valori attorno a quelli inseriti
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
Ci sono anche trade short
Giulomb sono tre medie mobili semplici ? Grazie. Mig
Si
HI giulomb
could you try to manage the order with buy at high/low stop instead ‘At the market’
EX:
BUY 1 CONTRACTS AT HIGH STOP
SELLSHORT 1 CONTRACT at LOW-3 STOP
It’s seems better ??
Why ?
It seems perform also very Well
Sembra performare molto bene
E’ tanto tempo che non lo guardo , non so neanche se il trading system soffre di iperottimizzazione , come lo scriveresti il listato ?
E’ tanto tempo che non lo guardo , non so neanche se il trading system soffre di iperottimizzazione , come lo scriveresti il listato ?