
यह रणनीति मुख्य रूप से एक विशिष्ट के-लाइन पैटर्न - पिन बार की पहचान करके संभावित बाजार उलट बिंदुओं का न्याय करती है। पिन बार एक के-लाइन पैटर्न है जिसमें एक लंबी छाया रेखा और एक छोटी इकाई होती है, जो दर्शाता है कि बाजार में उस बिंदु पर बहुत अधिक उतार-चढ़ाव आया है, लेकिन अंततः कीमत वापस आ गई है, जो दर्शाता है कि यह बिंदु समर्थन या प्रतिरोध हो सकता है। यह रणनीति वर्तमान रुझान की दिशा का आकलन करने के लिए 50 चक्र सरल चलती औसत (एसएमए) का उपयोग करती है, और 20 चक्र एसएमए का उपयोग ट्रेड वॉल्यूम फ़िल्टरिंग शर्त के रूप में करती है, केवल जब पिन बार होता है, तो ट्रेड वॉल्यूम इस औसत रेखा से अधिक होता है।
पिन बार रिवर्स रणनीति सरल और प्रभावी विचारों को अपनाती है, जो प्रवृत्ति फ़िल्टरिंग, लेनदेन की मात्रा फ़िल्टरिंग आदि के माध्यम से संकेत पहचान की सटीकता में सुधार करती है। हालांकि अभी भी कुछ जगहों पर सुधार किया जा सकता है, समग्र विचार व्यवहार्य है और आगे के अनुकूलन परीक्षण के लायक है। पिन बार स्वयं एक क्लासिक मूल्य आकार के रूप में, अन्य संकेतकों या संकेतों के साथ संयोजन में भी इस्तेमाल किया जा सकता है, ताकि एक अधिक मजबूत व्यापार प्रणाली प्राप्त की जा सके।
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Filtered Pin Bar Strategy with Relaxed Volume", overlay=true)
// Define the size of the pin bar's wick and body
wickSize = 0.6
bodySize = 0.3
// Calculate the size of the wicks and body
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
body = math.abs(close - open)
// Define a simple moving average to determine the trend
smaLength = 50
sma = ta.sma(close, smaLength)
// Define a more relaxed volume threshold
volumeThreshold = ta.sma(volume, 20) * 1.0
// Define RSI parameters
rsiLength = 14
rsiOverbought = 70
rsiOversold = 30
rsi = ta.rsi(close, rsiLength)
// Define the conditions for a bullish pin bar
bullishPinBar = (lowerWick > (wickSize * (high - low))) and
(body < (bodySize * (high - low))) and
(close > open) and
(close > sma) and
(volume > volumeThreshold)
// Define the conditions for a bearish pin bar
bearishPinBar = (upperWick > (wickSize * (high - low))) and
(body < (bodySize * (high - low))) and
(close < open) and
(close < sma) and
(volume > volumeThreshold)
// Plot the bullish and bearish pin bars on the chart
plotshape(series=bullishPinBar, title="Bullish Pin Bar", location=location.belowbar, color=color.green, style=shape.labelup, text="PB")
plotshape(series=bearishPinBar, title="Bearish Pin Bar", location=location.abovebar, color=color.red, style=shape.labeldown, text="PB")
// Entry and exit rules
if (bullishPinBar)
strategy.entry("Bullish Pin Bar", strategy.long)
if (bearishPinBar)
strategy.entry("Bearish Pin Bar", strategy.short)
// Optional: Set stop loss and take profit
stopLoss = 2 * body
takeProfit = 3 * body
strategy.exit("Exit Long", from_entry="Bullish Pin Bar", stop=low - stopLoss, limit=high + takeProfit)
strategy.exit("Exit Short", from_entry="Bearish Pin Bar", stop=high + stopLoss, limit=low - takeProfit)