
“Z-ভিত্তিক ট্রেন্ড ট্র্যাকিং কৌশল” Z-ভিত্তিক ট্রেন্ড ট্র্যাকিং কৌশলটি একটি পরিসংখ্যানগত সূচককে ব্যবহার করে, যা মূল্যের চলমান গড় থেকে বিচ্যুতির মাত্রা পরিমাপ করে এবং স্ট্যান্ডার্ড ডিভেরিয়েন্সকে একটি একীকরণ স্কেল হিসাবে ব্যবহার করে ট্রেন্ডিং সুযোগগুলি ধরার জন্য। এই কৌশলটি তার সরলতা এবং কার্যকারিতার জন্য বিশেষভাবে পরিচিত, বিশেষত এমন বাজারে যেখানে দামের আন্দোলন প্রায়শই সমতুল্য হয়। একাধিক সূচকের উপর নির্ভরশীল জটিল সিস্টেমের বিপরীতে, “Z-ভিত্তিক ট্রেন্ডিং কৌশল” স্পষ্ট, পরিসংখ্যানগতভাবে উল্লেখযোগ্য মূল্য পরিবর্তনের উপর দৃষ্টি নিবদ্ধ করে, যা সহজ, ডেটা-চালিত পদ্ধতির ব্যবসায়ীদের পক্ষে উপযুক্ত।
এই কৌশলটির কেন্দ্রবিন্দু হল Z-এর গণনা। Z-এর মানটি বর্তমান মূল্যের সাথে ব্যবহারকারীর সংজ্ঞায়িত দৈর্ঘ্যের মূল্য সূচকের চলমান গড় (EMA) এর পার্থক্য গণনা করে এবং একই দৈর্ঘ্যের মূল্যের মানদণ্ড দ্বারা বিভক্ত করা হয়ঃ
z = (x - μ) / σ
এর মধ্যে, x হল বর্তমান মূল্য, μ হল EMA গড়, এবং σ হল স্ট্যান্ডার্ড ডিফারেনশিয়াল।
ট্রেডিং সিগন্যাল তৈরি করা হয় Z-এর উপর ভিত্তি করে যা নির্ধারিত থ্রেশহোল্ড অতিক্রম করেঃ
উপরোক্ত ঝুঁকিগুলি ক্রমাগত বাজার বিশ্লেষণ, প্যারামিটার অপ্টিমাইজেশান এবং পর্যালোচনার ভিত্তিতে সতর্কতার সাথে পরিচালনা, নিয়ন্ত্রণ এবং প্রশমিত করা যেতে পারে।
“জেড-ভিত্তিক প্রবণতা ট্র্যাকিং কৌশল” এর সংক্ষিপ্ত, স্থিতিশীল এবং নমনীয় বৈশিষ্ট্যগুলি ট্রেন্ডিং সুযোগগুলি ধরার জন্য একটি অনন্য দৃষ্টিভঙ্গি সরবরাহ করে। যুক্তিসঙ্গত প্যারামিটার সেট, বিচক্ষণ ঝুঁকি ব্যবস্থাপনা এবং ক্রমাগত অপ্টিমাইজেশনের মাধ্যমে, এই কৌশলটি পরিমাণগত ব্যবসায়ীদের একটি শক্তিশালী সহায়ক হওয়ার সম্ভাবনা রয়েছে।
/*backtest
start: 2023-04-23 00:00:00
end: 2024-04-28 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © PresentTrading
// This strategy employs a statistical approach by using a Z-score, which measures the deviation of the price from its moving average normalized by the standard deviation.
// Very simple and effective approach
//@version=5
strategy('Price Based Z-Trend - strategy [presentTrading]',shorttitle = 'Price Based Z-Trend - strategy [presentTrading]', overlay=false, precision=3,
commission_value=0.1, commission_type=strategy.commission.percent, slippage=1,
currency=currency.USD, default_qty_type=strategy.percent_of_equity, default_qty_value=10, initial_capital=10000)
// User-definable parameters for the Z-score calculation and bar coloring
tradeDirection = input.string("Both", "Trading Direction", options=["Long", "Short", "Both"]) // User selects trading direction
priceDeviationLength = input.int(100, "Standard Deviation Length", step=1) // Length for standard deviation calculation
priceAverageLength = input.int(100, "Average Length", step=1) // Length for moving average calculation
Threshold = input.float(1, "Threshold", step=0.1) // Number of standard deviations for Z-score threshold
priceBar = input(title='Bar Color', defval=true) // Toggle for coloring price bars based on Z-score
// Z-score calculation based on user input for the price source (typically the closing price)
priceSource = input(close, title="Source")
priceZScore = (priceSource - ta.ema(priceSource, priceAverageLength)) / ta.stdev(priceSource, priceDeviationLength) // Z-score calculation
// Conditions for entering and exiting trades based on Z-score crossovers
priceLongCondition = ta.crossover(priceZScore, Threshold) // Condition to enter long positions
priceExitLongCondition = ta.crossunder(priceZScore, -Threshold) // Condition to exit long positions
longEntryCondition = ta.crossover(priceZScore, Threshold)
longExitCondition = ta.crossunder(priceZScore, -Threshold)
shortEntryCondition = ta.crossunder(priceZScore, -Threshold)
shortExitCondition = ta.crossover(priceZScore, Threshold)
// Strategy conditions and execution based on Z-score crossovers and trading direction
if (tradeDirection == "Long" or tradeDirection == "Both") and longEntryCondition
strategy.entry("Long", strategy.long) // Enter a long position
if (tradeDirection == "Long" or tradeDirection == "Both") and longExitCondition
strategy.close("Long") // Close the long position
if (tradeDirection == "Short" or tradeDirection == "Both") and shortEntryCondition
strategy.entry("Short", strategy.short) // Enter a short position
if (tradeDirection == "Short" or tradeDirection == "Both") and shortExitCondition
strategy.close("Short") // Close the short position
// Dynamic Thresholds Visualization using 'plot'
plot(Threshold, "Dynamic Entry Threshold", color=color.new(color.green, 50))
plot(-Threshold, "Dynamic Short Entry Threshold", color=color.new(color.red, 50))
// Color-coding Z-Score
priceZScoreColor = priceZScore > Threshold ? color.green :
priceZScore < -Threshold ? color.red : color.blue
plot(priceZScore, "Z-Score", color=priceZScoreColor)
// Lines
hline(0, color=color.rgb(255, 255, 255, 50), linestyle=hline.style_dotted)
// Bar Color
priceBarColor = priceZScore > Threshold ? color.green :
priceZScore > 0 ? color.lime :
priceZScore < Threshold ? color.maroon :
priceZScore < 0 ? color.red : color.black
barcolor(priceBar ? priceBarColor : na)