चरणबद्ध पिरामिड चलती औसत ब्रेकआउट रणनीति

लेखक:चाओझांग, दिनांकः 2024-02-05 14:09:14
टैगः

img

अवलोकन

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

रणनीति तर्क

  1. वर्तमान पट्टी के बंद मूल्य (बंद) की तुलना पिछले पट्टी के बंद मूल्य (बंद[1]) से करें। यदि बंद > बंद[1], यह एक लंबे अवसर के रूप में निर्धारित किया जाता है और longCondition=1 सेट किया जाता है। यदि बंद < बंद[1], यह एक छोटे अवसर के रूप में निर्धारित किया जाता है और shortCondition=1 सेट किया जाता है।

  2. अनुमत ट्रेडिंग समय सीमा के भीतर, यदि longCondition=1, यह कई क्रमिक प्रविष्टियों के साथ लंबा होगा. यदि shortCondition=1, यह कई क्रमिक प्रविष्टियों के साथ छोटा होगा.

  3. प्रविष्टियों की संख्या पिरामिडिंग पैरामीटर के माध्यम से सेट की जाती है, जिसे 1 से 5 तक कॉन्फ़िगर किया जा सकता है, जिसमें 4 डिफ़ॉल्ट के रूप में है।

  4. बाजार के उलट जाने के मामले में प्रत्येक प्रविष्टि के बाद स्टॉप लॉस की शर्त निर्धारित की जाती है।

  5. ट्रेडिंग सिग्नल को विभिन्न ट्रेडिंग इंटरफेस जैसे टोस्ट या टेलीग्राम पर आउटपुट किया जा सकता है।

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

लाभ विश्लेषण

  1. चरणबद्ध पिरामिडिंग प्रवृत्तियों का बेहतर अनुपालन करती है।

  2. प्रविष्टियों की समायोज्य संख्या इसे अधिक लचीला बनाती है।

  3. स्केलेबिलिटी के लिए विभिन्न ट्रेडिंग इंटरफेस का समर्थन करता है।

  4. जोखिमों को नियंत्रित करने के लिए स्टॉप लॉस तंत्र है।

  5. समय-सीमा फ़िल्टर झूठे संकेतों से बचता है।

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

  1. गलत पैरामीटर सेटिंग्स से अधिक नुकसान हो सकता है।

  2. नेटवर्क समस्याएं समय पर स्टॉप लॉस को रोक सकती हैं।

  3. विभिन्न उत्पादों के लिए मापदंडों को समायोजित करने की आवश्यकता होती है।

  4. मुनाफे में लॉक करने के लिए समय पर स्टॉप लॉस की जरूरत है।

समाधान:

  1. डिफ़ॉल्ट 4 प्रविष्टियाँ उपयुक्त हैं।

  2. नेटवर्क कनेक्टिविटी की जाँच करें.

  3. उत्पाद की विशेषताओं के अनुसार मापदंडों को समायोजित करें।

  4. स्टॉप लॉस स्तर सेट करें.

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

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

  2. विभिन्न उत्पादों में परीक्षण पैरामीटर अनुकूलन परिणाम।

  3. मापदंडों को अनुकूलित करने के लिए मशीन लर्निंग एल्गोरिदम शामिल करें।

  4. जोखिम प्रबंधन तंत्रों को सुदृढ़ करना।

सारांश

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


/*backtest
start: 2024-01-05 00:00:00
end: 2024-02-04 00:00:00
period: 3h
basePeriod: 15m
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/
// © torresbitmex

//@version=5
strategy("torres_strategy_real_test_v1.0", process_orders_on_close=true, overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_value=0.03, calc_on_order_fills=false, pyramiding=4)

in_trade(int start_time, int end_time) =>    
    allowedToTrade = (time>=start_time) and (time<=end_time)
    if barstate.islastconfirmedhistory
        var myLine = line(na)
        line.delete(myLine)
        myLine := line.new(start_time, low, start_time, high, xloc=xloc.bar_time, color = color.rgb(255, 153, 0, 50), width = 3, extend = extend.both, style = line.style_dashed)
    allowedToTrade

// 매매시간세팅
start_time = input(timestamp("31 Jan 2024 00:00 +0900"), title="매매 시작", group='매매 시간세팅')
end_time = input(timestamp("31 Dec 2030 00:00 +0900"), title="매매 종료", group='매매 시간세팅')
start_trade = true
bgcolor(start_trade ? color.new(color.gray, 90)   : color(na))


var bool Alarm_TVExtbot = false
var bool Alarm_Alert = false

bot_mode = input.string(title='봇선택', defval = "POA", options = ["TVEXTBOT", "POA"], group = "봇선택", inline = '1')
if bot_mode == "TVEXTBOT"
    Alarm_TVExtbot := true
else if bot_mode == "POA"
    Alarm_Alert := true
else
    Alarm_TVExtbot := false
    Alarm_Alert := false

// 계정정보
account = input.string(title='계정', defval='아무거나입력', inline='1', group='계정정보')
token = input.string(title='TVExtBot 인증키', defval='', inline='1', group='계정정보')

mul_input = input.float(4, minval=1, maxval=5, step=1, title="분할진입수", group='진입 세팅', inline='1')
// 진입주문메세지입력
buyOrderid = input.string(title='롱 진입1', defval='', group='진입주문 메세지입력', inline='2')
buyOrderid2 = input.string(title='롱 진입2', defval='', group='진입주문 메세지입력', inline='3')
buyOrderid3 = input.string(title='롱 진입3', defval='', group='진입주문 메세지입력', inline='4')
buyOrderid4 = input.string(title='롱 진입4', defval='', group='진입주문 메세지입력', inline='5')
buyOrderid5 = input.string(title='롱 진입5', defval='', group='진입주문 메세지입력', inline='6')
sellOrderid = input.string(title='숏 진입1', defval='', group='진입주문 메세지입력', inline='2')
sellOrderid2 = input.string(title='숏 진입2', defval='', group='진입주문 메세지입력', inline='3')
sellOrderid3 = input.string(title='숏 진입3', defval='', group='진입주문 메세지입력', inline='4')
sellOrderid4 = input.string(title='숏 진입4', defval='', group='진입주문 메세지입력', inline='5')
sellOrderid5 = input.string(title='숏 진입5', defval='', group='진입주문 메세지입력', inline='6')

// 종료주문메세지입력
buycloseOrderid = input.string(title='롱 전체종료', defval='', group='종료주문 메세지입력', inline='1')
sellcloseOrderid = input.string(title='숏 전체종료', defval='', group='종료주문 메세지입력', inline='1')

longCondition = 0, shortCondition = 0

if(close[1] < close)
    longCondition := 1
else
    longCondition := 0
if(close[1] > close)
    shortCondition := 1
else
    shortCondition := 0

if start_trade
    if Alarm_Alert
        if strategy.position_size == 0
            if (longCondition == 1)
                strategy.entry("buy1", strategy.long, alert_message = buyOrderid)

            if (shortCondition == 1)
                strategy.entry("sell1", strategy.short, alert_message = sellOrderid)

        if strategy.position_size > 0
            if (longCondition == 1)
                if (strategy.opentrades == 1) and (mul_input == 2 or mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("buy2", strategy.long, alert_message = buyOrderid2)  
                if (strategy.opentrades == 2) and (mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("buy3", strategy.long, alert_message = buyOrderid3)  
                if (strategy.opentrades == 3) and (mul_input == 4 or mul_input == 5)
                    strategy.entry("buy4", strategy.long, alert_message = buyOrderid4)  
                if (strategy.opentrades == 4) and (mul_input == 5)
                    strategy.entry("buy5", strategy.long, alert_message = buyOrderid5)  

        if strategy.position_size < 0
            if (shortCondition == 1)
                if (strategy.opentrades == 1) and (mul_input == 2 or mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("sell2", strategy.short, alert_message = sellOrderid2)  
                if (strategy.opentrades == 2) and (mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("sell3", strategy.short, alert_message = sellOrderid3)  
                if (strategy.opentrades == 3) and (mul_input == 4 or mul_input == 5)
                    strategy.entry("sell4", strategy.short, alert_message = sellOrderid4)
                if (strategy.opentrades == 4) and (mul_input == 5)
                    strategy.entry("sell5", strategy.short, alert_message = sellOrderid5)

        if (longCondition == 1 and strategy.position_size > 0)
            if mul_input == 1 and strategy.opentrades == 1
                strategy.close_all(comment='롱전체종료', alert_message = buycloseOrderid)
            if mul_input == 2 and strategy.opentrades == 2
                strategy.close_all(comment='롱전체종료', alert_message = buycloseOrderid)
            if mul_input == 3 and strategy.opentrades == 3
                strategy.close_all(comment='롱전체종료', alert_message = buycloseOrderid)
            if mul_input == 4 and strategy.opentrades == 4
                strategy.close_all(comment='롱전체종료', alert_message = buycloseOrderid)
            if mul_input == 5 and strategy.opentrades == 5
                strategy.close_all(comment='롱전체종료', alert_message = buycloseOrderid)
        if (shortCondition == 1 and strategy.position_size < 0)
            if mul_input == 1 and strategy.opentrades == 1
                strategy.close_all(comment='숏전체종료', alert_message = sellcloseOrderid)
            if mul_input == 2 and strategy.opentrades == 2
                strategy.close_all(comment='숏전체종료', alert_message = sellcloseOrderid)
            if mul_input == 3 and strategy.opentrades == 3
                strategy.close_all(comment='숏전체종료', alert_message = sellcloseOrderid)
            if mul_input == 4 and strategy.opentrades == 4
                strategy.close_all(comment='숏전체종료', alert_message = sellcloseOrderid)
            if mul_input == 5 and strategy.opentrades == 5
                strategy.close_all(comment='숏전체종료', alert_message = sellcloseOrderid)
    else if Alarm_TVExtbot
        if strategy.position_size == 0
            if (longCondition == 1)
                strategy.entry("buy1", strategy.long, alert_message = '롱 1차 진입 📈📈 TVM:{"orderid":"' + buyOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')

            if (shortCondition == 1)
                strategy.entry("sell1", strategy.short, alert_message = '숏 1차 진입 📉📉 TVM:{"orderid":"' + sellOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')

        if strategy.position_size > 0
            if (longCondition == 1)
                if (strategy.opentrades == 1) and (mul_input == 2 or mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("buy2", strategy.long, alert_message = '롱 2차 진입 📈📈 TVM:{"orderid":"' + buyOrderid2 + '","memo":"' + account + '","token":"' + token + '"}:MVT')  
                if (strategy.opentrades == 2) and (mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("buy3", strategy.long, alert_message = '롱 3차 진입 📈📈 TVM:{"orderid":"' + buyOrderid3 + '","memo":"' + account + '","token":"' + token + '"}:MVT')  
                if (strategy.opentrades == 3) and (mul_input == 4 or mul_input == 5)
                    strategy.entry("buy4", strategy.long, alert_message = '롱 4차 진입 📈📈 TVM:{"orderid":"' + buyOrderid4 + '","memo":"' + account + '","token":"' + token + '"}:MVT')  
                if (strategy.opentrades == 4) and (mul_input == 5)
                    strategy.entry("buy5", strategy.long, alert_message = '롱 5차 진입 📈📈 TVM:{"orderid":"' + buyOrderid5 + '","memo":"' + account + '","token":"' + token + '"}:MVT') 

        if strategy.position_size < 0
            if (shortCondition == 1)
                if (strategy.opentrades == 1) and (mul_input == 2 or mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("sell2", strategy.short, alert_message = '숏 2차 진입 📉📉 TVM:{"orderid":"' + sellOrderid2 + '","memo":"' + account + '","token":"' + token + '"}:MVT')  
                if (strategy.opentrades == 2) and (mul_input == 3 or mul_input == 4 or mul_input == 5)
                    strategy.entry("sell3", strategy.short, alert_message = '숏 3차 진입 📉📉 TVM:{"orderid":"' + sellOrderid3 + '","memo":"' + account + '","token":"' + token + '"}:MVT')  
                if (strategy.opentrades == 3) and (mul_input == 4 or mul_input == 5)
                    strategy.entry("sell4", strategy.short, alert_message = '숏 4차 진입 📉📉 TVM:{"orderid":"' + sellOrderid4 + '","memo":"' + account + '","token":"' + token + '"}:MVT')
                if (strategy.opentrades == 4) and (mul_input == 5)
                    strategy.entry("sell5", strategy.short, alert_message = '숏 5차 진입 📉📉 TVM:{"orderid":"' + sellOrderid5 + '","memo":"' + account + '","token":"' + token + '"}:MVT')
        
        if (longCondition == 1 and strategy.position_size > 0)
            if mul_input == 1 and strategy.opentrades == 1
                strategy.close_all(comment='롱전체종료', alert_message = '롱 종료 📈⛔TVM:{"orderid":"' + buycloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 2 and strategy.opentrades == 2
                strategy.close_all(comment='롱전체종료', alert_message = '롱 종료 📈⛔TVM:{"orderid":"' + buycloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 3 and strategy.opentrades == 3
                strategy.close_all(comment='롱전체종료', alert_message = '롱 종료 📈⛔TVM:{"orderid":"' + buycloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 4 and strategy.opentrades == 4
                strategy.close_all(comment='롱전체종료', alert_message = '롱 종료 📈⛔TVM:{"orderid":"' + buycloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 5 and strategy.opentrades == 5
                strategy.close_all(comment='롱전체종료', alert_message = '롱 종료 📈⛔TVM:{"orderid":"' + buycloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')            
        if (shortCondition == 1 and strategy.position_size < 0)
            if mul_input == 1 and strategy.opentrades == 1
                strategy.close_all(comment='숏전체종료', alert_message = '숏 종료 📉⛔TVM:{"orderid":"' + sellcloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 2 and strategy.opentrades == 2
                strategy.close_all(comment='숏전체종료', alert_message = '숏 종료 📉⛔TVM:{"orderid":"' + sellcloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 3 and strategy.opentrades == 3
                strategy.close_all(comment='숏전체종료', alert_message = '숏 종료 📉⛔TVM:{"orderid":"' + sellcloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 4 and strategy.opentrades == 4
                strategy.close_all(comment='숏전체종료', alert_message = '숏 종료 📉⛔TVM:{"orderid":"' + sellcloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')
            if mul_input == 5 and strategy.opentrades == 5
                strategy.close_all(comment='숏전체종료', alert_message = '숏 종료 📉⛔TVM:{"orderid":"' + sellcloseOrderid + '","memo":"' + account + '","token":"' + token + '"}:MVT')

  

अधिक