
यह रणनीति एक बहु-समय अवधि प्रवृत्ति अनुवर्ती प्रणाली है जो चिकनी कैंडलस्टिक्स (हेइकिन-आशी) और घातीय चलती औसत (ईएमए) के क्रॉसओवर पर आधारित है। हेइकिन-आशी कैंडलस्टिक्स की समतल विशेषताओं और विभिन्न समय अवधि में चलती औसत की प्रवृत्ति ट्रैकिंग क्षमता को संयोजित करके, और एमएसीडी सूचक को एक फिल्टर के रूप में उपयोग करके, बाजार के रुझानों को सटीक रूप से पकड़ा जा सकता है। यह रणनीति समय अवधि पदानुक्रमित डिजाइन को अपनाती है, तथा तीन समय अवधियों में संकेत गणना और सत्यापन करती है: 60 मिनट, 180 मिनट और 15 मिनट।
रणनीति के मूल तर्क में निम्नलिखित प्रमुख भाग शामिल हैं:
यह रणनीति एक सम्पूर्ण प्रवृत्ति-अनुसरण ट्रेडिंग प्रणाली बनाने के लिए MACD फिल्टर के साथ संयुक्त रूप से कई समय अवधियों के हेइकिन-आशी और EMA प्रणालियों का उपयोग करती है। रणनीति डिजाइन संकेतों की विश्वसनीयता और प्रणाली की स्थिरता पर पूरी तरह से विचार करता है, और पैरामीटर अनुकूलन और जोखिम नियंत्रण तंत्र में सुधार के माध्यम से विभिन्न बाजार वातावरणों के अनुकूल हो सकता है। रणनीति के मुख्य लाभ सिग्नल की सुगमता और बहु सत्यापन तंत्र में निहित हैं, लेकिन साथ ही, अस्थिर बाजारों और पैरामीटर अनुकूलन मुद्दों के जोखिमों पर भी ध्यान दिया जाना चाहिए।
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 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/
// © tradingbauhaus
//@version=5
strategy("Heikin Ashi Candle Time Frame @tradingbauhaus", shorttitle="Heikin Ashi Candle Time Frame @tradingbauhaus", overlay=true)
// Inputs
res = input.timeframe(title="Heikin Ashi Candle Time Frame", defval="60")
hshift = input.int(1, title="Heikin Ashi Candle Time Frame Shift")
res1 = input.timeframe(title="Heikin Ashi EMA Time Frame", defval="180")
mhshift = input.int(0, title="Heikin Ashi EMA Time Frame Shift")
fama = input.int(1, title="Heikin Ashi EMA Period")
test = input.int(1, title="Heikin Ashi EMA Shift")
sloma = input.int(30, title="Slow EMA Period")
slomas = input.int(1, title="Slow EMA Shift")
macdf = input.bool(false, title="With MACD filter")
res2 = input.timeframe(title="MACD Time Frame", defval="15")
macds = input.int(1, title="MACD Shift")
// Heikin Ashi calculation
var float ha_open = na
ha_close = (open + high + low + close) / 4
ha_open := na(ha_open[1]) ? (open + close) / 2 : (ha_open[1] + ha_close[1]) / 2
ha_high = math.max(high, math.max(ha_open, ha_close))
ha_low = math.min(low, math.min(ha_open, ha_close))
// Adjusted Heikin Ashi Close for different timeframes
mha_close = request.security(syminfo.tickerid, res1, ha_close[mhshift])
// MACD calculation
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
macdl = request.security(syminfo.tickerid, res2, macdLine[macds])
macdsl = request.security(syminfo.tickerid, res2, signalLine[macds])
// Moving Averages
fma = ta.ema(mha_close[test], fama)
sma = ta.ema(ha_close[slomas], sloma)
plot(fma, title="Heikin Ashi EMA", color=color.green, linewidth=2)
plot(sma, title="Slow EMA", color=color.red, linewidth=2)
// Strategy Logic
golong = ta.crossover(fma, sma) and (macdl > macdsl or not macdf)
goshort = ta.crossunder(fma, sma) and (macdl < macdsl or not macdf)
// Plot Shapes for Buy/Sell Signals
plotshape(golong, color=color.green, text="Buy", style=shape.triangleup, location=location.belowbar)
plotshape(goshort, color=color.red, text="SELL", style=shape.triangledown, location=location.abovebar)
// Strategy Orders
strategy.entry("Long", strategy.long, when=golong)
strategy.close("Long", when=goshort)
strategy.entry("Short", strategy.short, when=goshort)
strategy.close("Short", when=golong)
// Alerts
alertcondition(golong, "Heikin Ashi BUY", "")
alertcondition(goshort, "Heikin Ashi SELL", "")