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!
.ITF file: ALEX ATB Indicator Signal (Click and get it)
Indicator code:
REM Variables
mm = Exponentialaverage[8](close)
once uma=Highest[8](high)
once umb=Lowest[8](low)
objetivo=45*pipsize
if High > mm and Low < mm then // TOuching Ema8
tb = BarIndex
ltp = mm
uma = mm
umb = mm
endif
if low>mm then // New bullsih movement
n = BarIndex - tb
uma=Highest[n](high)
umb=mm
endif
if high<mm then // New bearish movement
m = BarIndex - tb
umb=Lowest[m](low)
uma=mm
endif
if (uma-ltp)>objetivo and uma>mm then // buy condition
compra=1
endif
if (uma-ltp)<=objetivo then
compra=0
endif
if (ltp-umb)>objetivo and umb<mm then // short condition
venta=-1
endif
if (ltp-umb)<=objetivo then
venta=0
endif
Return compra coloured(0,128,0) as "compra", venta coloured(220,20,60) as "venta"
3000 € / $ and max risk of 2% per trade.
ExponentialAverage[8](close)
ExponentialAverage[18](close)
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… 😉
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
Best trading ever, Adolfo.
You must be logged in to post a comment.
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.
this strategy works only in a well defined trend
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.
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.
@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 !!!
... 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
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=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
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.
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.
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.
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
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.
hi Adolfo,
is Alex Auto Trading Botindex working on DAX as well ?
if so , can you post the full code? thx for the support !