দুই ধাপের স্টপ লস কৌশল

লেখক:চাওঝাং, তারিখ: ২০২৩-১০-২৫ ১৮ঃ১১ঃ৩০
ট্যাগঃ

img

সারসংক্ষেপ

এই কৌশলটির মূল ধারণা হল দুটি লাভের লক্ষ্য নির্ধারণ করা এবং স্টপ লসকে প্রবেশের মূল্যে স্থানান্তর করা প্রথম লক্ষ্যমাত্রা অর্জনের পরে স্টপ লস শিকার এড়ানোর জন্য।

কৌশলগত যুক্তি

এই কৌশলটি বোলিংজার ব্যান্ড এবং স্টোকাস্টিক সূচকগুলির উপর ভিত্তি করে ব্যবসায় প্রবেশ করে। যখন দাম বোলিংজার উপরের ব্যান্ড অতিক্রম করে তখন এটি শর্ট হয় এবং যখন স্টোকাস্টিক oversold দেখায় তখন দীর্ঘ হয়।

বিশেষ করে, এন্ট্রি লজিক হলঃ

  1. যখন close Bollinger lower band এর নিচে থাকে এবং Stochastic K D এর নিচে অতিক্রম করে তখন long প্রবেশ করুন।

  2. যখন close Bollinger upper band এর উপরে থাকে এবং Stochastic K D এর উপরে অতিক্রম করে তখন short এ প্রবেশ করুন।

কৌশলটি দুটি লাভের লক্ষ্য নির্ধারণ করে, টিপি 1 200 পয়েন্ট এবং টিপি 2 500 পয়েন্ট স্থির করে।

যখন মূল্য সরে যায় এবং টিপি 1 ট্রিগার হয়, তখন কৌশলটি স্টপ লসকে প্রবেশের মূল্যে স্থানান্তরিত করবে। এটি প্রথম পর্যায়ে মুনাফা লক করে এবং স্টপ লস শিকারকে বাধা দেয়।

যখন TP2 বা স্টপ লস ট্রিগার করা হয় তখন কৌশলটি সমস্ত পজিশন বন্ধ করে দেয়।

সুবিধা বিশ্লেষণ

এই দুই ধাপের স্টপ লস পদ্ধতির সবচেয়ে বড় সুবিধা হল এটি স্টপ লস শিকারকে প্রতিরোধ করার সময় লাভকে লক করার অনুমতি দেয়। স্টপ লসকে এন্ট্রি মূল্যে স্থানান্তর করে, এটি স্টপ লস শিকার হওয়ার সম্ভাবনা হ্রাস করে এবং লাভ রক্ষা করে।

আরেকটি সুবিধা হ'ল ভোলটাইলিটি রেঞ্জ এবং ওভারক্রয় / ওভারসোল্ডের জন্য স্টোকাস্টিক পরিমাপ করার জন্য বোলিংজার ব্যান্ডের সংমিশ্রণটি আরও নির্ভুল এন্ট্রি তৈরি করে।

ঝুঁকি বিশ্লেষণ

মূল ঝুঁকিগুলি বোলিংজার ব্যান্ড এবং স্টোকাস্টিক সূচকগুলির সম্ভাব্য মিথ্যা সংকেত থেকে উদ্ভূত। ভুল বোলিংজার ব্যাপ্তি অনুপস্থিত এন্ট্রি বা খারাপ সংকেতগুলির দিকে পরিচালিত করতে পারে। স্টোকাস্টিক মিথ্যা ব্রেকআউটগুলিও ভুল এন্ট্রিগুলির কারণ হতে পারে।

স্টপ লস পুনরায় প্রবেশ মূল্যের দিকে সরানোর পরে শিকার হওয়ার ঝুঁকিও রয়েছে। ভি-আকৃতির বিপরীতগুলি দ্বিতীয়বার স্টপ লসকে ট্রিগার করতে পারে।

এই ঝুঁকিগুলি উভয় সূচকগুলির জন্য পরামিতিগুলি অনুকূল করে এবং স্টপ লসগুলির মধ্যে দূরত্ব বাড়িয়ে হ্রাস করা যেতে পারে।

অপ্টিমাইজেশান নির্দেশাবলী

এই কৌশলটির জন্য আরও অপ্টিমাইজেশানঃ

  1. অপ্টিমাম বোলিংজার এবং স্টোকাস্টিক প্যারামিটার খুঁজে পেতে বিভিন্ন প্যারামিটার সমন্বয় পরীক্ষা করুন।

  2. আদর্শ কনফিগারেশন খুঁজে পেতে বিভিন্ন লাভ/হানি লক্ষ্য পরীক্ষা করুন।

  3. আরও সঠিকতার জন্য মাল্টি-ইন্ডিক্টর সিস্টেম তৈরি করতে চলমান গড়ের মতো অন্যান্য সূচক যুক্ত করুন।

  4. বিকল্প স্টপ লস পজিশনিং লজিকের গবেষণা করুন, যেমন প্রবেশের মূল্যের পরিবর্তে প্রবেশের স্থির দূরত্ব।

  5. স্টপ লস মুভমেন্টের সংখ্যা ৩টি বা তার বেশি পর্যায়ে বৃদ্ধি করা।

সিদ্ধান্ত

এই কৌশলটি এন্ট্রিগুলির জন্য বোলিংজার ব্যান্ড এবং স্টোকাস্টিক ব্যবহার করে, দুটি লাভের লক্ষ্য নির্ধারণ করে এবং প্রথম লক্ষ্যমাত্রা অর্জনের পরে দুটি স্তরের স্টপ লস গঠনের জন্য এন্ট্রিতে স্টপ লস সরিয়ে দেয়। এটি কার্যকরভাবে মুনাফা লক করে এবং স্টপ লস শিকারকে প্রতিরোধ করে। পরামিতি অপ্টিমাইজেশন, মাল্টি-ইন্ডিকেটর সিস্টেম এবং স্টপ লস লজিক সামঞ্জস্যের মাধ্যমে কৌশলটির সুস্পষ্ট সুবিধা রয়েছে তবে উন্নতির জন্যও জায়গা রয়েছে।


/*backtest
start: 2022-10-18 00:00:00
end: 2023-10-24 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/
// © fpsd4ve

//@version=5

// Add Bollinger Bands indicator (close, 20, 2) manually to visualise trading conditions
strategy("2xTP, SL to entry", 
     overlay=false,
     pyramiding=0,
     calc_on_every_tick=false,
     default_qty_type=strategy.percent_of_equity,
     default_qty_value=25,
     initial_capital=1000,
     commission_type=strategy.commission.percent,
     commission_value=0.01
     )

// PARAMETERS
// Assumes quote currency is FIAT as with BTC/USDT pair
tp1=input.float(200, title="Take Profit 1")
tp2=input.float(500, title="Take Profit 2")
sl=input.float(200, title="Stop Loss")
stOBOS = input.bool(true, title="Use Stochastic overbought/oversold threshold")

// Colors
colorRed = #FF2052
colorGreen = #66FF00


// FUNCTIONS
// Stochastic
f_stochastic() =>
    stoch = ta.stoch(close, high, low, 14)
    stoch_K = ta.sma(stoch, 3)
    stoch_D = ta.sma(stoch_K, 3)
    stRD = ta.crossunder(stoch_K, stoch_D)
    stGD = ta.crossover(stoch_K, stoch_D)
    [stoch_K, stoch_D, stRD, stGD]


// VARIABLES
[bbMiddle, bbUpper, bbLower] = ta.bb(close, 20, 2)
[stoch_K, stoch_D, stRD, stGD] = f_stochastic()


// ORDERS
// Active Orders
// Check if strategy has open positions
inLong = strategy.position_size > 0
inShort = strategy.position_size < 0
// Check if strategy reduced position size in last bar
longClose = strategy.position_size < strategy.position_size[1]
shortClose = strategy.position_size > strategy.position_size[1]

// Entry Conditions
// Enter long when during last candle these conditions are true:
// Candle high is greater than upper Bollinger Band
// Stochastic K line crosses under D line and is oversold
longCondition = stOBOS ?
     low[1] < bbLower[1] and stGD[1] and stoch_K[1] < 25 :
     low[1] < bbLower[1] and stGD[1]

// Enter short when during last candle these conditions are true:
// Candle low is lower than lower Bollinger Band
// Stochastic K line crosses over D line and is overbought
shortCondition = stOBOS ?
     high[1] > bbUpper[1] and stRD[1] and stoch_K[1] > 75 :
     high[1] > bbUpper[1] and stRD[1]

// Exit Conditions
// Calculate Take Profit 
longTP1 = strategy.position_avg_price + tp1
longTP2 = strategy.position_avg_price + tp2
shortTP1 = strategy.position_avg_price - tp1
shortTP2 = strategy.position_avg_price - tp2

// Calculate Stop Loss
// Initialise variables
var float longSL = 0.0
var float shortSL = 0.0

// When not in position, set stop loss using close price which is the price used during backtesting
// When in a position, check to see if the position was reduced on the last bar
// If it was, set stop loss to position entry price. Otherwise, maintain last stop loss value
longSL := if inLong and ta.barssince(longClose) < ta.barssince(longCondition)
    strategy.position_avg_price
else if inLong
    longSL[1]
else
    close - sl

shortSL := if inShort and ta.barssince(shortClose) < ta.barssince(shortCondition)
    strategy.position_avg_price
else if inShort
    shortSL[1]
else
    close + sl

// Manage positions
strategy.entry("Long", strategy.long, when=longCondition)
strategy.exit("TP1/SL", from_entry="Long", qty_percent=50, limit=longTP1, stop=longSL)
strategy.exit("TP2/SL", from_entry="Long", limit=longTP2, stop=longSL)

strategy.entry("Short", strategy.short, when=shortCondition)
strategy.exit("TP1/SL", from_entry="Short", qty_percent=50, limit=shortTP1, stop=shortSL)
strategy.exit("TP2/SL", from_entry="Short", limit=shortTP2, stop=shortSL)


// DRAW
// Stochastic Chart
plot(stoch_K, color=color.blue)
plot(stoch_D, color=color.orange)

// Circles
plot(stOBOS ? stRD and stoch_K >= 75 ? stoch_D : na : stRD ? stoch_D : na, color=colorRed, style=plot.style_circles, linewidth=3)
plot(stOBOS ? stGD and stoch_K <= 25 ? stoch_D : na : stGD ? stoch_K : na, color=colorGreen, style=plot.style_circles, linewidth=3)

// Levels
hline(75, linestyle=hline.style_dotted)
hline(25, linestyle=hline.style_dotted)

আরো