
এই কৌশলটি একটি Elder’s Force Index (EFI) এর উপর ভিত্তি করে একটি পরিমাণগত ট্রেডিং সিস্টেম যা স্ট্যান্ডার্ড ডিফারেনশিয়াল এবং মুভিং এভারেজের সাথে সংকেত বিচার করে এবং এটিআর ব্যবহার করে গতিশীলভাবে স্টপ লস স্টপ অবস্থানগুলিকে সামঞ্জস্য করে। এই কৌশলটি দ্রুত এবং ধীর ইএফআই সূচকগুলি গণনা করে এবং তাদের মানককরণের পরে ক্রস সিগন্যাল বিচার করে একটি সম্পূর্ণ ট্রেডিং সিস্টেম অর্জন করে। কৌশলটি গতিশীল স্টপ এবং ট্র্যাকিং স্টপ মেশিন ব্যবহার করে, কার্যকরভাবে ঝুঁকি নিয়ন্ত্রণ করে এবং একই সাথে বৃহত্তর উপার্জনের সন্ধান করে।
কৌশলটি নিম্নলিখিত মূল উপাদানগুলির উপর ভিত্তি করে তৈরি করা হয়েছেঃ
এই কৌশলটি ইএফআই সূচক, স্ট্যান্ডার্ড ডিভেরিয়েন্স এবং এটিআর সংযুক্ত করে একটি সম্পূর্ণ ট্রেডিং সিস্টেম তৈরি করে। কৌশলটির সুবিধা হল যে সিগন্যাল সিস্টেমটি নির্ভরযোগ্য এবং ঝুঁকি নিয়ন্ত্রণের জন্য যুক্তিসঙ্গত, তবে বিভিন্ন বাজার পরিস্থিতির জন্য অপ্টিমাইজেশনের প্রয়োজন রয়েছে। বাজারের পরিবেশের বিচার, লেনদেনের পরিমাণ ফিল্টারিং ইত্যাদির মতো প্রক্রিয়া যুক্ত করে কৌশলটির স্থিতিশীলতা এবং লাভজনকতা আরও বাড়ানো যেতে পারে। সামগ্রিকভাবে, কৌশলটি একটি ভাল পরিমাণযুক্ত ট্রেডিং ফ্রেমওয়ার্ক সরবরাহ করে, যার ভাল ব্যবহারিক মূল্য রয়েছে।
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Elder's Force Index Strategy with ATR-Based SL and TP", overlay=true)
// Input parameters for fast and long EFI
efi_fast_length = input.int(13, "Fast EFI Length", minval=1)
efi_long_length = input.int(50, "Long EFI Length", minval=1)
stdev_length = input.int(50, "Standard Deviation Length", minval=2, maxval=300)
numdev = input.float(2, "Number of Deviations", minval=1, maxval=20, step=0.1)
atr_length = input.int(14, "ATR Length", minval=1)
atr_multiplier_sl = input.float(1.5, "ATR Multiplier for Stop Loss", step=0.1)
trailing_tp_multiplier = input.float(0.5, "Multiplier for Trailing Take Profit", step=0.1)
// Elder's Force Index Calculation for Fast and Long EFI
efi_fast = ta.ema((close - close[1]) * volume, efi_fast_length)
efi_long = ta.ema((close - close[1]) * volume, efi_long_length)
// Calculate Standard Deviation for Fast EFI
efi_fast_average = ta.sma(efi_fast, stdev_length)
efi_fast_stdev = ta.stdev(efi_fast, stdev_length)
efi_fast_diff = efi_fast - efi_fast_average
efi_fast_result = efi_fast_diff / efi_fast_stdev
// Calculate Standard Deviation for Long EFI
efi_long_average = ta.sma(efi_long, stdev_length)
efi_long_stdev = ta.stdev(efi_long, stdev_length)
efi_long_diff = efi_long - efi_long_average
efi_long_result = efi_long_diff / efi_long_stdev
// Define upper and lower standard deviation levels
upper_sd = numdev
lower_sd = -numdev
// Define entry conditions based on crossing upper and lower standard deviations
long_condition = efi_fast_result > upper_sd and efi_long_result > upper_sd
short_condition = efi_fast_result < lower_sd and efi_long_result < lower_sd
// Check if a position is already open
is_position_open = strategy.position_size != 0
// Calculate ATR for stop loss and take profit
atr = ta.atr(atr_length)
// Initialize stop loss and take profit variables
var float stop_loss = na
var float take_profit = na
// Execute trades based on conditions, ensuring only one trade at a time
if (long_condition and not is_position_open)
strategy.entry("Long", strategy.long)
stop_loss := close - atr * atr_multiplier_sl // Set initial stop loss based on ATR
take_profit := close + atr * trailing_tp_multiplier // Set initial take profit based on ATR
if (short_condition and not is_position_open)
strategy.entry("Short", strategy.short)
stop_loss := close + atr * atr_multiplier_sl // Set initial stop loss based on ATR
take_profit := close - atr * trailing_tp_multiplier // Set initial take profit based on ATR
// Update exit conditions
if (is_position_open)
// Update stop loss for trailing
if (strategy.position_size > 0) // For long positions
stop_loss := math.max(stop_loss, close - atr * atr_multiplier_sl)
// Adjust take profit based on price movement
take_profit := math.max(take_profit, close + atr * trailing_tp_multiplier)
else if (strategy.position_size < 0) // For short positions
stop_loss := math.min(stop_loss, close + atr * atr_multiplier_sl)
// Adjust take profit based on price movement
take_profit := math.min(take_profit, close - atr * trailing_tp_multiplier)
// Set exit conditions
strategy.exit("Long Exit", from_entry="Long", stop=stop_loss, limit=take_profit)
strategy.exit("Short Exit", from_entry="Short", stop=stop_loss, limit=take_profit)