
এই কৌশলটি EMA সমান্তরাল গোল্ডেন ক্রস ব্যবহার করে ট্রেডিং সিগন্যাল তৈরি করে, অর্থাৎ দ্রুত EMA লাইনে ধীর EMA লাইন অতিক্রম করার সময় একটি কেনার সংকেত তৈরি করে এবং দ্রুত EMA লাইনের নীচে ধীর EMA লাইন অতিক্রম করার সময় একটি বিক্রয় সংকেত তৈরি করে। এটি একটি সাধারণ প্রবণতা অনুসরণকারী কৌশল। একই সাথে, কৌশলটি ATR সূচক ব্যবহার করে গতিশীল স্টপ লস সেট করে এবং একই সাথে ঝুঁকি নিয়ন্ত্রণ করে।
সমাধানঃ
এই কৌশলটি সামগ্রিকভাবে সহজ এবং সহজেই ব্যবহারযোগ্য, ইএমএ-এর উপর ভিত্তি করে একটি সংকেত উত্পন্ন করে, এবং এটিআর সূচক দ্বারা ক্ষতির ট্র্যাকিংয়ের সাথে যুক্ত হয়, যা কার্যকরভাবে ঝুঁকি নিয়ন্ত্রণ করতে পারে। যদিও কিছু মিথ্যা সংকেত থাকবে, তবে মূল প্রবণতা ধরার ক্ষমতা শক্তিশালী, আয়টি স্থিতিশীল, এটি পরিমাণগত ব্যবসায়ের জন্য উপযুক্ত একটি মৌলিক কৌশল। প্যারামিটার অপ্টিমাইজেশন এবং বৈশিষ্ট্য সম্প্রসারণের মাধ্যমে এটির অনেক উন্নতির জায়গা রয়েছে, যা গভীরভাবে অধ্যয়নরত।
/*backtest
start: 2022-12-04 00:00:00
end: 2023-12-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © byee322
/// This strategy uses the EMA to generate buy and sell signals with a 1.5x ATR stop loss
//@version=5
strategy("EMA Strategy with ATR Stop Loss", overlay=true)
// Define the EMA lengths as input parameters
emaLength1 = input(13, "EMA Length 1")
emaLength2 = input(48, "EMA Length 2")
// Define the moving averages
ema1 = ta.ema(close, emaLength1)
ema2 = ta.ema(close, emaLength2)
// Buy signal: EMA 1 crosses above EMA 2
buy = ta.crossover(ema1, ema2)
// Sell signal: EMA 1 crosses below EMA 2
sell = ta.crossunder(ema1, ema2)
// Define the state variable
state = 0
state := buy ? 1 : sell ? -1 : nz(state[1])
// Change the color of the candles
color = state == 1 ? color.green : state == -1 ? color.red : na
// Plot the colored candles
plotcandle(open, high, low, close, color=color)
// Plot the signals on the chart with text labels
plotshape(buy, style=shape.triangleup, color=color.new(color.green, 50), location=location.belowbar, text="Buy")
plotshape(sell, style=shape.triangledown, color=color.new(color.red, 50), location=location.abovebar, text="Sell")
// Calculate the ATR
atrVal = ta.atr(14)
// Calculate the stop loss level for buy
stopLossBuy = buy ? close[1] - 1.5 * atrVal : na
// Calculate the stop loss level for sell
stopLossSell = sell ? close[1] + 1.5 * atrVal : na
// Plot the stop loss level for buy
plot(stopLossBuy, color=color.new(color.green, 50), linewidth=3)
// Plot the stop loss level for sell
plot(stopLossSell, color=color.new(color.red, 50), linewidth=3)
if buy
strategy.entry("Enter Long", strategy.long)
else if sell
strategy.entry("Enter Short", strategy.short)