
দ্বি-মুখী চাপ-শক্তিযুক্ত ট্রেডিং কৌশলটি একটি প্রবণতা-অনুসরণ কৌশল যা র্যান্ডম সূচক এবং ক্রয়-বিক্রয় সূচকগুলির সমন্বয় করে। এই কৌশলটি মূলত কে এবং ডি লাইন এবং ক্রয়-বিক্রয় সূচকগুলি ব্যবহার করে ক্রয় এবং বিক্রয় সংকেত উত্পন্ন করে, সমান্তরাল গোল্ডফোর্স এবং ডেডফোর্সের সাহায্যে অতিরিক্ত সংকেত উত্পন্ন করে।
ক্রয় সংকেতের প্রধান ট্রিগার লজিক হল:
K লাইন এবং D লাইন একই সময়ে oversold অঞ্চল (যেমন 20) ভাঙার এবং একটি ঊর্ধ্বমুখী ক্রস উত্পন্ন, এবং K লাইন এবং D লাইন একই সময়ে একটি উত্থান প্রবণতা হয়
লেনদেনের পরিমাণ নির্দিষ্ট থ্রেশহোল্ডের চেয়ে বেশি (যেমন লেনদেনের গড় পরিমাণের 1.4 গুণ)
বন্ধের মূল্য খোলার মূল্যের চেয়ে বেশি (সাদা K লাইন)
এছাড়াও, নিম্নলিখিত সূত্রগুলি থেকে অতিরিক্ত ক্রয় সংকেত আসতে পারেঃ
সমান্তরাল জালঃ দ্রুত EMA লাইনের উপর ধীর EMA লাইন অতিক্রম করে এবং দুটি সমান্তরাল লাইন একই সাথে উত্থিত হয়
K লাইন এবং D লাইন একই সময়ে নিম্ন থেকে oversold অঞ্চলে প্রবেশ করে (যেমন 20 এর নীচে থেকে 20 থেকে 80 এর মধ্যে উঠা)
বিক্রয় সংকেতের মূল ট্রিগার হলোঃ
K লাইন এবং D লাইন একই সাথে ওভারসোল্ড অঞ্চলে প্রবেশ করে (যেমন ৮০)
সমান্তরাল ডাইফোর্কঃ দ্রুত ইএমএ লাইনের নীচে ধীর ইএমএ লাইন অতিক্রম করে
K লাইন D লাইন অতিক্রম করে এবং K লাইন এবং D লাইন উভয়ই নিম্নমুখী প্রবণতা রয়েছে
ক্রয় মূল্যের একটি নির্দিষ্ট শতাংশ (যেমন 6%) স্টপ লস লাইন হিসাবে সেট করুন, যদি দামটি এই লাইনটি অতিক্রম করে তবে স্টপ লস বিক্রয় ট্রিগার করে।
একটি একক র্যান্ডম সূচক প্রচুর পরিমাণে মিথ্যা সংকেত তৈরি করতে পারে। এই কৌশলটি কে লাইন এবং ডি লাইন (কে লাইনের চলমান গড়) দ্বৈত র্যান্ডম সূচক সমন্বয় ব্যবহার করে, যা কার্যকরভাবে মিথ্যা সংকেতগুলি ফিল্টার করতে পারে এবং সংকেতের নির্ভরযোগ্যতা নিশ্চিত করতে পারে।
লেনদেনের পরিমাণের শর্তগুলি সহযোগী বিচারক মানদণ্ড হিসাবে যুক্ত করা হয়েছে, যার জন্য লেনদেনের পরিমাণের একটি নির্দিষ্ট স্তরের চেয়ে বেশি প্রয়োজন, যার ফলে কম পরিমাণে অ-প্রবণতাযুক্ত ক্রয়-বিক্রয় পয়েন্টগুলি ফিল্টার করা যায় এবং পজিশনের ঝুঁকি হ্রাস করা যায়।
কৌশলটি একাধিক ক্রয়-বিক্রয় সংকেতকে একত্রিত করে, যা একটি সত্যিকারের ট্রেডিং সংকেত তৈরি করতে একই সময়ে ট্রিগার করা দরকার। একাধিক সূচককে একত্রিত করা সংকেতের নির্ভরযোগ্যতা বাড়িয়ে তুলতে পারে।
গড়রেখার বিচার করার নিয়ম যোগ করুন, যেমন শুধুমাত্র যখন গড়রেখার ধীরে ধীরে বৃদ্ধি হয় তখনই ক্রয় সংকেত বিবেচনা করুন। এটি বিপরীতমুখী ক্রয় বা টপিং এড়াতে পারে এবং বড় সময়কালের সময় থেকে প্রবণতা বিচার করতে পারে।
কৌশলটিতে স্টপ লস সিগন্যালের নকশা রয়েছে, যদি দাম ক্রয়-বিক্রয়ের সময় একটি নির্দিষ্ট শতাংশের নীচে চলে যায় তবে স্বয়ংক্রিয়ভাবে বন্ধ হয়ে যায়। এটি কার্যকরভাবে একক ব্যবসায়ের সর্বাধিক ক্ষতি নিয়ন্ত্রণ করতে পারে।
এই কৌশলটিতে বেশ কয়েকটি প্যারামিটার রয়েছে, যেমন র্যান্ডম ইনডিকেটর প্যারামিটার, গড় প্যারামিটার, ক্রয় পরিমাণের প্যারামিটার ইত্যাদি। এই প্যারামিটারগুলি বিভিন্ন জাতের জন্য অনুকূলিতকরণের প্রয়োজন, এবং ভুল সেট করা ফলাফলকে দুর্বল করতে পারে।
স্টপ লস পয়েন্ট সেট করার সময়, দামের উঁচুতে যাওয়ার সম্ভাবনা বিবেচনা করা দরকার। যদি স্টপ লস পয়েন্টটি ক্রয় মূল্যের খুব কাছাকাছি থাকে তবে উঁচুতে যাওয়ার ফলে অপ্রয়োজনীয় স্টপ লস হতে পারে।
কম সচল জাতের জন্য, প্রজনন পরিমাণের নিয়মগুলি অতিরিক্ত সংকেতগুলি ফিল্টার করতে পারে। এই সময়ে প্রজনন পরিমাণের শর্তগুলি হ্রাস করা দরকার।
বিভিন্ন পর্যায়ের সূচকগুলির মধ্যে বিট ক্রমের অসঙ্গতি হতে পারে, যা সংকেতের নির্ভুলতার উপর প্রভাব ফেলতে পারে। সংকেতের পয়েন্ট ক্রমের সামঞ্জস্যতা যাচাই করতে হবে।
এই কৌশলটি নিম্নলিখিত দিকগুলি থেকে উন্নত করা যেতে পারেঃ
স্থিতিশীলতা বাড়ানোর জন্য প্যারামিটার অপ্টিমাইজ করুন
মেশিন লার্নিং পদ্ধতিতে গতিশীল সমন্বয় প্যারামিটার যোগ করুন
অপ্টিমাইজ করা স্টপ লস কৌশল
আরও ফিল্টারিং যুক্ত করুন, কম লেনদেন করুন
শর্তসাপেক্ষ একক বা স্টপ-অফ কৌশলগুলি ব্যবহার করে আয় বাড়ান
জিনগত অ্যালগরিদমের মতো আরও পদ্ধতিগত পদ্ধতির মাধ্যমে প্রধান প্যারামিটারগুলিকে অপ্টিমাইজ করা যেতে পারে, যাতে বিভিন্ন বাজার চক্রের মধ্যে প্যারামিটারগুলি স্থিতিশীল পারফরম্যান্স অর্জন করতে পারে।
মডেলগুলিকে রিয়েল-টাইমে বাজার পরিস্থিতি মূল্যায়ন করতে প্রশিক্ষণ দেওয়া যেতে পারে এবং সেই অনুযায়ী কৌশলগত প্যারামিটারগুলি সামঞ্জস্য করা যায়, প্যারামিটারগুলির গতিশীল অপ্টিমাইজেশনের জন্য।
ভাল স্টপ লস কৌশলগুলি গবেষণা করা যেতে পারে, ঝুঁকি নিয়ন্ত্রণে রেখে, যতটা সম্ভব অপ্রয়োজনীয় স্টপ লস হ্রাস করা যায় এবং মুনাফার সুযোগ বাড়ানো যায়।
ট্রেডের সংখ্যা কমানোর জন্য এবং ট্রেডের খরচ কমানোর জন্য ফিল্টারিংয়ের শর্ত যথাযথভাবে জোরদার করা হয়েছে, যার ফলে প্রতিটি ট্রেডের রিটার্ন বেশি হবে।
বাজারের বৈশিষ্ট্য অনুসারে, একক কৌশল বা চলমান স্টপ স্টপ কৌশল ডিজাইন করা যেতে পারে, ক্ষতি থামানোর গ্যারান্টি দেওয়ার সময়, যতটা সম্ভব লাভের সর্বাধিকীকরণে প্লেইন করা যায়।
এই কৌশলটি প্রবণতা বিচার, ঝুঁকি নিয়ন্ত্রণ, ট্রেডিং ফ্রিকোয়েন্সি ইত্যাদির মতো একাধিক দিক বিবেচনা করে। মূল সুবিধা হ’ল দ্বৈত র্যান্ডম সূচকগুলি ট্র্যাভেলমিটার সূচক বিচার প্রবণতা এবং ঝুঁকি নিয়ন্ত্রণের সমন্বয়ে। পরবর্তী পদক্ষেপে, প্যারামিটার স্থিতিশীলতা, গতিশীল সমন্বয় প্যারামিটার, স্টপ লস হ্রাস ইত্যাদির দিক থেকে অপ্টিমাইজ করা যেতে পারে, যাতে কৌশলটি আরও বাজারের পরিবেশে স্থিতিশীল আয় অর্জন করতে পারে।
/*backtest
start: 2023-10-02 00:00:00
end: 2023-11-01 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
// SW SVE - Stochastic+Vol+EMAs [Sergio Waldoke]
// Script created by Sergio Waldoke (BETA VERSION v0.5, fine tuning PENDING)
// Stochastic process is the main source of signals, reinforced on buying by Volume. Also by Golden Cross.
// Selling is determined by K and D entering overselling zone or EMA's Death Cross signal, the first occurring,
// and some other signals combined.
// Buy Long when you see a long buy arrow.
// Sell when you see a close arrow.
// This is a version to be tuned and improved, but already showing excelent results after tune some parameters
// according to the kind of market.
// Strategy ready for doing backtests.
// SVE SYSTEM DESIGN:
// Buy Signal Trigger:
// - Both Stoch <= 20 crossing up and both growing and green candle and Vol/sma vol >= 1.40 Avg Vol
// or
// - Both Stoch growing up and Vol/sma vol >= 1.40 Avg Vol and green candle and
// both prior Stoch crossing up
// or
// [OPTIONAL]: (Bad for BTC 2018, excelent for 2017)
// - Crossingover(fast_ema, slow_ema) and growing(fast_ema) and growing(slow_ema) and green candle
// Exit position:
// - Both Stoch <= 20 and Both Stoch were > 20 during position
// or
// - CrossingUnder(Fast EMA, Medium EMA)
// or [OPTIONAL] (Better for BTC 2018, Worse for BNB 1H)
// - CrossingUnder(k, d) and (k and d starting over over_buying) and (k and d descending) and k crossing down over_buying line
//calc_on_every_tick=true,
//calc_on_order_fills=true, (affects historical calculation, triggers in middle of the bar, may be better for automatic orders)
strategy("SW SVE - Stochastic+Vol+EMAs [Sergio Waldoke]", shorttitle="SW SVE", overlay=true, max_bars_back=5000,
default_qty_type=strategy.percent_of_equity, default_qty_value=100, currency="USD",
commission_type=strategy.commission.percent, commission_value=0.25)
//Strategy Parameters
FromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
FromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
FromYear = input(defval = 2018, title = "From Year", minval = 2009, maxval = 2200)
ToDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)
ToMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)
ToYear = input(defval = 2030, title = "To Year", minval = 2009, maxval = 2200)
//Indicator Parameters
//Original defaults for 4HS: 14, 3, 80, 20, 14, 23, 40, 20, 40, 3:
stoch_k = input(title="Stoch K", defval=14, minval=1)
stoch_d = input(title="Stoch D", defval=3, minval=1)
over_buying = input(title="Stoch Overbuying Zone", defval=80, minval=0, maxval=100)
over_selling = input(title="Stoch Overselling Zone", defval=20, minval=0, maxval=100)
fast_ema_periods = input(title="Fast EMA (Death Cross)", defval=14, minval=1, maxval=600)
slow_ema_periods = input(title="Slow EMA (Death Cross)", defval=23, minval=1, maxval=600)
trend_ema_periods = input(title="Slowest EMA (Trend Test)", defval=40, minval=1, maxval=600)
volume_periods = input(title="Volume Periods", defval=20, minval=1, maxval=600)
volume_factor = input(title="Min Volume/Media Increase (%)", defval=80, minval=-100) / 100 + 1
threshold_sl_perc = input(title="[Sell Trigger] Stop Loss Threshold %", defval=6.0, type=float, minval=0, maxval=100)
//before_buy = input(title="# Growing Before Buy", defval=2, minval=1)
//before_sell = input(title="# Decreasing Before Sell", defval=1, minval=1)
//stepsignal = input(title="Show White Steps", type=bool, defval=true)
//steps_base = input(title="White Steps Base", defval=242, minval=0)
//Signals
fast_ema = ema(close, fast_ema_periods)
slow_ema = ema(close, slow_ema_periods)
trend_ema = ema(close, trend_ema_periods)
k = stoch(close, high, low, stoch_k)
d = sma(k, stoch_d)
vol_ma = sma(volume, volume_periods)
//REVIEW CONSTANT 1.75:
in_middle_zone(a) => a > over_selling * 1.75 and a < over_buying
growing(a) => a > a[1]
was_in_middle_zone = k == d
was_in_middle_zone := was_in_middle_zone[1] or in_middle_zone(k) and in_middle_zone(d)
//Buy Signal Trigger:
//- Both Stoch <= 20 crossing up and both growing and
// green candle and Vol/sma vol >= 1.40 Avg Vol
buy = k <= over_selling and d <= over_selling and crossover(k, d) and growing(k) and growing(d) and
close > open and volume/vol_ma >= volume_factor
//or
//- Both Stoch growing up and Vol/sma vol >= 1.40 Avg Vol and green candle and
// both prior Stoch crossing up
buy := buy or (growing(k) and growing(d) and volume/vol_ma >= volume_factor and close > open and
crossover(k[1], d[1]) )
//Worse:
// (crossover(k[1], d[1]) or (crossover(k, d) and k[1] <= over_selling and d[1] <= over_selling) ) )
//or
// [OPTIONAL]: (Bad for BTC 2018, excelent for 2017)
//- Crossingover(fast_ema, slow_ema) and growing(fast_ema) and growing(slow_ema) and green candle
buy := buy or (crossover(fast_ema, slow_ema) and growing(fast_ema) and growing(slow_ema) and close > open)
//Debug:
//d1 = close > open ? 400 : 0
//plot(d1+5200, color=white, linewidth = 3, style = stepline)
//Exit position:
//- Both Stoch <= 20 and Both Stoch were > 20 during position
sell = k <= over_selling and d <= over_selling and was_in_middle_zone
// or
//- CrossingUnder(Fast EMA, Medium EMA)
sell := sell or crossunder(fast_ema, slow_ema)
// or [OPTIONAL] (Better for BTC 2018, Worse for BNB 1H)
//- CrossingUnder(k, d) and (k and d starting over over_buying) and (k and d descending) and k crossing down over_buying line
sell := sell or (crossunder(k, d) and k[1] >= over_buying and d[1] >= over_buying and
not growing(k) and not growing(d) and k <= over_buying)
color = buy ? green : red
bought_price = close
bought_price := nz(bought_price[1])
already_bought = false
already_bought := nz(already_bought[1], false)
//Date Ranges
buy := buy and not already_bought
//d1 = buy ? 400 : 0
//plot(d1+6500, color=white, linewidth = 3, style = stepline)
was_in_middle_zone := (not buy and was_in_middle_zone) or (in_middle_zone(k) and in_middle_zone(d))
already_bought := already_bought[1] or buy
bought_price := buy ? close * (1 - threshold_sl_perc/100) : bought_price[1]
trigger_SL = close < bought_price[0]
sell := sell or trigger_SL
sell := sell and
already_bought and not buy and (was_in_middle_zone or trigger_SL)
//plot((sell?400:0)+5200, title="Buy-Sell", color=yellow, linewidth = 3, style = stepline)
already_bought := already_bought[0] and not sell
bought_price := sell ? 0 : bought_price[0]
//plot((was_in_middle_zone?400:0)+5200, title="Buy-Sell", color=yellow, linewidth = 3, style = stepline)
was_in_middle_zone := not sell and was_in_middle_zone
//Plot signals
plot(fast_ema, title="Fast EMA", color=red, linewidth = 4)
plot(slow_ema, title="Slow EMA", color=blue, linewidth = 4)
plot(trend_ema, title="Trend EMA", color=yellow, linewidth = 4)
//Stop Loss
plot(bought_price, color=gray, linewidth=2, style=cross, join=true, title="Stop Loss")
//Y = stepsignal ? lowest(40) : na
//Y = steps_base
//plot(mysignal+Y, title="Steps", color=white, linewidth = 3, style = stepline)
//Unit steps - for debugging
//plot(mysteps+Y, title="Steps2", color=yellow, linewidth = 3, style = stepline)
//Bought or not - for debugging
//plot((already_bought?400:0)+5200, title="Buy-Sell", color=yellow, linewidth = 3, style = stepline)
//plot((sell?400:0)+5200, title="Buy-Sell", color=yellow, linewidth = 3, style = stepline)
plotshape(buy, title="Buy arrows", style=shape.arrowup, location=location.belowbar, color=color, text="Buy", textcolor=color, size=size.huge, transp=30)
plotshape(sell, title="Sell arrows", style=shape.arrowdown, location=location.abovebar, color=color, text="Sell", textcolor=color, size=size.huge, transp=30)
//if n>2000
strategy.entry("buy", strategy.long, when=buy)
strategy.close_all(when=sell)
//plot(strategy.equity, title="Equity", color=white, linewidth = 4, style = line)
//AlertS trigger
//msg = "[SW Magic Signals EMA] BUY/SELL Signal has been triggered." + "(" + tostring(fastema) + ", " + tostring(slowema) + ") on " + tickerid + ", " + period + "."
msg = "SW SVE BUY/SELL Signal has been triggered. (#, #) on EXCH:PAIR, period: #."
alertcondition(buy or sell, title="SW SVE (BUY/SELL SIGNAL)", message=msg)
alertcondition(buy, title="SW SVE (BUY SIGNAL)", message=msg)
alertcondition(sell, title="SW SVE (SELL SIGNAL)", message=msg)