सीसीआई औसत रिवर्सन चैनल रणनीति

लेखक:चाओझांग, दिनांक: 2023-11-01 16:20:45
टैगः

img

अवलोकन

इस रणनीति को CCI संकेतक पर आधारित एक लचीली प्रवृत्ति के बाद ट्रेडिंग प्रणाली के रूप में डिज़ाइन किया गया है। यह CCI शून्य रेखा क्रॉसओवर या कस्टम ऊपरी / निचले बैंड क्रॉस के आधार पर ट्रेडिंग सिग्नल उत्पन्न कर सकता है। रणनीति निश्चित स्टॉप लॉस और ले लाभ अनुपात, विशिष्ट समय सीमाओं में व्यापार, और अधिक सेट करने की अनुमति देती है।

रणनीति तर्क

  1. बाजार के रुझानों को निर्धारित करने के लिए सीसीआई शून्य रेखा क्रॉसओवर का उपयोग करें। सीसीआई शून्य से ऊपर पार करना एक तेजी का संकेत है और नीचे पार करना एक मंदी का संकेत है।

  2. कस्टम सीसीआई ऊपरी और निचले बैंड सेट करें। ऊपरी बैंड के ऊपर सीसीआई क्रॉसिंग तेजी है और निचले बैंड के नीचे क्रॉसिंग मंदी है। बैंड क्रॉसओवर स्टॉप के रूप में कार्य करते हैं।

  3. केवल विशिष्ट समय सीमाओं में व्यापार करने और उन अवधि के बाहर सभी पदों को बंद करने का विकल्प। निश्चित दैनिक समय सीमाओं में भी व्यापार कर सकते हैं।

  4. निश्चित स्टॉप लॉस सेट करें और लाभ प्रतिशत लें।

  5. प्रवेश और निकास संकेतों के लिए अनुकूलन योग्य चेतावनी संदेश।

  6. समायोज्य सीसीआई पैरामीटर, बैंड, स्टॉप आदि के साथ अत्यधिक अनुकूलन योग्य रणनीति

लाभ विश्लेषण

  1. सीसीआई मूल्य परिवर्तनों के प्रति संवेदनशील है, यह रुझानों के उलटने को पकड़ने के लिए अच्छा है।

  2. विभिन्न बाजारों के लिए कस्टम बैंड को समायोजित किया जा सकता है। बैंड क्रॉस स्टॉप जोखिम को नियंत्रित करने में मदद करते हैं।

  3. विशेषताओं के आधार पर अनुकूलित मापदंडों के साथ विभिन्न समय सीमाओं में व्यापार का समर्थन करना।

  4. फिक्स्ड स्टॉप लॉस/टेक प्रॉफिट पूर्व निर्धारित जोखिम/इनाम अनुपात और सीमा जोखिम।

  5. पूरी तरह से अनुकूलन योग्य मापदंड विभिन्न उत्पादों और बाजार स्थितियों के लिए रणनीति का अनुकूलन करते हैं।

जोखिम विश्लेषण

  1. सीसीआई को झूठे संकेतों के प्रति प्रवण होने पर अधिक समय सीमा वाले संकेतों का सत्यापन करना चाहिए।

  2. फिक्स्ड स्टॉप/टेक प्रतिशत बदलती बाजार स्थितियों के अनुकूल नहीं हो सकते।

  3. निश्चित समय सीमाओं में व्यापार करने से सीमा अवधि के दौरान अवसरों को खोने का जोखिम होता है।

  4. बार-बार पैरामीटर अनुकूलन से ओवर-ट्रेडिंग या मिसिंग ट्रेडिंग हो सकती है।

  5. मैक्रो कारकों पर विचार किया जाना चाहिए, जोखिमों को समाप्त करने के लिए अकेले अनुकूलन पर्याप्त नहीं है।

अनुकूलन दिशाएँ

  1. सीसीआई संकेतों को सत्यापित करने के लिए अधिक समय सीमा के संकेतक जोड़ें।

  2. एटीआर जैसे गतिशील स्टॉप/टेक शामिल करें।

  3. विभिन्न समय सीमाओं में मापदंडों का परीक्षण करें और उच्च दक्षता की अवधि का पता लगाएं।

  4. बदलते बाजारों के लिए सीसीआई मापदंडों और बैंड को अनुकूलित करना।

  5. अन्य कारकों जैसे अस्थिरता और मात्रा को शामिल करने पर विचार करें।

  6. व्यापारित उत्पादों के लिए उपयुक्त समय सीमा का चयन करें।

  7. रणनीति अनुकूलन को स्वचालित करने के लिए मशीन लर्निंग पर विचार करें।

सारांश

कुल मिलाकर यह एक बहुत ही लचीला और अनुकूलन योग्य प्रवृत्ति निम्नलिखित प्रणाली है। प्रमुख लाभ प्रवृत्तियों के लिए सीसीआई का उपयोग करना, जोखिम को सीमित करने के लिए कस्टम बैंड, निश्चित स्टॉप / टेक और समय सीमा चयन हैं। झूठे सीसीआई संकेतों और अस्थिर स्टॉप के लिए देखना आवश्यक है। भविष्य में सुधार मापदंडों को अनुकूलित करने, संकेतों को फ़िल्टर करने, कुशल समय सीमाओं का चयन करने और अधिक सुसंगत अतिरिक्त रिटर्न प्राप्त करने के लिए बाजार परिवर्तनों के लिए स्वचालित अनुकूलन के लिए मशीन लर्निंग को शामिल करने से आ सकता है।


/*backtest
start: 2023-10-01 00:00:00
end: 2023-10-31 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/
// © REV0LUTI0N

//@version=4

strategy(title="CCI Strategy", overlay=true, initial_capital = 10000, default_qty_value = 10000, default_qty_type = strategy.cash)


//CCI Code

length = input(20, minval=1, title="CCI Length")
src = input(close, title="Source")
ma = sma(src, length)
cci = (src - ma) / (0.015 * dev(src, length))


// Strategy Backtesting
startDate  = input(timestamp("2099-10-01T00:00:00"), type = input.time, title='Backtesting Start Date')
finishDate = input(timestamp("9999-12-31T00:00:00"), type = input.time, title='Backtesting End Date')

time_cond  = true


//Time Restriction Settings
startendtime = input("", title='Time Frame To Enter Trades')
enableclose = input(false, title='Enable Close Trade At End Of Time Frame')
timetobuy = true
timetoclose = true


//Strategy Settings

//Strategy Settings - Enable Check Boxes
enableentry = input(true, title="Enter First Trade ASAP")
enableconfirmation = input(false, title="Wait For Cross To Enter First Trade")
enablezero =input(true, title="Use CCI Simple Cross Line For Entries & Exits")
enablebands = input(false, title="Use Upper & Lower Bands For Entries & Exits")

//Strategy Settings - Band Sources
ccisource = input(0, title="CCI Simple Cross")
upperbandsource =input(100, title="CCI Enter Long Band")
upperbandexitsource =input(100, title="CCI Exit Long Band")
lowerbandsource =input(-100, title="CCI Enter Short Band")
lowerbandexitsource =input(-100, title="CCI Exit Short Band")

//Strategy Settings - Crosses
simplecrossup = crossover(cci, ccisource)
simplecrossdown = crossunder(cci, ccisource)
uppercrossup = crossover(cci, upperbandsource)
lowercrossdown = crossunder(cci, lowerbandsource)
uppercrossdown = crossunder(cci, upperbandexitsource)
lowercrossup = crossover(cci, lowerbandexitsource)
upperstop = crossunder(cci, upperbandsource)
lowerstop = crossover(cci, lowerbandsource)


// Stop Loss & Take Profit % Based
enablesl = input(false, title='Enable Stop Loss')
enabletp = input(false, title='Enable Take Profit')
stopTick = input(5.0, title='Stop Loss %', type=input.float, step=0.1) / 100
takeTick = input(10.0, title='Take Profit %', type=input.float, step=0.1) / 100

longStop = strategy.position_avg_price * (1 - stopTick)
shortStop = strategy.position_avg_price * (1 + stopTick)
shortTake = strategy.position_avg_price * (1 - takeTick)
longTake = strategy.position_avg_price * (1 + takeTick)

plot(strategy.position_size > 0 and enablesl ? longStop : na, style=plot.style_linebr, color=color.red, linewidth=1, title="Long Fixed SL")
plot(strategy.position_size < 0 and enablesl ? shortStop : na, style=plot.style_linebr, color=color.red, linewidth=1, title="Short Fixed SL")
plot(strategy.position_size > 0 and enabletp ? longTake : na, style=plot.style_linebr, color=color.green, linewidth=1, title="Long Take Profit")
plot(strategy.position_size < 0 and enabletp ? shortTake : na, style=plot.style_linebr, color=color.green, linewidth=1, title="Short Take Profit")


// Alert messages
message_enterlong  = input("", title="Long Entry message")
message_entershort = input("", title="Short Entry message")
message_closelong = input("", title="Close Long message")
message_closeshort = input("", title="Close Short message")
    

//Strategy Execution

//Strategy Execution - Simple Line Cross
if (cci > ccisource and enablezero and enableentry and time_cond and timetobuy)
    strategy.entry("Long", strategy.long, alert_message = message_enterlong)
if (cci < ccisource and enablezero and enableentry and time_cond and timetobuy)
    strategy.entry("Short", strategy.short, alert_message = message_entershort)

if (simplecrossup and enablezero and enableconfirmation and time_cond and timetobuy)
    strategy.entry("Long", strategy.long, alert_message = message_enterlong)
if (simplecrossdown and enablezero and enableconfirmation and time_cond and timetobuy)
    strategy.entry("Short", strategy.short, alert_message = message_entershort)

//Strategy Execution - Upper and Lower Band Entry
if (uppercrossup and enablebands and time_cond and timetobuy)
    strategy.entry("Long", strategy.long, alert_message = message_enterlong)
if (lowercrossdown and enablebands and time_cond and timetobuy)
    strategy.entry("Short", strategy.short, alert_message = message_entershort)

//Strategy Execution - Upper and Lower Band Exit
if strategy.position_size > 0 and uppercrossdown and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closelong)
if strategy.position_size < 0 and lowercrossup and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closeshort)

//Strategy Execution - Upper and Lower Band Stops
if strategy.position_size > 0 and upperstop and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closelong)
if strategy.position_size < 0 and lowerstop and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closeshort)

//Strategy Execution - Close Trade At End Of Time Frame    
if strategy.position_size > 0 and timetoclose and enableclose and time_cond
    strategy.close_all(alert_message = message_closelong)
if strategy.position_size < 0 and timetoclose and enableclose and time_cond
    strategy.close_all(alert_message = message_closeshort)

//Strategy Execution - Stop Loss and Take Profit
if strategy.position_size > 0 and enablesl and time_cond
    strategy.exit(id="Close Long", stop=longStop, limit=longTake, alert_message = message_closelong)
if strategy.position_size < 0 and enablesl and time_cond
    strategy.exit(id="Close Short", stop=shortStop, limit=shortTake, alert_message = message_closeshort)
    
if strategy.position_size > 0 and enabletp and time_cond
    strategy.exit(id="Close Long", stop=longStop, limit=longTake, alert_message = message_closelong)
if strategy.position_size < 0 and enabletp and time_cond
    strategy.exit(id="Close Short", stop=shortStop, limit=shortTake, alert_message = message_closeshort)



अधिक