AleksandrLombrozo

Engulfing below EMA 120

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

開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
//@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)