Raul Vg

S&P500 automated trading strategy - EEUU 500 MINI 1€ 1HORA

Category: Strategies By: Raul Vg Created: February 5, 2017, 9:29 AM
February 5, 2017, 9:29 AM
Strategies
9 Comments
S&P500 automated trading strategy - EEUU 500 MINI 1€ 1HORA

Good afternoon,

I share this robot so that we try to improve it among all, to add screenshots and more files, this is the thread in the forum to do it:

 

Automatic trading strategy for S&P500 forum topic

It is a robot that only enters long operations, with a spread of 0.4 pts, in the mini 1 € SPRTD 500.

It consists of 4 indicators: MACD, Stochastic, moving average, and an indicator that makes the time of ichimoku.

The robot, buy when the price is below the “clouds” of Miindicador (3) (ichimoku), but should be in turn above the moving average and the MACD and Stochastic be positive. (Example of thread operation in the forum) and closes with the take profit or stop loss or when the price falls below the “cloud”.

INDICADOR

// Ichimoku Pr-K Bin Better
p1 = 9
p2 = 26
p3 = 52
// aa es decimal para multiplicar el ATR, mayor que cero
aa = 1
n = 14

//REM Tenkan-Sen
Upper1 = HIGHEST[p1](HIGH)
Lower1 = LOWEST[p1](LOW)
Tenkan = (Upper1 + Lower1) / 2
//REM Kijun-Sen
Upper2 = HIGHEST[p2](HIGH)
Lower2 = LOWEST[p2](LOW)
Kijun = (Upper2 + Lower2) / 2
//REM Senkou Span A
SpanA = (Tenkan[p2] + Kijun[p2]) / 2
//REM Senkou Span B
SpanB = ((HIGHEST[p3](HIGH[p2])) + LOWEST[p3](LOW[p2])) / 2
//prix = choix du prix
prix=customclose
if prix >= spana and prix >= spanb then
 vv=1
else
 vv=0
endif
if prix <= spana and prix <= spanb then
 rr=1
else
 rr=0
endif
if vv[1] = 1 and vv = 0 and rr = 0 then
 vv = 1
elsif rr[1] = 1 and rr = 0 and vv = 0 then
 rr = 1
endif

if vv = 1 then
 c=1
else
 c=-1
endif
cambioarojo = (c[1] = 1 AND c = -1)
cambioaverde = (c[1] = -1 AND c = 1)
KumoRosa = (SpanA < SpanB)
KumoAzul = (SpanA > SpanB)

IF cambioarojo THEN
 IF KumoRosa THEN
  BetterKumo = SpanA
 ELSIF KumoAzul THEN
  BetterKumo = SpanB
 ENDIF
ELSIF cambioaverde then
 IF KumoRosa THEN  
  BetterKumo = SpanB
 ELSIF KumoAzul THEN
  BetterKumo = SpanA
 ENDIF
ELSE
 BetterKumo = BetterKumo[1]
ENDIF

//// myatr, myemaatr, mycero, mysup = CALL "EDJ ATR"[14 ,26]
//myatr, ignored, ignored, ignored = CALL "EDJ ATR"[14 ,26]
myatr = AverageTrueRange[n](close)
atrmas = BetterKumo + (aa*myatr)
atrmenos = BetterKumo - (aa*myatr)
//atrmasint = BetterKumo + (aa*mysup)
//atrmenosint = BetterKumo - (aa*mysup)

return BetterKumo COLOURED BY c as "Pr-K Bin Better", atrmas as "ATR mas", atrmenos as "ATR menos"

 

ROBOT

// Definición de los parámetros del código
DEFPARAM CumulateOrders = true // Acumulación de posiciones desactivada

// Condiciones para entrada de posiciones largas
indicator1 = ExponentialAverage[24](MACDline[21,44,24](close))
indicator2 = MACDline[21,44,24](close)
c1 = (indicator1 <= indicator2)

indicator3 = Stochastic[28,8](close)
indicator4 = Average[22](Stochastic[28,8](close))
c2 = (indicator3 >= indicator4)

indicator8 = close + 5
ignored, ignored, indicator9 = CALL "MiIndicador(3)"(close)
c6 = (indicator8 <= indicator9)

indicator11 = close
indicator21 = ExponentialAverage[43](close)
c11 = (indicator11 >= indicator21)

IF c1 AND c2 AND c6 and c11 THEN
 BUY 5 CONTRACT AT MARKET
ENDIF

// Condiciones de salida de posiciones largas
ignored, indicator10, ignored = CALL "MiIndicador(3)"(close)
c7 = (close CROSSES under indicator10)

IF c7 THEN
 SELL AT MARKET
ENDIF
SET STOP pLOSS 100
SET TARGET pPROFIT 60

 

Download
Filename: EEUU-500-MINI-1E-1HORA.itf
Downloads: 1130
Download
Filename: MiIndicador3-1.itf
Downloads: 950
Raul Vg
Raul Vg Senior
Operating in the shadows, I hack problems one by one. My bio is currently encrypted by a complex algorithm. Decryption underway...
Author’s Profile

Comments

hvluthy@sunrise.ch
9 years ago
#

I tried to backtest this code but don't get any restults. Can any body help me?

bjoern
9 years ago
#

Seems to work nice on BUND - M15 with SL 70 and TP 120

Iber0
10 years ago
#

Asi quedaria con el spread de IG

[IMG]http://i65.tinypic.com/2418ism.jpg[/IMG]

Iber0
10 years ago
#

Con esta modificación reinviertes las ganancias y la curva mejora bastante arriesgando menos de inicio:

posicion = (400 + STRATEGYPROFIT)/1600

IF c1 AND c2 AND c6 and c11 THEN
BUY posicion CONTRACT ROUNDEDUP AT MARKET
ENDIF
 

juanj
10 years ago
#

@Nicholas, are there by any chance you can confirm test results in PRT 10.3 on one or two other markets? (i.e. FTSE, DAX, DOW or S&P500)

I unfortunately only have access to local markets (South Africa) at this stage and performance look very different on our market.

 

Regards

Raul Vg
10 years ago
#

Hello, please comment on the forum link that appears in the description. In that same forum is adapted to dow, thanks. As for the others, I personally have not tried it.

Nicolas
10 years ago
#

I'm not the author of this strategy, sorry.

Dymjohn
10 years ago
#

Looks very impressive but don't understand the phrase "an indicator that makes the time of ichimoku.". How do you display the miIndicator for ease of interpretation? The default is three lines?

Jesús
10 years ago
#

Many thanks Raul for sharing this strategy. Excellent work.

Best regards

ProRealCode ProRealCode
Loading...