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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
// 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
// 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 |
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Many thanks Raul for sharing this strategy. Excellent work.
Best regards
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?
@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
I’m not the author of this strategy, sorry.
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.
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
Asi quedaria con el spread de IG
[IMG]http://i65.tinypic.com/2418ism.jpg[/IMG]
Seems to work nice on BUND – M15 with SL 70 and TP 120
I tried to backtest this code but don’t get any restults. Can any body help me?