AleksandrLombrozo

Engulfing below EMA 120

Buy bullish engulfing above EMA 24
Sell bullish engulfing below EMA 24
Mercurius A.M.

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
//@version=2
strategy("engulfing", pyramiding=20)
//модуль тела свечи
body=abs(open-close)
//цвет свечи: красная или зеленая
colour=open>close
//взвешенная сс
ema_1D=ema(close,5)
period_ema=input(defval=120,title="period_ema",type=integer, minval=1, maxval=500, step=5)
ema_1h=ema(close,period_ema)
ema_24=ema(close,24)
//верхняя тень
up_shadow=abs(high-close)
//бычья сила бычей свечи
from_down_power=abs(low-close)
//нижняя тень
down_shadow=abs(low-close)
//медвежья сила медвежей свечи
from_up_power=abs(high-close)
m=rsi(close,6)
rsi_slow=rsi(close,12)
rsi_fast=rsi(close,6)
x=((body[0]>body[1] or ((body[0]+body[1])>body[2])) and close[0]>open[1] and colour[0]==false and colour[1]==true and from_down_power[0]>up_shadow[0] and up_shadow[0]<body[0] and isdwm)
y=((body[0]>body[1] or ((body[0]+body[1])>body[2])) and close[0]<open[1] and colour[0]==true and colour[1]==false and from_up_power[0]>down_shadow[0] and down_shadow[0]<body[0] and isdwm)
w=((body[0]>body[1] or ((body[0]+body[1])>body[2])) and close[0]>open[1] and ema_1h[0]>ema_1h[1] and colour[0]==false and colour[1]==true and from_down_power[0]>up_shadow[0] and up_shadow[0]<body[0] and isintraday and rsi_slow<rsi_fast) 
e=((body[0]>body[1] or ((body[0]+body[1])>body[2])) and close[0]<open[1] and ema_1h[0]<ema_1h[1] and colour[0]==true and colour[1]==false and from_up_power[0]>down_shadow[0] and down_shadow[0]<body[0] and isintraday and rsi_slow>rsi_fast) 
r=close[0]>close[1] and  colour[0]==false and colour[1]==true and isdwm and open[0]<close[1]
t=close[0]<close[1] and  colour[0]==true and colour[1]==false and isdwm and open[0]>close[1]
period_=input(defval=1,title="period_",type=integer, minval=1, maxval=100, step=1)
buy_qty=(200/(((close[0]-lowest(low,period_))*100000)))*100000
stop_buy=lowest(low, period_)
profit_buy=((close[0]-lowest(low,period_))*2)*100000
strategy.entry("buy", strategy.long, qty=buy_qty, when=w)
strategy.exit("close", from_entry=strategy.position_entry_name, stop=stop_buy, profit=profit_buy, when=w)
sell_qty=(200/(((highest(high,period_)-close[0])*100000)))*100000
stop_sell=highest(high, period_)
profit_sell=((highest(high,period_)-close[0])*2)*100000
strategy.entry("sell", strategy.short, qty=sell_qty, when=e)
strategy.exit("close", from_entry=strategy.position_entry_name, stop=stop_sell, profit=profit_sell, when=e)
plot(strategy.equity)