
এই কৌশলটি একটি প্রবণতা ট্র্যাকিং সিস্টেম যা কাফমান স্ব-অনুকূলিত চলমান গড় ((KAMA) এবং MACD এর উপর ভিত্তি করে। এটি KAMA কে প্রধান প্রবণতা বিচারক সূচক হিসাবে ব্যবহার করে, MACD এর সাথে গতিশীলতা নিশ্চিতকরণ সূচক হিসাবে, বাজারের প্রবণতাগুলির বুদ্ধিমান ট্র্যাকিং এবং ট্রেডিংয়ের সময়কে সঠিকভাবে ধরে রাখার জন্য। কৌশলটি 4 ঘন্টা সময় ফ্রেমে কাজ করে, গতিশীল স্টপ লস এবং লাভের লক্ষ্য নিয়ে ঝুঁকি পরিচালনা করে।
কৌশলটির মূল যুক্তি নিম্নলিখিত মূল উপাদানগুলির উপর ভিত্তি করে:
এটি একটি প্রবণতা-অনুসরণ কৌশল যা ক্লাসিক প্রযুক্তিগত সূচক KAMA এবং MACD এর উদ্ভাবনকে একত্রিত করে। এটি একটি শক্তিশালী ব্যবহারিকতা এবং স্থায়িত্বের সাথে একটি শক্তিশালী ঝুঁকি ব্যবস্থাপনা সিস্টেমের সাথে একটি স্বনির্ধারিত চলমান গড় এবং গতিশীলতা নিশ্চিতকরণের সাথে যুক্ত। যদিও কিছু স্থগিতাদেশ এবং প্যারামিটার সংবেদনশীলতার ঝুঁকি রয়েছে, তবে প্রস্তাবিত অপ্টিমাইজেশনের দিকনির্দেশগুলি কৌশলটির স্থায়িত্ব এবং লাভজনকতা আরও বাড়িয়ে তুলতে পারে।
/*backtest
start: 2024-02-20 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mckat
//@version=5
strategy("4-Hour KAMA Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === Inputs ===
ama_length = input.int(50, title="KAMA Length for 4H")
fast_length = input.int(3, title="KAMA Fast Length")
slow_length = input.int(30, title="KAMA Slow Length")
atr_length = input.int(14, title="ATR Length")
atr_mult = input.float(3.0, title="ATR Multiplier for Stop-Loss & Take-Profit")
// === KAMA Calculation ===
var float kama = na
price_change = math.abs(close - close[ama_length])
volatility_sum = 0.0
for i = 0 to ama_length - 1
volatility_sum := volatility_sum + math.abs(close[i] - close[i + 1])
efficiency_ratio = price_change / volatility_sum
smoothing_constant = math.pow(efficiency_ratio * (2 / (fast_length + 1) - 2 / (slow_length + 1)) + 2 / (slow_length + 1), 2)
kama := na(kama[1]) ? close : kama[1] + smoothing_constant * (close - kama[1])
// Plot KAMA
plot(kama, color=color.blue, title="KAMA (50)")
// === ATR for Stop-Loss and Take-Profit ===
atr = ta.atr(atr_length)
stop_loss = close - atr * atr_mult
take_profit = close + atr * atr_mult
// === MACD for Momentum Confirmation (Slow Settings for 4H) ===
[macd_line, signal_line, _] = ta.macd(close, 26, 52, 18)
macd_bullish = macd_line > signal_line
macd_bearish = macd_line < signal_line
// === Entry and Exit Conditions ===
buy_condition = ta.crossover(close, kama) and macd_bullish
sell_condition = ta.crossunder(close, kama) and macd_bearish
// === Execute Trades ===
if (buy_condition)
strategy.entry("Buy", strategy.long)
if (sell_condition)
strategy.close("Buy")
// === Dynamic Stop-Loss and Take-Profit ===
strategy.exit("Exit", "Buy", stop=stop_loss, limit=take_profit)
// === Plot Signals ===
plotshape(series=buy_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sell_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")