This strategy was explained at The Forex Day in Madrid by Lex Smirnoff in 2015. I’m Adolfo so, A-LEX will be a beautiful name for it! :-). Is explained to trade it in GBP/USD in 1 hour chart.
Since I <3 indexes like DAX or DOW couln’d wait to test it. Since March I’m doing discretionary trading on both markets in a real account, with profitable results (38,12%), first trades were made with 7% risk per trade, but I’ll no longer recommend it for you or anyone, it’s crazy!
A lot of entrance were missed by my fault, just wondering about if it’s a good moment or not…. will keep rising? or not? Low confidence took me here, and finally I can share it with you, is already automated. Enjoy it!
Requirements
.ITF file: ALEX ATB Indicator Signal (Click and get it)
Indicator code:
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 |
<span class="token comment" spellcheck="true"><span class="token keyword">REM</span> Variables</span> mm <span class="token operator">=</span> Exponentialaverage<span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">close</span><span class="token punctuation">)</span> <span class="token keyword">once</span> uma<span class="token operator">=</span><span class="token indicators">Highest</span><span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">high</span><span class="token punctuation">)</span> <span class="token keyword">once</span> umb<span class="token operator">=</span><span class="token indicators">Lowest</span><span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">low</span><span class="token punctuation">)</span> objetivo<span class="token operator">=</span><span class="token number">45</span><span class="token operator">*</span><span class="token keyword">pipsize</span> <span class="token keyword">if</span> <span class="token keyword">High</span> <span class="token operator">></span> mm <span class="token keyword">and</span> <span class="token keyword">Low</span> <span class="token operator"><</span> mm <span class="token keyword">then</span> <span class="token comment" spellcheck="true">// TOuching Ema8</span> tb <span class="token operator">=</span> <span class="token keyword">BarIndex</span> ltp <span class="token operator">=</span> mm uma <span class="token operator">=</span> mm umb <span class="token operator">=</span> mm <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token keyword">low</span><span class="token operator">></span>mm <span class="token keyword">then</span> <span class="token comment" spellcheck="true">// New bullsih movement</span> n <span class="token operator">=</span> <span class="token keyword">BarIndex</span> <span class="token operator">-</span> tb uma<span class="token operator">=</span><span class="token indicators">Highest</span><span class="token punctuation">[</span>n<span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">high</span><span class="token punctuation">)</span> umb<span class="token operator">=</span>mm <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token keyword">high</span><span class="token operator"><</span>mm <span class="token keyword">then</span> <span class="token comment" spellcheck="true">// New bearish movement</span> m <span class="token operator">=</span> <span class="token keyword">BarIndex</span> <span class="token operator">-</span> tb umb<span class="token operator">=</span><span class="token indicators">Lowest</span><span class="token punctuation">[</span>m<span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">low</span><span class="token punctuation">)</span> uma<span class="token operator">=</span>mm <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>uma<span class="token operator">-</span>ltp<span class="token punctuation">)</span><span class="token operator">></span>objetivo <span class="token keyword">and</span> uma<span class="token operator">></span>mm <span class="token keyword">then</span> <span class="token comment" spellcheck="true">// buy condition</span> compra<span class="token operator">=</span><span class="token number">1</span> <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>uma<span class="token operator">-</span>ltp<span class="token punctuation">)</span><span class="token operator"><=</span>objetivo <span class="token keyword">then</span> compra<span class="token operator">=</span><span class="token number">0</span> <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>ltp<span class="token operator">-</span>umb<span class="token punctuation">)</span><span class="token operator">></span>objetivo <span class="token keyword">and</span> umb<span class="token operator"><</span>mm <span class="token keyword">then</span> <span class="token comment" spellcheck="true">// short condition</span> venta<span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span> <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>ltp<span class="token operator">-</span>umb<span class="token punctuation">)</span><span class="token operator"><=</span>objetivo <span class="token keyword">then</span> venta<span class="token operator">=</span><span class="token number">0</span> <span class="token keyword">endif</span> Return compra <span class="token keyword">coloured</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">128</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span> <span class="token keyword">as</span> <span class="token string">"compra"</span><span class="token punctuation">,</span> venta <span class="token keyword">coloured</span><span class="token punctuation">(</span><span class="token number">220</span><span class="token punctuation">,</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token number">60</span><span class="token punctuation">)</span> <span class="token keyword">as</span> <span class="token string">"venta"</span> |
Recomendations
3000 € / $ and max risk of 2% per trade.
Indicators
1 2 |
<span class="token indicators">ExponentialAverage</span><span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">close</span><span class="token punctuation">)</span> <span class="token indicators">ExponentialAverage</span><span class="token punctuation">[</span><span class="token number">18</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">close</span><span class="token punctuation">)</span> |
How it works
Firstly, is a simple trend following system.
Look for a fast price move in whatever direction, this movement must be longer than 45 pips from last touch with Ema8, and then a retracement touching Ema8 will fill our limit order and join the trend.
Fixed Stop ploss and target pprofit give us unreal vision of the strategy in the backtest. However I’ll keep trading it since is profitable for me since March, not as good as backtest results shows, of course… but very interesting… 😉
Why not?
CODE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<span class="token keyword">defparam</span> <span class="token keyword">cumulateorders</span><span class="token operator">=</span><span class="token boolean">false</span> <span class="token keyword">defparam</span> <span class="token keyword">preloadbars</span><span class="token operator">=</span><span class="token number">8</span> <span class="token keyword">defparam</span> <span class="token keyword">flatbefore</span><span class="token operator">=</span><span class="token number">090000</span> <span class="token keyword">defparam</span> <span class="token keyword">flatafter</span><span class="token operator">=</span><span class="token number">213000 </span> mycompra<span class="token punctuation">,</span> myventa <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"ALEX ATB Indicator"</span> ema<span class="token operator">=</span><span class="token indicators">ExponentialAverage</span><span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">close</span><span class="token punctuation">)</span> advance<span class="token operator">=</span><span class="token keyword">abs</span><span class="token punctuation">(</span><span class="token keyword">round</span><span class="token punctuation">(</span>ema<span class="token operator">-</span>ema<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span> mylot<span class="token operator">=</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">(</span>Strategyprofit<span class="token operator">+</span><span class="token number">3000</span><span class="token punctuation">)</span><span class="token operator">*</span><span class="token number">0.02</span><span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">30</span><span class="token punctuation">)</span> <span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token keyword">longonmarket</span> <span class="token keyword">and</span> mycompra<span class="token operator">=</span><span class="token number">1</span> <span class="token keyword">then</span> BuyPrice <span class="token operator">=</span> ema<span class="token operator">+</span>advance <span class="token keyword">buy</span> mylot <span class="token keyword">contract</span> <span class="token keyword">at</span> BuyPrice <span class="token keyword">limit</span> <span class="token keyword">endif</span> <span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token keyword">shortonmarket</span> <span class="token keyword">and</span> myventa<span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span> <span class="token keyword">then</span> SellPrice <span class="token operator">=</span> ema<span class="token operator">-</span>advance <span class="token keyword">sellshort</span> mylot <span class="token keyword">contract</span> <span class="token keyword">at</span> sellprice <span class="token keyword">limit</span> <span class="token keyword">endif</span> <span class="token keyword">set stop</span> <span class="token keyword">ploss</span> <span class="token number">30</span> <span class="token keyword">set target</span> <span class="token keyword">pprofit</span> <span class="token number">25</span> |
Best trading ever, Adolfo.
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
I have tested it and gives enormus performance but it has a big issue on the backtest… 70% of the trades are closed in the first bar. this mean that we have a clear Ts that has the PRT bouncing problem.
Have you tried to compare the real trades with the backtested? I’m quite sure that they will be totally different. Am I wrong?
Hi David, your are right, you can’t get that awesome performance, but I saw in real time how same candle touch limit order and give profit not once, even 3 times at the same bar, in 15 min, and then price goes against you. So if you look at the chart after this, you can think easily this one wasn’t a profit but is false, because inside bar gives profit 3 times (is my real example). Of course all cases are not the same… Just telling that I got a profit about +38% atm with it, since started in March.
P.S. ATM most indexes and pairs are rdy to trade, look at this capture: http://www.prorealcode.com/wp-content/uploads/2015/07/ALEX-ATB-ProScreener-Capture.png
Hi Adolfo,
I can’t find the 2nd indicator (ExpMA 18) in the code you posted, is it correct or not ?
Are you using the code with real money ? the performance in the backtest is really incredible ?
Thanks
Andrea
Hi burghy17, first question is answered below :), and yes to the second one, manually until now, automated since next week. 😉
Thanks for your comment, have a nice weekend!
Do you use EMA 18 in the code?
Indicators
ExponentialAverage[8](close)
ExponentialAverage[18](close)p.s thanks for all your works It\'s appreciated
Thanks for your comment Eric, it’s not in the code. But is there for one reason, and going to explain it.
In Lex Smirnoff system, he uses ema18 to calculate stoploss, something like this:
MinStop = 30
MaxStop = abs(ema8-ema18)StopLoss = max(MinStop,Maxstop)
If we wanna use a wider stoploss, we should include lines above and modify this line also:
mylot=(((Strategyprofit+3000)*0.02)/stoploss)
set stop ploss stoploss
Thanks for sharing Adolfo
Hi Adolfo,
Thank you very much for sharing your strategy, I’ve backtested it on the Dow on 15 Minute charts, assuming a 3 spread.
From 1st March to 3rd June it was able to take 196 trades, Winning 168 (85.71%), Losing 28 with a gain/loss ratio of 2.98 with the following settings.. (apologies for re-coding into a single file for ease of use)
defparam cumulateorders=false
defparam preloadbars=1000
defparam flatbefore=065500
defparam flatafter=211450
ema = Exponentialaverage[ts1](close)
once uma=Highest[ts1](high)
once umb=Lowest[ts1](low)
objetivo=40*pipsize
ts1=9
if High > ema and Low < ema then // Touching Ema8
tb = BarIndex
ltp = ema
uma = ema
umb = ema
endif
if low>ema then // New bullish movement
n = BarIndex - tb
uma=Highest[n](high)
umb=ema
endif
if high<ema then // New bearish movement
m = BarIndex - tb
umb=Lowest[m](low)
uma=ema
endif
if (uma-ltp)>objetivo and uma>ema then // buy condition
mycompra=1
endif
if (uma-ltp)<=objetivo then
mycompra=0
endif
if (ltp-umb)>objetivo and umb<ema then // short condition
myventa=-1
endif
if (ltp-umb)<=objetivo then
myventa=0
endif
advance=abs(round(ema-ema[1]))
mylot=(((Strategyprofit+3000)*0.02)/30)
if not longonmarket and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
set stop ploss 25
set target pprofit 13
Great job! Thx a lot for that. I’m trading this strategy on DJIA mornings with 2,8 Spread and since 15:30, 1.8 spread points and the result is good enough to continue with it. As far as I like your improvements I will set another one with your parameters.
Thanks again 😉
Beware !
On backtest I see an utopic equity curve, because stop loss and take profit are on some same candles. Prorealtime only takes the take profit…
Anyway, great strategy, thanks.
Hi Minmax,
Is your strategy works? I think mine having issue when running on demo
Adolfo maybe when PRT will solve the councing issue we will know better how this Ts perform. Let’s wait and see… I keep following you
Hi David, I’ve done some tests on this strategy removing/adjusting the stop levels, the results suggest that it’s the target being hit the majority of the time.
(I’m assuming you are referring to the issue of target/stop being in a single bar and not knowing which occurs first)
Regards
Steve
Hello adolfo. Thanks for your posting.
I just wonder one thing, with 1 contract instead of any money management system and your SL30 and your TP 25 I get really many positions that have closed in 0 bars. Are you sure that it really works?
Hey! Who knows if we will work like this in the future? Anybody know… I trade it because got sense for me. I’m testing it right now with 10 pips stoploss and fixed profit of 100€. Results are awesome after a few months.
Will share any update, thanks a lot everyone!!!!!!
i changed the money management to the code that’s posted in the blog. Turns out I’m gonna be a billionaire in 10 years.
Jokes, gonna put it on demo account and probably make some mods.
Hello Adolfo and thanks for sharing your strategy. Minmax’s code seems very interesting too, and give very good results in the backtest.
Perhaps on a demo account their behavior is not as good as in the backtest, but the strategy is good and the codes too.
Thanks a lot.
hi Adolfo ,
results looking amazing in backtest but i have been trying to get it to work on a small live account i use to test these out but when ever i change the line
\"mylot=(((Strategyprofit+3000)*0.02)/30)\" to - \"mylot=(((Strategyprofit+400)*0.02)/30)\" forgive my ignorance but when ever i do this to try it backtest no trades are placed is there another line alsothat i must change in order for this to work ?
Hi Tradingsales, you changed 3000 to 400, this is the whole amount of capital to calculate contracts.
400*0.02/30=0,0…. So mylot = 0
Not even 1 contract to enter market, increade capital or risk in order to at least get 1 contract to join.
Best regards!
As you make it work live now, how does it work for you ? Are you far from the results you have in backtest ?
Muy buenas Adolfo, muchas gracias por compartir, quería hacerte una pregunta ¿Has probado el sistema en real? ¿hay mucha diferencia con el Backtest? como bien sabrás el Proorder de cada vela sólo te tiene en cuenta la apertura y el cierre y al ser velas de 1 hora, puede que te salte el stop y no quede reflejado en el Backtest. Lo he actvicado en una cuenta demo a ver que tal.
Un saludo.
Hola Nacho, llevo operando éste sistema en real desde Marzo de éste año y el balance actual es positivo. Lo empecé operando con un objetivo de 50 pips hasta que conocí ProOrder, hice un backtest y vi que podría haber quebrado la cuenta a largo plazo y desde entonces he seguido con el objetivo mencionad aquí de 25 pips.
Un saludo y suerte!
Muchas gracias por la respuesta Adolfo, pero mi pregunta es ¿El sistema a través de pro order te hace las mismas operaciones desde que lo tienes activado que las que te salen si haces un Backtest? es que el Backtest es espectacular. Muchas gracias.
Hola Nacho, no, el porcentaje de acierto es menor en real, ojalá fuera igual!! Me refería a que está siendo rentable desde entonces y espero que siga así.
Salu2
Buenos días Adolofo ¿Me podrías decir desde que lo tienes activado en marzo cuál ha sido el mayor Drowdown que has sufrido? y a cuanto el punto, supongo que lo habrás tenido mínimoa 5 € el pto no? Me estoy planteando activarlo y me gustaría saber el capital necesario.
Muchas gracias.
Hola Nacho, el peor drawdown lo pasé al principio, entonces buscaba 50 pips por operación y perdí más de la cuenta, de hecho estuvo casi todo el mes de Marzo en negativo hasta que llegó a final de mes, primeros de Abril, y encajo una serie de profits consecutivos y desde entonces se mantiene en positivo.
Soy partidario de arriesgar lo mínimo posible en torno al 0.5 ó 1 % del total del capital para la estrategia. Tendiendo en cuenta que el stop está a 30 pips, lo óptimo podría ser un capital entre 3.000 y 6.000 €, yo la puse en marcha con 3000 €.
Saludos!
Hi Sofitech, result for this week are:
DAX = 3 positions with (-30-5+25) -10 pointsDJIA = 1 position +25 points
Binomio autotrading bot is working a bit better this week, with a result of +59,3 points on DAX.
I’ll be updating!
Also started another system like this (on demo) with 10 points stop and 100€ $profit, this one is incrementing size contracts in order to join with 100 contracts and just look for 1 pip. Results for this one are 2 trades, 100% winners. We’ll see.
Best regards!
Been running it on demo for 48 hours and 680€ up with 5€ contracts.
Congrats!!
Today was a great day for this strategy.
All Profits in GBP/JPY, GBP/USD, EUR/USD, DAX and FTSE, more than one of them gave 3 profits!!
Best wishes!!
Hi Adolfo,
It has an open position on the Dow currently.My question is how do i put €2 a point instead of contracts?
Thanks
Hi, do you mean each pip it’s 2€?
Hi,
Yes each pip means €2.thanks
Then we should add the “PointSize” value in order to get the right contracts:
mylot=(((Strategyprofit+3000)*0.02)/(30*PointSize))
This will divide the whole amount of capital to risk with the number of pips multiplied by the cost of each pip.
Hope it helps you!
Very Nice Strategy, Yesterday Dow Demo 2 position opened and closed with profit. The only difficult thing is to verify Demo vs Probacktest because it seems ProOrder and ProBacktest time entry and exit are different due to price order strategy. My demo executes 2 extra, where Probacktest only 1 trade, it’s probably due to spread.
Overall, it works on Dow 15 mins!
Hi, or maybe in backtest first trade was in a profit in the same candle?
Sometimes happens in backtest, as you know…
cheers!
Hola Adolfo! Efectivamente tu sistema parecía casi perfecto en el Probacktest, pero lo he probado en tiempo real en Proorder en el Dax en 15 minutos y tiene un fallo que hace que no me coincida la salida de las posiciones. Como se dice en comentarios anteriores, en el probacktest cierra la posición con ganancias si durante la misma vela entrada ha tocado el objetivo antes de la entrada aunque esto no ha sucedido en realidad posteriormente. Por ejemplo, esta da entrada al alza o larga por toque de la EMA 8 a las 10 horas 29 minutos en 9723 e inmediatamente se pone a bajar hasta que salta el stop en realidad da perdidas pero en el probacktest si desde la 10 15 hasta las 10 29 en algun momento el precio estuvo a 9736.5 la posición habrá dado beneficios para la prueba. ¿la preguntas es si hay alguna forma de que Prorealtime tenga en cuenta solo lo que pase a partir del momento de la compra no el tiempo pasado? Si se pudiera solucionar sería magnifico
Hola Francisco, sí efectivamente ese trade no ha dado 25 pips en tiempo real con ésta estrategia, de hecho los resultados del backtest son un poco confusos por eso, de todas formas nunca resultados positivos en el pasado garantizan los mismos en el futuro, ni lo contrario.
Gracias por comentario, seguimos en ella, saludos!
Hello, I don’t understand why this system doesn’t work in real as in backtest. Can someone can tell me?
Yes Bidolia, me neither… we should be billionaries with this backtest results. Real % expected is about 70-80%. I’m in a nicely 61% of profit trades ATM.
Best trading ever!
although a long backtest of 100 000 units shows a average position length of 1 bar, this ytd its almost 3 bar as average which is good imo. I like this strategy and I’m gonna keep it running on the demo account this week too then put it in €1 contracts next week if results ar OK.
Thanks!
Great Hockeytrader! I’m not expecting same resulta as backtest shows of course.. But good enough to keep on it.
Testing it also with good results on GBP/JPY and bad results on EUR/USD.
Looking for a good objective in FTSE and PXI, 45 should be adjusted for thise indexes with less pips movements.
Best wishes for everyone!
Hi,
Getting an error from ProRealTime.Running on Dax 15 Min.thanks
This trading system was stopped because the historical data loaded was insufficient to calculate at least one indicator during the evaluation of the last candlestick. Please increase the number of preloaded bars with the instruction DEFPARAM in the code of your strategy (ex: DEFPARAM Preloadbars = 2000). For additional assistance, please refer to the help text of the DEFPARAM function in the trading systems programming manual.
Hi thegeneral, be sure you got this parameter.
Defparam preloadbars = 8
Hi
I keep getting the same, systems stops randomly and i need to restart, can we put more bars in your code or does 8 have some special function ?
thx
Hi,
Yes this is the full code
defparam cumulateorders=false
defparam preloadbars=8
defparam flatbefore=090000
defparam flatafter=213000
mycompra, myventa = CALL \"ALEX ATB Indicator\"
ema=ExponentialAverage[8](close)
advance=abs(round(ema-ema[1]))
mylot=(((Strategyprofit+3000)*0.02)/30)
if not longonmarket and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
set stop ploss 30
set target pprofit 25
//-------------------------------------------------------------------------
// Main code : Dax A-Lex 15 Mins
//-------------------------------------------------------------------------
defparam cumulateorders=false
defparam preloadbars=8
defparam flatbefore=090000
defparam flatafter=213000
mycompra, myventa = CALL \"ALEX ATB Indicator\"
ema=ExponentialAverage[8](close)
advance=abs(round(ema-ema[1]))
mylot=(((Strategyprofit+3000)*0.02)/30)
if not longonmarket and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
set stop ploss 30
set target pprofit 25
//-------------------------------------------------------------------------
// Function : ALEX ATB Indicator
//-------------------------------------------------------------------------
REM Señal de compra o venta SETJU
REM Variables
mm = Exponentialaverage[8](close)
once uma=Highest[8](high)
once umb=Lowest[8](low)
REM NOTES
// TB = touched bar
//if barindex<2 then
//ltp = mm
//endif
// OBJETIVO
objetivo=45*pipsize
REM Establecimiento del último toque con la media móvil
if High > mm and Low < mm then
tb = BarIndex
ltp = mm
uma = mm
umb = mm
endif
REM Establecemos nuevo maximo en movimiento alcista
if low>mm then
n = BarIndex - tb
uma=Highest[n](high)
umb=mm
endif
REM Establecemos nuevo minmo en movimiento bajista
if high<mm then
m = BarIndex - tb
umb=Lowest[m](low)
uma=mm
endif
REM Condición de entrada Largo
if (uma-ltp)>objetivo and uma>mm then
compra=1
endif
if (uma-ltp)<=objetivo then
compra=0
endif
REM Condición de entrada corto
//corto = ltp-umb
if (ltp-umb)>objetivo and umb<mm then
venta=-1
endif
if (ltp-umb)<=objetivo then
venta=0
endif
REM Mostrar Resultado
Return compra coloured(0,128,0) as \"compra\", venta coloured(220,20,60) as \"venta\"
I got same issue a few days ago, don’t know what the problem was and hope that someone could help us a bit more at this point.
This is what I think, Sometimes 07:55, 07:56 or 07:57… Got no body (same open, close, high and low) and maybe at 08:00 there are no 8 full bars?
Cheers!
Hi, there is some method to force the close at least 1 bar after entry?
Hi Alex, you can avoid “PPROFIT” and use something after “LONGONMARKET”, this condition will wait until first bar closes, but if profit is reached in the same candle you won’t get it. I tryed something like this before and didn’t like it.
Best regards!
Really interesting Adolfo! Can you please explain what “30” is, in the lot size / risk management line:
mylot = min(1000, (((Strategyprofit + 3000) * 0.02) / 30))
Hi Johan,
I didn’t use this time any variable to calculate stoploss, are a fixed 30 pips, so this number is equal to stoploss pips distance.
Cheers!
Ah ok of cause 🙂
Have you thinked about how this can be applied on timeframes like 15, 5, 1 min? The update which aims for $100 with 1 pip sounds really interesting. Any news on that one?
Thanks again!
Yes! will be interesting to get the best parameters for those timeframes, didn’t do yet.
I started this week a few systems on different pairs and indexes with those parameters and doesn’t look as interesting as expected from now, we’ll see.
Cheers!
Hey, Thanks for sharing.
This strategy doesn’ execute any order in my backtest (i have installed the indicator and the strategy).
What should I do with :
ExponentialAverage[8](close)
ExponentialAverage[18](close)
Is it working only on 10.2 ?
Is it working with the demo (i have the demo)
Thanks
Make sure you have:
defparam preloadbars = 8
Hi Pierreee, should work in intraday timeframes correctly in 10.2 version.
Nothing extra to do with Exponentialaverage.
Best regards!
Hey Adolfo,
I’m currently running the system on my IG Demo account with 1 lot, 30 ploss and 25 pprofit. This morning the first trade kicked in. A long trade at 09:04:28, which the system got out of at 09:31:33 with a 64,10€ win. how is that possible with a 25 pprofit?
Thanks!
It depends on “mylot” calculation, which compute your exposure for each trade.
My Systems drops out constantly and whines about Defparam preloadbars=8
I have four systems with diffrent tp/sl settings and all drops out now and then
Hello,
After I done a week of Demo Live and P.Backtest. It doesn’t work as live case.
In P.Backtest, the entry price is correct but entry time is incorrect(1). The exit price (2) and exit time (3) are both incorrect.
From my observation, I “suspect”:
(1) The entry time is determined based on the moment coding execution of “Buy” which normally starting of the candle (i.e 9.am). It’s not accordance to Live (i.e 9.15am)
(2) If target limit & stop loss both should be reached in 9am – 930am candle. This will be treated as winning trade as limit will be hit earlier due to limit amount is smaller than stop loss and system assume your position is opened at 9am. (Not 9.15am). Losing trade is low %, this only happen when we buy at very high price / U turn.
(3) Not so important.
Above explains why the equity curve shows beautiful result when target limit is smaller number than stop loss. By the way, it’s just why assumption. Hope P.Backtest can improve this. Otherwise, it’s difficult to examine the “real” result.
(1) BUY and SELL orders are pending LIMIT order which can trigger at any time after they were put on market. So this is possible that trade can be executed on market at 9.15am if the price didn’t reach their trigger price before this time. But I understand that you are talking about probacktest behaviour. This is something that will be improved in a future release.
(3) this is what Adolfo say about this in his description : “Fixed Stop ploss and target pprofit give us unreal vision of the strategy in the backtest. However I’ll keep trading it since is profitable for me since March, not as good as backtest results shows, of course… but very interesting… 😉 “
Hi Adolfo, great job!
I tested your trading system for two weeks at the market (demo account) and I found these differences with the backtesting: 1) the backtesting performances are amazing because of well-known PRT platform miscalculation that merely consider just the OHLC values without considering the time factor (I hope PRT thinks up a way of solving this problem as soon as possible, because this defect makes the platform less competitive than the others): this error implies that the pending order carried out to the market by the TS is almost always different from the order executed in the back-testing, where the entrance to the market is almost always on the same candle of the entrance signal. That’s why there is a performance difference between backtest and “market”, because often in the market the order is not immediately executed, and when done, the rebound phase from the retracement is completed bringing the TS to close in loss position. This is a PRT defect in the backtest I hope they solve immediately, otherwise it will make no sense to perform backtesting because too far away from reality.
2) Another problem I found is a delay of the trading system to follow the indicator. It happens like this: suppose a condition long on Dax TF 15M; at the opening of the new candle Alex ATB indicator changes from 0 to 1, then mycompra = 1 and according to the buy conditions the TS must place an order at buyprice limit. However this does not happen in real, since at the opening of the new candle Alex ATB indicator changes from 0 to 1 and the system waits for the development of another candle before place the order (another difference with backtest that, instead, open the position on the same candle where Alex ATB indicator goes to 1). How can I solve this problem? I downloaded the TS and I applied it to the graph without changing any parameter. I find this TS a good idea, and I hope that my tests can help to improve it.
Hello everyone, and thanks Aldolfo.
What do you think of this code, to avoid the stop loss / take profit problem???
if not longonmarket and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if longonmarket and low < (buyprice-25) or high >(buyprice+13) then
sell at market
endif
if not shortonmarket and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
if shortonmarket and high > (sellprice+25) or low <(sellprice-13) then
exitshort at market
endif
Excuse me, i have lost some parenthesis….
if not longonmarket and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if longonmarket and (low < (buyprice-25) or high >(buyprice+13)) then
sell at market
endif
if not shortonmarket and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
if shortonmarket and (high > (sellprice+25) or low <(sellprice-13)) then
exitshort at market
endif
Hi Bandido
How does your proposed code work for you … better or worse than original?
Thanks
GraHal
@adolfo
hi Adolfo , Thanks for sharing your strategy, it’s really well done…
a question for you
I would to try to launch your strategy in real , but can you explane me what I must do to buy only 1 contract?
thanks again and I hope in your reply, Bye
mylot=1
Ciao LuigiR fai come dice Alex e modifica la riga 9 del codice scrivendo mylot=1 ; la riga 9, così come è scritta originariamente nel codice, impiega il 2% del capitale aumentando o diminuendo il numero dei contratti in base allo strategy profit, modificandola come dice Alex invece, aprirà ogni volta una posizione con un singolo contratto indipendentemente da quanto è in guadagno od in perdita la strategia.
grazie a tutti e due ‼️
How are your tests? on which indices will show that the strategy is profitable than DAX and GBP / USD?For me demo test three weeks on DAX 54% profitable, GBP/USD 60%.
Thanks
Been going live with Dax €5 contracts since 14th of June. Result isn’t bad but not extreme. 312€ in profit with 53,57% in wins and 1,04 in Gain/loss ratio.
hi Alex, I try in real with some pair of forex, best result are in GBP/USD with 80% of winning trade for the last week, this week down to 60%
Che timeframe?
Hi,Can we adapt this strategy to the equity markets?She can operate daily on the stock markets?If so, does it work as well as for currencies and indices markets?Thanks
The Strateg will don´t work complete in the IG ProRealTime Demo Account. ProBacktest work perfekt in Backtest & Backtest Livemode, but it will be not execute any Orders in the Demo enviroment – any ideas why? (now i have disable the mylot calculation, let’s see what happens)
regards
Hi Adolfo, I added an oscillator in your code and it seems work better in every market…I’ve changed also TP and SL.
Ehi forum, what do you think?
if not longonmarket and Momentum[10](close)>0 and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and Momentum[10](close)<0 and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
oh I forgot…
set stop ploss 45
set target pprofit 25
Beh i risultati in backtest a due anni sono … Incredibili.
Complimenti.
…se vuoi incrementare il win/lost ratio aggiungi una condizione anche sul’ RSI…
Hai già trovato una condizione ottimale da inserire su Rai ?
scusa. Volevo scrivere. RSI .
ecco qua
if not longonmarket and Momentum[10](close)>0 and RSI[10](close)>65 and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and Momentum[10](close)<0 and RSI[10](close)<35 and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
set stop ploss 30
set target pprofit 15
e a questo punto puoi aumentare il rischio del money management
mylot=(((Strategyprofit+3000)*0.03)/30)
Hi all, I would like to start with this strategy. Which timeframe should I use for DAX?
In base alla vs. Esperienza è più corretto avere un ratio alto , una % più alta di tarde vincenti o un guadagno maggiore.
Di co questo perché variando i valori di stop loss e profit si ha n ratio decisamente più basso ma guadagni decisamente più alti. ( in backtest )
Comunque in backtest ingressi ed uscite sono fatti nello stesso momento (orario)
cambia da quelli fatti in reale pertanto la performance è poco credibile.
In effetti sembrava troppo facile. 🙂
Pay attention. The original strategy have some BIG problems.
The biggest one is backtest, the results is not REAL cause probacktest open and close positions in the same candle, then you cant know if stopprofit was taken before stoploss and viceversa. DO NOT LOOK BACKTEST ON THIS STRATEGY!!!!! I’m on demo from start and the reults is not so good… DAX is not profitable, have a 50% winrate then with a take profit of 25 and a stop of 30 you will loose money. All the other index or forex pairs that i tested is not good (jpy/usd, greece, italy, wall street, dax, ftse, cac, eur/usd, spain) this original strategy work, for me, only on GBP/USD with a good 65-70% profitable positions.
From 3 weeks I’m testing a modified version, if will be profitable more than original version I will share.
Any one, have some results to share with the others on demo-real test?
@miguel: questa è una comunity internazionale, secondo la mia opinione, potresti utilizzare google translator per scrivere in inglese i tuoi pensieri senza obbligare altri a farlo al posto tuo.
Perfect was what I thought. We try to find a real solution. thank you .
Miguel
Hi Alex,
I’m agree with you. My approach to the backtest is like a chemical reaction, where you have a lot of varible that could change the results you have dreamed. In fact it is important to monitor how real differ from backtests, in order to add a own “deviation standard” of future projections. For me it’s important to share ideas for improving the efficency and the return of the code.
Now I’m testing various modified code on real tests on 3 mini forex, FTSE, Wall and germany30… Let me 1 month of comparison for sharing
Although I tried many times to me the system fails in this type of error.“The trading system was shut down because the program has used a negative offset or equal to 0 (ex: close [-10]) during the evaluation of the last candela. La Please add more protection to its pre code prevent negative offset or equal to 0 “.I tried to figure out where he might be the error but did not succeed.Can you help me, thanks.
Hi Aldik67,
check the variable ts1=9. Need to be before the usage like this:
ts1=9
ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)objetivo=39*pipsize
Mat
Hi Adolfo, Hi all user ProRealCode,
First thanks Adolfo for sharing your strategy, very good.
Do you know if is solved the problem of stop loss/take profit? Is real the strategy place the order but without stoploss and takeprofit.
Thanks
Regards
Mat
Hello guys someone can rewrite strategy for 1 minute’s candles to test IT in 1 minute time frame?
Hi all, do we have a solution for the problem with the error (defparam preloadbars=8) proorder gives while running the system live?
hi
is the file updated with the new paraments
What does this error msg means.
This trading system was stopped because the program used a negative or zero offset (ex: close[-10]) during the evaluation of the last candlestick. Please add protections to your code to prevent negative or zero offsets.
My auto trading system close itself off because of this
Hallo
Schöner Code..Ich habe das gleiche Problem wie mein Vorredner Beim Backtest ist alles in Ordnung aber beim Demo kommt die Fehlermeldung:
This trading system was stopped because the program used a negative or zero offset (ex: close[-10]) during the evaluation of the last candlestick. Please add protections to your code to prevent negative or zero offsets.
Mein Code:
defparam cumulateorders=falsedefparam preloadbars=8defparam flatbefore=065500defparam flatafter=211450
ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)objetivo=39*pipsizets1=11
if High > ema and Low < ema then // Touching Ema8tb = BarIndexltp = emauma = emaumb = emaendif
if low>ema then // New bullish movementn = BarIndex – tbuma=Highest[n](high)umb=emaendif
if high<ema then // New bearish movementm = BarIndex – tbumb=Lowest[m](low)uma=emaendif
if (uma-ltp)>objetivo and uma>ema then // buy conditionmycompra=1endifif (uma-ltp)<=objetivo thenmycompra=0endif
if (ltp-umb)>objetivo and umb<ema then // short conditionmyventa=-1endifif (ltp-umb)<=objetivo thenmyventa=0endif
advance=abs(round(ema-ema[1]))mylot=(((Strategyprofit+3000)*0.02)/30)
if not longonmarket and mycompra=1 thenBuyPrice = ema+advancebuy mylot contract at BuyPrice limitendif
if not shortonmarket and myventa=-1 thenSellPrice = ema-advancesellshort mylot contract at sellprice limitendif
set stop ploss 35set target pprofit 19
Danke für die Hilfe..
Hi Adolfo,
Any luck with the modified version of this strategy?
The 50% winrate, was that since March on a live IG account?
“GBP/USD with a good 65-70% profitable positions.” was that also from March on a live account?
I´ve been running it with DJI 2 mini with different time intervals quite successfully, that is, until yesterday when the systems showed a loss of 320 euros.
It would be interesting to see a back test on this strategy on a different platform without the PRT error. Has anyone seen some results from Lex strategy backtested in for eg, MT4?
Best Regards
Tim
Hello Each
Has anybody got the ‘Tick by Tick Backtest’ and could kindly run this Strategy with workable numbers for Target and Stop Loss and then let us know the figures and / or any observations please?
Many Thanks
GraHal
Good morning,
I have tried the code in real with pro realtime (broker : IG market). used timeframe is 1 hour. The issue is that when the hour changes (for instance 4 Am, 5 AM,….), the system stops with the following message : “your system used a negative offset or 0 (ex : close [-10]. please modify your code and use positive strictly offset”. Does anybody have an idea to fix this problem? Thanks.
Hi Finplus
I may be wrong, but as far as I can see the only solution offered on this thread for the ‘strategy closure due to negative offset’ is this from Mat_CH (http://www.prorealcode.com/prorealtime-trading-strategies/alex-autotradingbot-index/#comment-1487)
ts1=9
ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)objetivo=39*pipsize
whereas in the ‘single file from minmax’ it is as below …
ema = Exponentialaverage[ts1](close)
once uma=Highest[ts1](high)
once umb=Lowest[ts1](low)
objetivo=40*pipsize
ts1=9
I cannot find anybody saying it works or it doesn’t work and I’ve not tried it (yet), sorry?
This ‘Alex ATB Strategy’ is frustrating because it shows a Utopian Equity Curve but the reality is so far from Backtest results!? Okay we know this is the ‘0 bars Issue’.
Is it worth us spending any time on this Strategy or is it ‘dead in the water’??
Thanks
GraHal
GraHal,
thanks for your prompt answer. OK. I have replaced 40 by 39. I have launched Alex ATB Stratégy with my real account on euro dollar (one hour time frame). I will give more information about that later.
Hi, at 2 PM, the system has stopped the bot with the following message : negative offset or O…
GraHal, it works fine. Thanks. I am going to check in my real account.
objetivo=39*pipsize replace thats it ? nothing more ?
ts1=9
ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)objetivo=39*pipsize
Like this, it is ok.
great thanks ,
but the same errormessage occours for the system mgc-trend-chaser-160914.itf , could you have a lookon it .
I do not use trend chaser.
Hi there,
thanks for the strategy and the nice ideas. I have a question about the commands NEXTBAROPEN and TOMORROWOPEN (depending on timeframe). Why are these not helpful to reduce the inside-bar problem?
If you are in a 15 Min timeframe and you add the NEXTBAROPEN command behind your close order, wouldn’t PRT close the position on the opening of the next candle/bar?
Rgds,
DonDollar
Has anyone been running this strategy in live mode? What are the results?
Mark
Je ne comprends pas. Le backtest est très mauvais avec l’option tick by tick
Quelqu’un peut m’expliquer ?
Oui, j’ai testé en réel. Je suis à 18% de performance depuis 3 mois.
Merci
Sûrement que la comparaison contrat CFD et contrat Futures est difficile à faire 🙂 , compare les instruments, ce ne sont pas les mêmes !
En fait, la comparaison est faite toute choses égales par ailleurs. C’est-à-dire que en restant sur le même produit CFD ou contrat Futur, je fais tourner le backtest sans le tic by tic puis avec le tic by tic. Les résultats avec le tic by tic est si mauvais, qu’il en est inquiétant. Heureusement, en réel, je suis tout de même gagnant.
Il n’y a pas de CFDs disponible chez prorealtime.com
J’ai testé la semaine dernière sur la paire AUD/USD durant une journée en réel sur IG. Résultat : aucune position prise durant la journée. or, le soir, j’ai fait tourné en back test et là j’avais une position prise à 11h avec un gain à la clé.
Moi, ce type de situation m’arrive très souvent, mais en pire, c’est-à-dire que je suis en perte dans le trading réel, et en gain dans le backtest. Je peux faire un retour d’expérience sur le réalisé manqué si cela intéresse quelqu’un.
Pour répondre à Nicolas, d’il y a 2 jours, j’ai dû testé sur le contrat Futur, avec et sans le mode tic by tic.
Pourtant, en back test, les résultats sont excellents. Donc, je pense que le code a un potentiel mais nécessite toutefois quelques réglages. Mais je n’ai pas le temps de m’y coller. Peut-être son créateur…
Hi
can anyone please help me to correct this code as
after getting very good results on back testing i tried with real money but my system was stopped and got error.
This system was stopped because the program used a negative or zero (ex:close[-10]) during the evalution of the last candlestick. please add protections to your code to prevent negative or zero offsets.
what changes i should made.
Hi Joshali,
set your parameters as indicated below :
ts1=9
ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)objetivo=39*pipsize
Like this, it is ok.
thanks for your reply Finplus.
i was back testing this code below on 3 hour chart and results are very good.
i checked the correction that you have sent but it looks same.
please advice any error on this.
defparam cumulateorders=falsedefparam preloadbars=1000defparam flatbefore=065500defparam flatafter=211450
ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)objetivo=40*pipsizets1=9
if High > ema and Low < ema then // Touching Ema8tb = BarIndexltp = emauma = emaumb = emaendif
if low>ema then // New bullish movementn = BarIndex – tbuma=Highest[n](high)umb=emaendif
if high<ema then // New bearish movementm = BarIndex – tbumb=Lowest[m](low)uma=emaendif
if (uma-ltp)>objetivo and uma>ema then // buy conditionmycompra=1endifif (uma-ltp)<=objetivo thenmycompra=0endif
if (ltp-umb)>objetivo and umb<ema then // short conditionmyventa=-1endifif (ltp-umb)<=objetivo thenmyventa=0endif
advance=abs(round(ema-ema[1]))mylot=(((Strategyprofit+3000)*0.02)/30)
if not longonmarket and mycompra=1 thenBuyPrice = ema+advancebuy mylot contract at BuyPrice limitendif
if not shortonmarket and myventa=-1 thenSellPrice = ema-advancesellshort mylot contract at sellprice limitendif
set stop ploss 25set target pprofit 13
Am I the only one who is getting the best backtest results with 30min tf?
@joshali,
I tested the system with the 10.3 and the tick mode in the 3h timeframe for the DAX30 and the result was…I lost 2,45% and a win ratio of 0,8. I tested with the maximum of the 500 units you can use.
@Nicolas: could you please run the same test with the same settings to see if there is something wrong.
BTW: without tick-by-tick it would be marvelous !!!
Hey!
Would you be able to test in the 15m timeframe?
… and maybe this code adjusted for 5m in 5m timeframe?
defparam cumulateorders=false
defparam preloadbars=8
defparam flatbefore=090000
defparam flatafter=213000
mycompra, myventa = CALL \"ALEX ATB Indicator\"
ema=ExponentialAverage[24](close)
advance=abs(round(ema-ema[3]))
mylot= 1
//(((Strategyprofit+3000)*0.02)/30)
if not longonmarket and Momentum[10](close)>0 and mycompra=1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and Momentum[10](close)<0 and myventa=-1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
set stop ploss 40
set target pprofit 25
hi, thanks Adolfo for this code.. is there anyone who has been trading this live? I started this week after few adjustment .. will let you guys know how it goes..
Hi wanjpt,
I did a lot of backtests with different tf’s but when you look at the “0” bars it is not reliable enough. Did you make some adjustements to avoid 0 bars?
Hi Alco,
Sorry for late reply, I had error message and tried the objectivo on 45, 39 and 40 but still having the error..wonder if there is anyone who has found a way to resolve this.
Hi Finplus is your live account working out ok?
Hi Wanjpt, I tried once only on AUD / USD in november 2016 during one day. No position has been taken on my live account (IG). The issue is that when I came back home, I have backtested the strategy and one position has been taken. I do not understand this difference.
The backtest of the code works perfectly with 1 hour timeframe.
Anyone got a correct code for the setup?Used Minihax code with mixed results… Anyone that can vouch for a setup that works live fairly good?
/CN
Bonjour,
Quelqu’un a-t-il réussi a avoir de bons résultats avec cette stratégie en backtestant en tick par tick ?
Si oui, sur quelle unité de temps avec quel support (Dax, Cac, Forex, …) ?
Merci
Bonjour, j’ai retesté hier sur la paire AUD/USD timeframe 1 heure sur mon compte réel chez IG: aucune position n’a été prise. Pourtant, ce matin, en effectuant un back test, le résultat indique qu’une position longue a été initiée à 17h puis clôturée sur la même heure avec un gain de 26 pips. Même constat qu’un de mes posts précédents. je ne sais pas à quoi cela est dû. Dommage car en back test, les résultats sont excellents. Si j’ai un peu de temps, je vais essayer de décortiquer la stratégie “pas à pas”. Bonne journée.
Bonsoir, j’ai de nouveau aujourd’hui lancé la stratégie en réel sur mon compte IG sur la paire AUD USD time frame 1 heure. Aucune position de prise. Pourtant je viens de backtester la stratégie et là deux opérations ont été effectuées (un long et un court). Je ne comprends pas ce qui se passe.
0 improvments, I tried a lot of modified version but no one was working. I think that only with a martingala this system can be good with a lot of risk.
this strategy works only in a well defined trend
Good afternoon I am trying to get the complete code of lex strategy made by adolfo since I see here does not work for me. I thank you in advance.
Buenas tardes estoy intentando conseguir el codigo completo de la estrategia de lex realizada por adolfo ya que veo por aqui no me funciona. Os doy las gracias de antemano.
hi Adolfo,
is Alex Auto Trading Botindex working on DAX as well ?
if so , can you post the full code? thx for the support !