
この戦略は,双 EMAとRSIの組み合わせ戦略と呼ばれる.これは,双 EMA指標とRSI指標の優位性を融合させ,より完全な取引意思決定の基礎を形成する.この戦略は,価格の傾向とトレンドの断絶の信号を判断するために双 EMAを使用し,同時には,RSI指標で超買い超売り状況を判断し,低買い高売りを実現し,差値を取得する.
この戦略は,まず,価格の全体的な傾向を判断するために,双EMA指標を使用し,EMA指標は価格の傾向性を比較的によく反映し,双EMA指標を組み合わせれば,価格の上昇と下降の傾向を判断できます.戦略では,速線EMA周期を34で設定し,短期的な傾向と入場を判断します. 遅線EMA周期を長時間設定し,長期的な傾向を判断します. 価格が急線EMAで購入する時,遅線EMAで販売する時.
同時に,戦略は,RSI指標を導入し,超買超売り状況を判断する. RSIは,価格の急激な変化によって,市場が超買または超売り状態に入っているかどうかを判断する. RSIの低い値の買い,高い値の売り,EMA指標と相互検証することで,偽信号を減らすことができ,利益の確率を高める.
この戦略は,双EMAとRSIの2つの指標の設計取引ルールを総合的に適用し,異なる指標に基づいて短期的および長期的傾向を判断し,超買い超売り判断に補足し,簡単に高効率に低買い高売りを実現する.単一の指標と比較して,この戦略は,信頼性が高く,適応性が強くなっています.しかし,指標の失敗のリスクを予防し,適切なタイミングで止損とポジション管理を注意する必要があります.全体的に,この戦略は,実行が容易であり,推奨されています.
/*backtest
start: 2022-11-22 00:00:00
end: 2023-11-22 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
//chia se cho rieng cong dong t.me/beincypto_vn
strategy('Sonic R & RSI only BTCUSD D1 strategy', //ten chien luoc
shorttitle='sonic R & RSI Strategy', //ten rut gon cua chien luoc
overlay=true,//
close_entries_rule="FIFO", //thu tu dong lenh la bat ky
default_qty_type=strategy.percent_of_equity, //loai so luong mac dinh la ti le phan tram cua von
max_bars_back=500, // so luong thanh toi da la 500
default_qty_value=100, //so luong vao lenh la 100 %
calc_on_order_fills=false, //
pyramiding=1, // kim tu thap, 1 thi moi la thuc
commission_type=strategy.commission.percent, // loai phan tram phi giao dich
commission_value=0.2, //ti le phan tram phi giao dich
process_orders_on_close=true, // tinh toan chien luoc khi dong lenh
calc_on_every_tick=false) // sau khi dong nen moi vao lenh
ema34high = ta.ema(high, 34) // lay ema cao nhat cua 34 thanh nen
h=plot(ema34high, color=color.new(#A5D6A7, 0)) // hien thi ema cao nhat cua 34 thanh
ema34low = ta.ema(low, 34) // lay ema thap nhat cua 34 thanh nen
l=plot(ema34low, color=color.new(#EF9A9A, 0)) // hien thi ema thap nhat cua 34 thanh
fill(h, l, color = color.green, transp=90) // hien thi may giua ema cao va thap
rsi = ta.rsi(close, 14) // rsi 14 thanh
dkienmua1 = close > ema34high and close[2] > ema34high // dieu kien mua 1 khi gia lon hon ema 34 cao nhat va nen truoc do (nen 2) cung lon hon nen ema 34 cao nhat
if dkienmua1 // neu thoa man dieu kien mua 1
strategy.entry('buyEMA', strategy.long) // vao lenh mua trong bieu do hien chu buyEMA
dkienban1 = close < ema34low and close[2] < ema34low // dieu kien ban 1 khi gia nho hon ema34 nho nhat va nen truoc do cung vay
if dkienban1 // nen dieu kien 1 thoa man
strategy.close('buyEMA',comment='CloseEMA') // dong lenh buyema truoc do, hien thi o bieu do la chu closeEMA
dkienmua2 = ta.lowest(rsi, 3) < 29 and rsi > rsi[3] and rsi > 30 // dieu kien mua 2 khi gia thap nhat cua rsi 3 thanh gan day nho hon 29 va rsi lon hon rsi cay thu 3 truoc do
if dkienmua2 // neu dieu kien mua 2 thoa man
strategy.entry('buyRSI', strategy.long) // vao lenh mua dat ten la buyRSI
dkienban2 = ta.highest(rsi, 5) > 70 and rsi < 70 // dieu kien ban 2 khi RSI cao nhat trong 5 cay lon hon 70 va RSI nho hon 70
if dkienban2 // neu dieu kien 2 thoa man
strategy.close('buyRSI',comment='CloseRSI') // dong lenh buySI truoc do, tren bieu do hien thi chu closeRSI