giulomb

Trading strategy reversal mini sp500

Category: Strategies By: giulomb Created: April 19, 2016, 9:53 AM
April 19, 2016, 9:53 AM
Strategies
18 Comments
Trading strategy reversal mini sp500

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

 

Download
Filename: mean-reverting-sp500-giulomb.itf
Downloads: 245
giulomb
giulomb New
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

giulomb
9 years ago
#

E' tanto tempo che non lo guardo , non so neanche se il trading system soffre di iperottimizzazione  , come lo scriveresti il listato ?

 

 

 

 

 

JR1976
9 years ago
#

Sembra performare molto bene 

 

giulomb
9 years ago
#

E' tanto tempo che non lo guardo , non so neanche se il trading system soffre di iperottimizzazione  , come lo scriveresti il listato ?

 

JR1976
9 years ago
#

It seems perform also very Well 

 

JR1976
9 years ago
#

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 ??

 

giulomb
9 years ago
#

Why ?

 

giulomb
10 years ago
#

Si

 

miguel33
10 years ago
#

Giulomb sono tre medie mobili semplici ? Grazie. Mig

giulomb
10 years ago
#

Ci sono anche trade short

 

Etta
10 years ago
#

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

 

giulomb
10 years ago
#

Per valutare se c' è overfitting , provare valori attorno a quelli inseriti

gianlox
10 years ago
#

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 

giulomb
10 years ago
#

Questa e' una ottimizzazione di lungo periodo , non esiste la taratura che funzione sempre perchè i mercati cambiamo 

Nicolas
10 years ago
#

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.

Doctrading
10 years ago
#

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

giulomb
10 years ago
#

Per Nicolas , non sono uno statistico , mi sembra funzionare e questo mi basta 

giulomb
10 years ago
#

Questa e' una ottimizzazione di lungo periodo , non esiste la taratura che funzione sempre perchè i mercati cambiamo 

Nicolas
10 years ago
#

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 :) 

ProRealCode ProRealCode
Loading...