
यह रणनीति एक मात्रात्मक ट्रेडिंग प्रणाली है जिसमें एक त्वरित अस्थिरता संकेतक (AC) और एक यादृच्छिक संकेतक (Stochastic) शामिल है। यह मूल्य और तकनीकी संकेतक के बीच विचलन की पहचान करके बाजार की गतिशीलता में बदलाव को पकड़ता है, जिससे संभावित रुझानों का पूर्वानुमान लगाया जा सकता है। यह रणनीति संकेत की विश्वसनीयता बढ़ाने के लिए समानांतर (SMA) और अपेक्षाकृत कमजोर संकेतक (RSI) को भी एकीकृत करती है, और जोखिम को नियंत्रित करने के लिए एक निश्चित स्टॉप-लॉस सेट करती है।
रणनीति का मुख्य तर्क कई तकनीकी संकेतकों के सह-संयोजन पर आधारित है। सबसे पहले, त्वरित अस्थिरता सूचक ((AC) की गणना की जाती है, जो कि 5 चक्र और 34 चक्र के औसत मूल्य के अंतर के माध्यम से प्राप्त किया जाता है, और फिर इसके एन चक्र के औसत को घटा दिया जाता है। साथ ही, यादृच्छिक संकेतकों के K और D मानों की गणना की जाती है, जो कि पीछे हटने के संकेतों की पुष्टि करने के लिए उपयोग किए जाते हैं। जब कीमत कम होती है और एसी सूचक उच्च होता है, तो एक bullish पीछे हटने का गठन होता है; जब कीमत अधिक होती है और एसी सूचक कम होता है, तो एक bullish पीछे हटने का गठन होता है।
यह एक क्वांटिटेटिव ट्रेडिंग रणनीति है जिसमें कई तकनीकी संकेतकों को मिलाया गया है, जो सिग्नल से विचलित होकर बाजार के मोड़ को पकड़ने के लिए है। रणनीति का लाभ कई संकेतकों के क्रॉस-वैलिडेशन और एक अच्छी तरह से विकसित जोखिम नियंत्रण प्रणाली में है, लेकिन यह भी ध्यान रखना है कि झूठे ब्रेकआउट और पैरामीटर अनुकूलन जैसे मुद्दों को ध्यान में रखा जाना चाहिए। निरंतर अनुकूलन और सुधार के माध्यम से, रणनीति को विभिन्न बाजार स्थितियों में स्थिर प्रदर्शन बनाए रखने की उम्मीद है।
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
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/
// © JayQwae
//@version=5
strategy("Enhanced AC Divergence Strategy with Stochastic Divergence", overlay=true)
// Input settings
tp_pips = input.float(0.0020, "Take Profit (in price)", step=0.0001)
sl_pips = input.float(0.0040, "Stop Loss (in price)", step=0.0001) // 40 pips
ac_length = input.int(5, "AC Length")
rsi_length = input.int(14, "RSI Length")
stoch_k = input.int(14, "Stochastic K Length")
stoch_d = input.int(3, "Stochastic D Smoothing")
stoch_ob = input.float(80, "Stochastic Overbought Level")
stoch_os = input.float(20, "Stochastic Oversold Level")
// Accelerator Oscillator Calculation
high_low_mid = (high + low) / 2
ao = ta.sma(high_low_mid, 5) - ta.sma(high_low_mid, 34)
ac = ao - ta.sma(ao, ac_length)
// RSI Calculation
rsi = ta.rsi(close, rsi_length)
// Stochastic Oscillator Calculation
k = ta.sma(ta.stoch(close, high, low, stoch_k), stoch_d)
d = ta.sma(k, stoch_d)
// Stochastic Divergence Detection
stoch_bull_div = ta.lowest(close, 5) < ta.lowest(close[1], 5) and ta.lowest(k, 5) > ta.lowest(k[1], 5)
stoch_bear_div = ta.highest(close, 5) > ta.highest(close[1], 5) and ta.highest(k, 5) < ta.highest(k[1], 5)
// Main Divergence Detection
bullish_div = ta.lowest(close, 5) < ta.lowest(close[1], 5) and ac > ac[1] and stoch_bull_div
bearish_div = ta.highest(close, 5) > ta.highest(close[1], 5) and ac < ac[1] and stoch_bear_div
// Plot divergences
plotshape(bullish_div, title="Bullish Divergence", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(bearish_div, title="Bearish Divergence", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Strategy rules
if (bullish_div)
strategy.entry("Buy", strategy.long)
strategy.exit("Take Profit/Stop Loss", "Buy", limit=close + tp_pips, stop=close - sl_pips)
if (bearish_div)
strategy.entry("Sell", strategy.short)
strategy.exit("Take Profit/Stop Loss", "Sell", limit=close - tp_pips, stop=close + sl_pips)
// Alerts
if (bullish_div)
alert("Bullish Divergence detected! Potential Buy Opportunity", alert.freq_once_per_bar)
if (bearish_div)
alert("Bearish Divergence detected! Potential Sell Opportunity", alert.freq_once_per_bar)