
এই কৌশলটি ভিডাব্লুএপি (ভেরিয়েন্ট ওয়েটেড এভারেজ প্রাইস) সূচক এবং দামের ক্রস-সম্পর্ক ভিত্তিক ট্রেডিংয়ের উপর ভিত্তি করে। যখন দাম ভিডাব্লুএপি অতিক্রম করে তখন অতিরিক্ত পজিশন খোলা হয় এবং যখন এটি ভিডাব্লুএপি অতিক্রম করে তখন খালি পজিশন খোলা হয়। একই সাথে, এটিআর (এভারেজ রিয়েল স্ট্রাইক রেঞ্জ) সূচকটি ব্যবহার করে গতিশীল স্টপ লস এবং স্টপ লেভেলের হিসাব করা হয় ঝুঁকি নিয়ন্ত্রণ এবং মুনাফা লক করতে।
এই কৌশলটি ভিডাব্লুএপিকে কেন্দ্র করে, দামের সাথে ক্রস-ইন করে ট্রেডিং সিগন্যাল তৈরি করে, এবং এটিআর এর সাথে মিলিত হয়ে গতিশীল স্টপ লস স্টপ বাস্তবায়ন করে, প্রবণতা ধরে রাখার সময় প্রত্যাহারের ঝুঁকি নিয়ন্ত্রণ করে, সামগ্রিক ধারণাটি সহজেই বোঝা যায়। তবে কৌশলটি আরও অপ্টিমাইজেশনের জন্য আরও জায়গা রয়েছে, সহায়ক সূচকগুলি প্রবর্তন করে, স্টপ লস স্টপ লজিককে অপ্টিমাইজ করে, তহবিল পরিচালনার সাথে যুক্ত করে, পরিবর্তিত বাজারের পরিবেশের সাথে আরও ভালভাবে খাপ খাইয়ে নিতে পারে, কৌশলটির স্থিতিশীলতা এবং লাভজনকতা বাড়ায়।
/*backtest
start: 2023-03-26 00:00:00
end: 2024-03-31 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Hannah Strategy Stop Loss and Take Profit", overlay=true)
// Inputs
cumulativePeriod = input(40, "VWAP Period")
atrPeriod = input(14, "ATR Period")
multiplier = input(1.5, "ATR Multiplier for Stop Loss")
targetMultiplier = input(3, "ATR Multiplier for Take Profit")
// Calculations for VWAP
typicalPrice = (high + low + close) / 3
typicalPriceVolume = typicalPrice * volume
cumulativeTypicalPriceVolume = sum(typicalPriceVolume, cumulativePeriod)
cumulativeVolume = sum(volume, cumulativePeriod)
vwapValue = cumulativeTypicalPriceVolume / cumulativeVolume
// Plot VWAP on the chart
plot(vwapValue, color=color.blue, title="VWAP")
// Entry Conditions based on price crossing over/under VWAP
longCondition = crossover(close, vwapValue)
shortCondition = crossunder(close, vwapValue)
// ATR Calculation for setting dynamic stop loss and take profit
atr = atr(atrPeriod)
// Execute Trades with Dynamic Stop Loss and Take Profit based on ATR
if (longCondition)
strategy.entry("Long", strategy.long)
// Setting stop loss and take profit for long positions
strategy.exit("Long Exit", "Long", stop=close - atr * multiplier, limit=close + atr * targetMultiplier)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Setting stop loss and take profit for short positions
strategy.exit("Short Exit", "Short", stop=close + atr * multiplier, limit=close - atr * targetMultiplier)