AleksandrLombrozo

Engulfing below EMA 120

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

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
//@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)