
इस रणनीति का उपयोग करने के लिए कीमतों की गतिशीलता की दिशा का आकलन करने के लिए औसत रेखा का उपयोग करें, गोल्डन फोर्क और डेड फोर्क के साथ समग्र प्रवृत्ति का आकलन करने के लिए, प्रवृत्ति का पालन करें।
यह रणनीति ईएमए और एसएमए के दो समान रेखाओं के क्रॉसिंग का उपयोग करती है ताकि कीमतों की गतिशीलता की दिशा का पता लगाया जा सके, ईएमए तेजी से प्रतिक्रिया करता है, और एसएमए अधिक स्थिर प्रतिक्रिया करता है। जब ईएमए पर एसएमए के माध्यम से कीमतों में वृद्धि की गति मजबूत होती है, तो अधिक करें; जब ईएमए नीचे एसएमए के माध्यम से कीमतों में गिरावट की गति मजबूत होती है, तो खाली करें।
इसके अलावा, यह रणनीति तेजी से चक्र एसएमए और धीमी गति से चक्र एसएमए के क्रॉसिंग का उपयोग करती है ताकि समग्र रुझान की दिशा का पता लगाया जा सके। जब तेजी से एसएमए पर धीमी गति से एसएमए को पार करना गोल्ड फोर्क होता है, तो यह माना जाता है कि व्यापार लंबी अवधि के ऊपर की ओर है; जब तेजी से एसएमए नीचे धीमी गति से एसएमए को पार करता है, तो यह मृत फोर्क होता है, यह माना जाता है कि व्यापार लंबी अवधि के नीचे की ओर है।
रणनीति को ईएमए पर एसएमए पार करने के लिए अधिक अवसर के रूप में माना जाता है। यदि यह गोल्ड फोर्क है, तो यह दर्शाता है कि न केवल अल्पकालिक गतिशील समर्थन है, बल्कि यह दीर्घकालिक प्रवृत्ति के अनुरूप भी है, यह एक अच्छा समय है; यदि यह डेड फोर्क है, तो यह दर्शाता है कि केवल अल्पकालिक गतिशील समर्थन है, जो दीर्घकालिक प्रवृत्ति के अनुरूप नहीं है, यह अधिक जोखिम भरा समय है।
अन्य संकेतकों के साथ संयोजन द्वारा संकेत की पुष्टि, औसत रेखा चक्र पैरामीटर का अनुकूलन, या स्टॉप लॉस सेट करके जोखिम को कम किया जा सकता है
इस रणनीति के लिए कुल मिलाकर एक अधिक स्थिर और विश्वसनीय प्रवृत्ति ट्रैकिंग रणनीति है. यह एक ही समय में अल्पकालिक मूल्य आंदोलन और लंबी अवधि की प्रवृत्ति की दिशा पर विचार करता है, औसत रेखा को पार करके व्यापार संकेतों का निर्माण करता है. एक एकल औसत रेखा रणनीति की तुलना में, यह दोहरी सूचक पुष्टि के साथ संयुक्त है, और उच्च विश्वसनीयता है. लेकिन एक प्रवृत्ति ट्रैकिंग रणनीति के रूप में, इसके पैरामीटर अनुकूलन और जोखिम नियंत्रण बहुत महत्वपूर्ण है, और रणनीति को वास्तव में प्रभावी बनाने के लिए बार-बार परीक्षण और समायोजन की आवश्यकता होती है। निरंतर अनुकूलन और सुधार के साथ, यह रणनीति एक पोर्टफोलियो का हिस्सा बन सकती है जो लंबे समय तक रखने लायक है।
/*backtest
start: 2023-09-19 00:00:00
end: 2023-10-19 00:00:00
period: 1h
basePeriod: 15m
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/
// © Cryptoluc1d
//@version=4
strategy("Equal-Length EMA/SMA Crossover Strategy", initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=25, commission_type=strategy.commission.percent, commission_value=0.2, overlay=true)
// Create inputs
mom_length = input(title="Momentum Length (EMA=SMA)", defval=50)
bias_length_fast = input(title="Golden Cross Length (Fast)", defval=50)
bias_length_slow = input(title="Golden Cross Length (Slow)", defval=100)
// Define MAs
ema = ema(close, mom_length) // EMA/SMA crossover of the same period for detecting trend acceleration/deceleration
sma = sma(close, mom_length)
bias_fast = sma(close, bias_length_fast) // golden/death cross for overall trend bias
bias_slow = sma(close, bias_length_slow)
// Define signal conditions
buy_trend = crossover(ema, sma) and bias_fast >= bias_slow // buy when EMA cross above SMA. if this happens during a bullish golden cross, buying is in confluence with the overall trend (bias).
buy_risky = crossover(ema, sma) and bias_fast < bias_slow // buy when EMA cross above SMA. if this happens during a bearish death cross, buying is early, more risky, and not in confluence with the overall trend (bias).
buy_late = crossover(sma, bias_slow) and ema > sma // the SMA crossing the Slow_SMA gives further confirmation of bullish trend, but signal comes later.
sell = crossunder(ema, sma) // sell when EMA cross under SMA.
// Enable option to hide signals, then plot signals
show_signal = input(title="Show Signals", defval=true)
plotshape(show_signal ? buy_trend : na, title='Trend Buy', style=shape.triangleup, location=location.belowbar, color=color.green, text='TREND BUY')
plotshape(show_signal ? buy_risky : na, title='Risky Buy', style=shape.triangleup, location=location.belowbar, color=color.olive, text='RISKY BUY')
plotshape(show_signal ? buy_late : na, title='Late Buy', style=shape.triangleup, location=location.belowbar, color=color.lime, text='LATE BUY')
plotshape(show_signal ? sell : na, title='Sell', style=shape.triangledown, location=location.abovebar, color=color.red, text='SELL')
// Define entry and exit conditions
longCondition = ema > sma and bias_fast >= bias_slow // LONG when EMA above SMA, and overall trend bias is bullish
if (longCondition)
strategy.entry("BUY TREND", strategy.long)
exitLong = crossunder(ema, sma) // close LONG when EMA cross under SMA
strategy.close("BUY TREND", when=exitLong)
// // short conditions. turned off because up only.
// shortCondition = ema < sma and bias_fast <= bias_slow // SHORT when EMA under SMA, and overall trend bias is bearish
// if (shortCondition)
// strategy.entry("SELL TREND", strategy.short)
// exitShort = crossover(ema, sma) // close SHORT when EMA cross over SMA
// strategy.close("SELL TREND", when=exitShort)
// Enable option to show MAs, then plot MAs
show_ma = input(title="Show MAs", defval=false)
plot(show_ma ? ema : na, title="Momentum EMA", color=color.green, linewidth=1)
plot(show_ma ? sma : na, title="Momentum SMA", color=color.yellow, linewidth=1)
plot(show_ma ? bias_fast : na, title="Golden Cross SMA (Fast)", color=color.orange, linewidth=2)
plot(show_ma ? bias_slow : na, title="Golden Cross SMA (Slow)", color=color.red, linewidth=2)