
এই কৌশলটি ক্রমাগত কে লাইনের গতির উপর ভিত্তি করে, বর্তমান বন্ধের দামের সাথে পূর্ববর্তী তিনটি কে লাইনের বন্ধের দামের তুলনা করে সিদ্ধান্ত নেওয়া হয় যে কোনও অবস্থান খোলা হয়েছে কিনা। ক্রমাগত তিনটি কে লাইন যখন উচ্চতর হয় তখন একাধিক পজিশন খোলা হয়, বিপরীতভাবে পজিশন বন্ধ। একই সাথে, কৌশলটি গতিশীল স্টপ লস পদ্ধতি ব্যবহার করে, স্টপ লসটি পজিশন খোলার দাম এবং সেট করা স্টপ লস শতাংশের উপর ভিত্তি করে নির্ধারণ করা হয়। এই পদ্ধতিটি গতিশীলভাবে স্টপ লসটি সামঞ্জস্য করতে পারে, ঝুঁকি নিয়ন্ত্রণে আরও ভাল।
এই কৌশলটি ক্রমাগত কে লাইনের গতিবিধি বিচার করে পজিশন খোলার সিদ্ধান্ত গ্রহণ করে এবং গতিশীল ক্ষতি বন্ধের পদ্ধতি ব্যবহার করে ঝুঁকি নিয়ন্ত্রণ করে। কৌশলগত যুক্তিটি পরিষ্কার, সহজেই বোঝা যায় এবং বাস্তবায়ন করা যায়, এটি বিভিন্ন বাজার এবং জাতের জন্য প্রযোজ্য। তবে বাস্তব প্রয়োগে, বাজারের অ-ট্রেন্ডিং ঝুঁকির দিকে মনোযোগ দেওয়া এবং স্টপ লস শতাংশের মতো প্যারামিটারগুলিকে অনুকূলিতকরণের প্রয়োজন। এছাড়াও, আরও প্রযুক্তিগত সূচক, পজিশন ম্যানেজমেন্ট এবং অন্যান্য পদ্ধতি প্রবর্তন করা কৌশলগত পারফরম্যান্সকে আরও উন্নত করতে পারে।
/*backtest
start: 2023-05-28 00:00:00
end: 2024-06-02 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("4 Candle Entry and Exit Strategy", overlay=true)
// Define the stop loss percentage
stopLossPercent = input.float(11, title="Stop Loss Percentage", minval=0.1) / 100
// Identify if the previous 3 candles are consecutively higher
longCondition = close[3] > close[4] and close[2] > close[3] and close[1] > close[2]
// Identify if the previous 3 candles are consecutively lower
exitCondition = close[3] < close[4] and close[2] < close[3] and close[1] < close[2]
// Initialize the entry price and stop loss variables
var float entryPrice = na
var float stopLoss = na
// Update the entry price and stop loss if the long condition is met
if (longCondition)
entryPrice := close[1]
stopLoss := entryPrice * (1 - stopLossPercent)
// Enter the long position at the open of the 4th candle
if (longCondition)
strategy.entry("Long", strategy.long, qty=1)
// Exit the position if exit condition is met or stop loss is hit
if (exitCondition or (strategy.position_size > 0 and low <= stopLoss))
strategy.close("Long")
// Optional: Plot the entry and exit signals on the chart
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
plotshape(series=exitCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")