Stochastic EURUSD 5min strategy

Category: Strategies By: Andres Created: May 20, 2016, 5:24 PM
May 20, 2016, 5:24 PM
Strategies
6 Comments

Hello all!,

I wrote this code making probes with the stochastic indicator:

  • Long positions are opened when stochastic is in oversold several candles, price is over a moving average and there is a cross between the “K” and “D” lines.
  • Short positions are opened with the opposite conditions.

Parameters are optimized for 5min EURUSD.

Results are got with 1.2 spread and 1000€.

My conclusion is the strategy could be positive but I think parameters are overfitted to get a good profit curve.

Feel free to comment, change, probe and improve the code!!

Andrés.

DEFPARAM CumulateOrders = False

//Parametros Estocastico
indEstocastico = Stochastic[14,3](close)
indMediaEstocastico = Average[5](Stochastic[14,3](close))
indMedia= ExponentialAverage[50000](close)


//Condiciones para posiciones cortas

valorEstacasticoMasBajo = lowest[NumeroVelasShort](Stochastic[14,3](close))
NumeroVelasShort = 4
NivelHigh= 87
DistanciaStopShort=60
DistanciaProfitShort=48

c1 = (valorEstacasticoMasBajo >= NivelHigh)
c2 = close < indMedia
c3 = (indEstocastico CROSSES UNDER indMediaEstocastico)

IF c1 AND c2 AND c3 THEN
 SELLSHORT 1 CONTRACT AT MARKET
 set stop loss DistanciaStopShort*pointsize
 SET TARGET PROFIT DistanciaProfitShort*pointsize
ENDIF

//Condiciones para posiciones largass

valorEstacasticoMasAlto = Highest[NumeroVelasLong](Stochastic[14,3](close))
NumeroVelasLong = 6
NivelLow= 15
DistanciaStopLong=65
DistanciaProfitLong=35

c6 = (close >= indMedia)
c4 = (valorEstacasticoMasAlto <= NivelLow)
c5 = (indEstocastico CROSSES OVER indMediaEstocastico)

IF c6 AND c4 AND c5 THEN
 BUY 1 CONTRACT AT MARKET
 set stop loss DistanciaStopLong*pointsize
 SET TARGET PROFIT DistanciaProfitLong*pointsize
ENDIF

 

Download
Filename: Estocastico-EURUSD-5min.itf
Downloads: 415
Andres Average
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

Logo Logo
Loading...