
এই কৌশলটি একটি সংমিশ্রণ কৌশল যা EMA গড় রেখার পার্থক্য এবং MACD সূচকের উপর ভিত্তি করে বিটিসির জন্য সংক্ষিপ্ত ট্রেডিংয়ের জন্য ব্যবহৃত হয়। এটি EMA গড় রেখার এবং MACD এর সংকেতকে একত্রিত করে, নির্দিষ্ট অবস্থার অধীনে ক্রয় এবং বিক্রয় সংকেত তৈরি করে।
মার্জিন মান নেতিবাচক হলে এবং টার্নওভারের চেয়ে ছোট হলে এবং MACD খালি মাথার ক্রস হলে, একটি কেনার সংকেত উৎপন্ন হয়। মার্জিন মান ইতিবাচক হলে এবং টার্নওভারের চেয়ে বড় হলে এবং MACD মাল্টিহেড ক্রস হলে, একটি বিক্রয় সংকেত উৎপন্ন হয়।
ইএমএ গড় রেখা পার্থক্য এবং এমএসিডি সূচক ব্যবহার করে সংকেত সংমিশ্রণ করে, কিছু মিথ্যা সংকেতগুলি ফিল্টার করা যায়, যা সংকেতের নির্ভরযোগ্যতা বাড়ায়।
এই কৌশলটি গড়রেখা এবং MACD দুটি সূচকের সুবিধাগুলিকে একত্রিত করে, যৌগিক সংকেত ব্যবহার করে, যা মিথ্যা সংকেতগুলিকে কার্যকরভাবে ফিল্টার করতে পারে। অপ্টিমাইজেশন প্যারামিটার এবং পজিশন খোলার কৌশল দ্বারা স্থিতিশীল উপার্জন অর্জন করা যায়। তবে স্টপ লস ভেঙে যাওয়ার ঝুঁকি সম্পর্কেও সতর্কতা অবলম্বন করা দরকার, যা আরও পরীক্ষা এবং পরিমার্জন প্রয়োজন।
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-24 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("EMA50Diff & MACD Strategy", overlay=false)
EMA = input(18, step=1)
MACDfast = input(12)
MACDslow = input(26)
EMADiffThreshold = input(8)
MACDThreshold = input(80)
TargetValidityThreshold = input(65, step=5)
Target = input(120, step=5)
StopLoss = input(650, step=5)
ema = ema(close, EMA)
hl = plot(0, color=white, linewidth=1)
diff = close - ema
clr = color(blue, transp=100)
if diff>0
clr := lime
else
if diff<0
clr := red
fastMA = ema(close, MACDfast)
slowMA = ema(close, MACDslow)
macd = (fastMA - slowMA)*3
signal = sma(macd, 9)
plot(macd, color=aqua, linewidth=2)
plot(signal, color=purple, linewidth=2)
macdlong = macd<-MACDThreshold and signal<-MACDThreshold and crossover(macd, signal)
macdshort = macd>MACDThreshold and signal>MACDThreshold and crossunder(macd, signal)
position = 0.0
position := nz(strategy.position_size, 0.0)
long = (position < 0 and close < strategy.position_avg_price - TargetValidityThreshold and macdlong) or
(position == 0.0 and diff < -EMADiffThreshold and diff > diff[1] and diff[1] < diff[2] and macdlong)
short = (position > 0 and close > strategy.position_avg_price + TargetValidityThreshold and macdshort) or
(position == 0.0 and diff > EMADiffThreshold and diff < diff[1] and diff[1] > diff[2] and macdshort)
amount = (strategy.equity / close) //- ((strategy.equity / close / 10)%10)
bgclr = color(blue, transp=100) //#0c0c0c
if long
strategy.entry("long", strategy.long, amount)
bgclr := green
if short
strategy.entry("short", strategy.short, amount)
bgclr := maroon
bgcolor(bgclr, transp=20)
strategy.close("long", when=close>strategy.position_avg_price + Target)
strategy.close("short", when=close<strategy.position_avg_price - Target)
strategy.exit("STOPLOSS", "long", stop=strategy.position_avg_price - StopLoss)
strategy.exit("STOPLOSS", "short", stop=strategy.position_avg_price + StopLoss)
//plotshape(long, style=shape.labelup, location=location.bottom, color=green)
//plotshape(short, style=shape.labeldown, location=location.top, color=red)
pl = plot(diff, style=histogram, color=clr)
fill(hl, pl, color=clr)