
এই কৌশলটি সুপারট্রেন্ড সূচক এবং MACD সূচককে একত্রিত করে, ছোট প্রবণতা ক্যাপচার করে মুনাফা অর্জনের জন্য। কৌশলটি সুপারট্রেন্ড সূচককে বর্তমান বাজারের প্রবণতা বিচার করার জন্য ব্যবহার করে, এবং MACD সূচককে প্রবেশ এবং প্রস্থান করার জন্য সহায়ক শর্ত হিসাবে ব্যবহার করে। কৌশলটির যুক্তি পরিষ্কার, সহজেই বোঝা এবং বাস্তবায়ন করা যায়।
এই কৌশলটি একটি সুপার ট্রেন্ডিং সূচক এবং একটি MACD সূচককে সংযুক্ত করে, ছোট প্রবণতা ক্যাপচার করার সাথে সাথে প্রবণতার ধারাবাহিকতা বিবেচনা করে, এটি একটি আরও বিস্তৃত এবং সুষম কৌশল। কৌশলটির সুবিধা হল যে এটি যৌক্তিকভাবে পরিষ্কার, সহজেই বোঝা যায় এবং বাস্তবায়িত হয়, এবং দীর্ঘতর চক্রের MACD সূচককে সহায়ক শর্ত হিসাবে ব্যবহার করে কিছু মিথ্যা সংকেতকে কার্যকরভাবে ফিল্টার করা যায়। তবে কৌশলটিতে কিছু ঝুঁকিও রয়েছে, যেমন ঘন ঘন ট্রেডিংয়ের সম্ভাবনা, প্যারামিটার সেটিংয়ের জন্য বেশি সংবেদনশীল, এবং স্টপ লস ব্যবস্থাপনার অভাব। এই ঝুঁকির জন্য, আরও শর্তাদি ফিল্টার, প্যারামিটার অপ্টিমাইজেশন, স্টপ লস ইত্যাদি যুক্ত করে অপ্টিমাইজেশন এবং উন্নতি করা যেতে পারে। সামগ্রিকভাবে, কৌশলটি একটি মৌলিক কাঠামোর মতো কাজ করতে পারে এবং ক্রমাগত অপ্টিমাইজেশন এবং উন্নতির মাধ্যমে একটি স্থিতিশীল লাভজনক কৌশল হতে পারে।
/*backtest
start: 2024-02-01 00:00:00
end: 2024-02-29 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Samsuga supertrend", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
atrPeriod = input.int(7, "ATR Length", minval = 1)
factor = input.float(1.0, "Factor", minval = 0.01, step = 0.01)
[supertrend, direction] = ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
upTrend = plot(direction <= 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction <= 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, "Body Middle",display = display.none)
longcondition = direction[1] > direction
shortCondition = direction[1] < direction
macdp1 = 3
macdp2=10
macdp3=6
[macdLine, signalLine, histLine] =request.security(symbol = syminfo.tickerid, timeframe = "30",expression = ta.macd(close,macdp1,macdp2,macdp3),lookahead=barmerge.lookahead_on)
// plot(macdLine, title = "MACD", color = #2962FF)
// plot(signalLine, title = "Signal", color = #FF6D00)
// 8, 21, 5
// 8,13,9
// 12,26,9
// 1--> 3, 17, 5
// 3, 10, 16
// log.info(str.tostring(syminfo.tickerid)+str.tostring(histLine[0]))
// /////////----------------METHOD 1-----------------////////////////
// if(longcondition)
// if(strategy.opentrades>0)
// strategy.close("Long","Prev Exit", immediately = true)
// if( histLine[0] > 0.1)
// strategy.entry(id= "Long", direction=strategy.long, comment = "update long")
// else if(shortCondition and strategy.openprofit<=0.1)
// strategy.close("Long",comment = "Close",immediately = true)
// /////////----------------METHOD 2-----------------////////////////
// if(longcondition)
// if(histLine[0] > 0)
// strategy.entry(id= "Long", direction=strategy.long, comment = "update long" )
// strategy.exit("Long", loss = close*0.2)
// else if(shortCondition )
// strategy.close("Long",comment = "Close",immediately = true)
// /////////----------------METHOD 3-----------------////////////////
// log.info(str.tostring(syminfo.tickerid)+str.tostring(histLine[0]))
if(longcondition)
if(histLine[0] > 0)
strategy.close("Short",comment = "E-S", alert_message = "E-S",disable_alert = true)
strategy.entry(id= "Long", direction=strategy.long, comment = "L",alert_message = "L")
else if(shortCondition)
if(histLine[0] < 0)
strategy.close("Long",comment = "E-L",alert_message = "E-L",disable_alert = true)
strategy.entry(id= "Short", direction=strategy.short, comment = "S",alert_message = "S")