This indicator is developed for ALEX ATB Bot strategy posted in the library here.
Set values “compra” and “venta” to be shown as HISTOGRAM. That’s all.
It shows buy and sell signals.
*Full strategy explanations on strategy post
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"