
यह रणनीति दोहरी ALMA मूविंग एवरेज पर आधारित है, जो MACD इंडिकेटर के बहु-अवकाश संकेतों के साथ संयुक्त है। यह रणनीति 4 घंटे या उससे अधिक समय की अवधि के लिए लागू है। परीक्षण डेटा BNB/USDT है, समय अवधि 2017 से अब तक है, प्रभार 0.03% है।
रणनीति ALMA तेज और धीमी रेखाओं का उपयोग करके एक दोहरी चलती औसत का निर्माण करती है। तेज रेखाओं की लंबाई 20 है, धीमी रेखाओं की लंबाई 40 है, प्रत्येक में 0.9 का विचलन है, मानक अंतर 5 है। जब तेज लाइन धीमी रेखा से गुजरती है तो एक मल्टी सिग्नल उत्पन्न होता है, और जब तेज लाइन धीमी रेखा से गुजरती है तो एक रिक्त सिग्नल उत्पन्न होती है।
उसी समय, रणनीति MACD सूचक के साथ एक रेखाचित्र संकेत जोड़ती है. एक अधिक संकेत केवल तभी काम करता है जब MACD रेखाचित्र सकारात्मक है (ऊपर) और एक शून्य संकेत केवल तभी काम करता है जब MACD रेखाचित्र नकारात्मक है (नीचे) ।
इस रणनीति में एक साथ स्टॉप-स्टॉप की शर्तें सेट की गई हैं। ओवरस्टॉप 2 गुना, स्टॉप-स्टॉप 0.2 गुना; ओपन-स्टॉप 0.05 गुना, स्टॉप-स्टॉप 1 गुना।
यह रणनीति दोहरी चलती औसत के रुझान निर्णय और MACD सूचक के ऊर्जा निर्णय के साथ संयुक्त है, जो झूठे संकेतों को प्रभावी ढंग से फ़िल्टर करने और प्रवेश की सटीकता में सुधार करने में मदद करता है। स्टॉप-स्टॉप-लॉस सेटिंग्स उचित हैं, लाभ को अधिकतम करने के लिए, बड़े नुकसान से बचें।
2017 के बाद से अपनाए गए रिटर्न्स डेटा में कई बैल-बियर रूपांतरण शामिल हैं, रणनीति क्रॉस-आवर्ती परिस्थितियों में अच्छा प्रदर्शन करती है। यह रणनीति को बाजार की रैखिक और गैर-रैखिक विशेषताओं के अनुकूल साबित करती है।
इस रणनीति में निम्नलिखित जोखिम हैं:
समाधान:
इस रणनीति को निम्नलिखित पहलुओं से भी अनुकूलित किया जा सकता हैः
इस रणनीति को चलती औसत की प्रवृत्ति निर्णय और MACD के सहायक निर्णय के साथ सफलतापूर्वक जोड़ा गया है, और उचित स्टॉप-लॉस सेट किया गया है, जो कई स्थितियों में स्थिर लाभ प्राप्त करने में सक्षम है। निरंतर अनुकूलन पैरामीटर सेटिंग, अतिरिक्त फ़िल्टर शर्तों को जोड़ने जैसे तरीकों से रणनीति की स्थिरता और लाभप्रदता को और बढ़ाया जा सकता है।
/*backtest
start: 2023-11-04 00:00:00
end: 2023-12-04 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/
// © exlux99
//@version=4
strategy(title = "Full Crypto Swing Strategy ALMA Cross", overlay = true, pyramiding=1,initial_capital = 1, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0.03)
//time condition
fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
fromYear = input(defval = 2010, title = "From Year", minval = 1970)
//monday and session
// To Date Inputs
toDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)
toMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)
toYear = input(defval = 2031, title = "To Year", minval = 1970)
startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)
finishDate = timestamp(toYear, toMonth, toDay, 00, 00)
time_cond = time >= startDate and time <= finishDate
UseHAcandles = input(false, title="Use Heikin Ashi Candles in Algo Calculations")
haClose = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, close) : close
haOpen = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, open) : open
haHigh = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, high) : high
haLow = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, low) : low
//alma fast and slow
src = haClose
windowsize = input(title="Length Size Fast", type=input.integer, defval=20)
windowsize2 = input(title="Length Size Slow", type=input.integer, defval=40)
offset = input(title="Offset", type=input.float, defval=0.9, step=0.05)
sigma = input(title="Sigma", type=input.float, defval=5)
outfast=alma(src, windowsize, offset, sigma)
outslow=alma(src, windowsize2, offset, sigma)
//macd
fast_length = input(title="Fast Length", type=input.integer, defval=6)
slow_length = input(title="Slow Length", type=input.integer, defval=25)
signal_length = input(title="Signal Smoothing", type=input.integer, minval = 1, maxval = 50, defval = 9)
// Calculating
fast_ma = ema(src, fast_length)
slow_ma = ema(src, slow_length)
macd = fast_ma - slow_ma
signal = ema(macd, signal_length)
hist = macd - signal
long=crossover(outfast,outslow) and hist > hist[1] and time_cond
short=crossunder(outfast,outslow) and hist < hist[1] and time_cond
takeProfit_long=input(2.0, step=0.005)
stopLoss_long=input(0.2, step=0.005)
takeProfit_short=input(0.05, step=0.005)
stopLoss_short=input(1.0, step=0.005)
strategy.entry("long",1,when=long)
strategy.entry("short",0,when=short)
strategy.exit("short_tp/sl", "long", profit=close * takeProfit_long / syminfo.mintick, loss=close * stopLoss_long / syminfo.mintick, comment='LONG EXIT', alert_message = 'closeshort')
strategy.exit("short_tp/sl", "short", profit=close * takeProfit_short / syminfo.mintick, loss=close * stopLoss_short / syminfo.mintick, comment='SHORT EXIT', alert_message = 'closeshort')