मायलैंग्वेज डॉक

लेखक:छोटे सपने, बनाया गयाः 2022-06-30 18:24:06, अद्यतनः 2024-02-06 17:36:19

[TOC]

img

MyLanguage एक प्रोग्रामेटिक ट्रेडिंग भाषा है जो MyLanguage के साथ संगत और बढ़ी हुई है। FMZ Quant का MyLanguage सख्त सिंटैक्स जांच से गुजरता है। उदाहरण के लिए, जावास्क्रिप्ट भाषा कोड को एम्बेड करने के लिए भाषा संवर्धन का उपयोग करते समय, एक अतिरिक्त स्थान वर्ण के बाद%%ऑपरेटर एक त्रुटि की रिपोर्ट करने के लिए कारण होगा.

  • बुनियादी निर्देश

    • अनुबंध

      क्रिप्टोकरेंसी अनुबंध

      क्रिप्टोकरेंसी अनुबंध

      this_week     cryptocurrency futures contract this week
      next_week     cryptocurrency futures contract next week
      month         cryptocurrency futures contract month
      quarter       cryptocurrency futures contract quarter
      next_quarter  cryptocurrency futures contract next quarter
      third_quarter cryptocurrency futures contract third quarter
      last_quarter  contract last quarter
      
      XBTUSD        BITMEX perpetual contract
      swap          cryptocurrency futures perpetual contracts other than BITMEX exchange
      
      For details, please refer to the exchange.SetContractType() function section of the JavaScript/Python/C++ documentation
      

      img

    • चर

      एक चर कंप्यूटर मेमोरी में डेटा स्टोर करने के लिए खोला गया स्थान है। सरल शब्दों में, इसका उपयोग डेटा स्टोर करने के लिए किया जाता है।

      पहला चर खोलें

      // assign 1 to variable a
      a:=1;
      

      अंदरMyLanguage, यह अलग करने के लिए आसान हैdata volume:

      1. एकल-मूल्य वाले डेटाः केवल एक मूल्य है, जैसे कि0, 1, 'abc'.
      2. अनुक्रमिक डेटा: एकल-मूल्य वाले डेटा के समूह से बना एक डेटा अनुक्रम, जैसे किClose(समापन मूल्य), जहांCloseसमापन मूल्य हैn periods. [ 10.1 , 10.2 , 10.3 , 10.4 , 10.5 ...]

      परिवर्तनीय प्रकार से भेद करें

      1. स्ट्रिंग प्रकारः इसे ``` के साथ लपेटा जाना चाहिए, स्ट्रिंग प्रकार का सीधे उपयोग करने की अनुमति नहीं है, और इसे फ़ंक्शन के साथ दृश्य में आउटपुट करने की आवश्यकता है।
      INFO(CLSOE>OPEN,'OK!');
      
      1. मान प्रकार: पूर्णांक, फ्लोटिंग-पॉइंट संख्या (दशमलव) सहित।
      // integer
      int:=2;
      
      // decimal
      float:=3.1;
      
      1. बूलियन प्रकार, 1 (सच्चे के लिए) या 0 (झूठे के लिए) का उपयोग करनाः 1, 0, सच या गलत। उदाहरण के लिएःA:=1>0;इस कोड को निष्पादित करने के बाद, का मानA1 है।
      // The closing price of the current period is greater than -999, you will find that the return value of each period is 1, which means true, because the closing price is almost impossible to be negative.
      is_true:=Close>-999;
      
      1. वैश्विक चर
      VARIABLE:VALUE1:10;     // Declare a global variable, assign the value 10, and execute it only once.
      

      ध्यान दें कि बैकटेस्टिंग के दौरानः

      VARIABLE:NX:0;    // The initial global variable NX is 0
      NX..NX+1;         // Accumulate 1 each time
      INFO(1,NX);       // Print NX every time
      

      प्रारंभ में,INFOबयान मुद्रण101, शायद यह नहीं है0शुरू में? इसका कारण यह है कि बैकटेस्ट में 100 आरंभिक K-लाइनें हैं, और 100 K-लाइनें पहले ही चल चुकी हैं, जो 100 बार जमा हुई हैं। वास्तविक मूल्य इस बात पर निर्भर करता है कि प्रारंभ में कितनी के-लाइनें प्राप्त की जाती हैं।

      • नामकरण के नियम

        अधिकांश प्रणालियों में, चर नामकरण प्रणाली आरक्षित शब्दों (निर्मित चर नाम, फ़ंक्शन नाम) के उपयोग की अनुमति नहीं देता है। उदाहरण के लिए, प्रसिद्धClose, Cइसके अतिरिक्त, शुद्ध संख्याओं या प्रमुख संख्याओं की अनुमति नहीं है। अंत में, यह बहुत लंबा होने की अनुमति नहीं है, और विभिन्न प्रणालियों में अलग-अलग लंबाई प्रतिबंध हैं। वास्तव में, आपको मुख्यधारा की प्रणाली के चीनी के पार्सिंग की दक्षता के बारे में चिंता करने की ज़रूरत नहीं है। मेरा मानना है कि MyLanguage चीनी के लिए बहुत अनुकूल है। अनुभवी प्रोग्रामर के लिए यह अनुशंसा की जाती है कि आप निम्नलिखित दो नामकरण नियमों का उपयोग करेंः

        1. चीनी नाम
        // elegant output
        5-day moving average:=MA(C,5);
        
        1. अंग्रेजी + रेखांकित
        // Output
        move_avg_5:=MA(C,5);
        

        यदि आप अंग्रेजी पसंद करते हैं, तो अपने चर का अर्थ यथासंभव समझ में आने का प्रयास करें। जैसे नामों का उपयोग न करेंःA1, AAA, BBB... मेरा विश्वास करो जब आप कुछ दिनों में फिर से अपने संकेतक कोड की समीक्षा करेंगे, तो आप स्मृति हानि के कारण बहुत दुखी होंगे। इसी तरह, जब आप कोड को दूसरों को निर्यात करते हैं, तो पाठक को तबाह होना चाहिए।

        इसलिए अब से MyLanguage को पूरी तरह से अपनाएं! मुझे आशा है कि यह आपके विश्लेषण और निर्णय लेने के लिए एक शक्तिशाली उपकरण बन सकता है।

    • डेटा का प्रकार

      डेटा प्रकार एक बुनियादी अवधारणा है. जब हम लिखने में एक चर को स्पष्ट डेटा असाइन करते हैं, तो चर स्वयं डेटा का प्रकार भी बन जाता है.

        1. मूल्य का प्रकारः
        1.2.3.1.1234.2.23456 ...
        
        1. स्ट्रिंग प्रकार ((str):
        '1' .'2' .'3' ,String types must be wrapped with ''
        
        1. अनुक्रम डेटाः
        A collection of data consisting of a series of single-valued data
        
        1. बूलियन टाइप (बूलियन):

        प्रयोग1दर्शाता हैtrueऔर0के लिएfalse.

        उदाहरण

        // declare a variable of value type
        var_int := 1;
        // Declare a variable for sequence data
        var_arr := Close;
        // The string type cannot be declared alone, it needs to be combined with the function
        INFO(C>O, 'positive line');
        
    • ऑपरेटर

      संकेतक कोड को निष्पादित करने के लिए उपयोग किया जाने वाला ऑपरेशन और गणना केवल ऑपरेशन में शामिल प्रतीकों हैं।

      • असाइनमेंट ऑपरेटर

        किसी चर को मान निर्दिष्ट करने के लिए

          1. :

          :, ग्राफ (उपग्राफ) के लिए असाइनमेंट और आउटपुट का प्रतिनिधित्व करता है।

          Close1:Close;      // Assign Close to the variable Close1 and output to the figure
          
          1. :=

          :=, असाइनमेंट का प्रतिनिधित्व करता है, लेकिन ग्राफ (मुख्य ग्राफ, उप ग्राफ...) में आउटपुट नहीं होता है, और न ही यह स्टेटस बार टेबल में प्रदर्शित होता है।

          Close2:=Close;     // Assign Close to the variable Close2
          
          1. ^^

          ^^दो^प्रतीक असाइनमेंट का प्रतिनिधित्व करते हैं, चर को मान और आउटपुट को ग्राफ (मुख्य ग्राफ) को असाइन करते हैं।

          lastPrice^^C;
          
          1. ..

          .., दो.चिह्न आवंटन का प्रतिनिधित्व करते हैं, चर को मान निर्दिष्ट करते हैं और चार्ट में चर नाम और मान प्रदर्शित करते हैं, लेकिन चार्ट पर चित्र नहीं बनाते हैं (मुख्य चित्र, उप चित्र...).

          openPrice..O
          
      • संबंधपरक संचालक

        संबंधपरक संचालक द्विआधारी संचालक हैं जिनका उपयोग दो डेटा के बीच संबंध निर्धारित करने के लिए सशर्त अभिव्यक्ति में किया जाता है।

        रिटर्न मानः बुल प्रकार, या तोtrue(1) याfalse(0).

          1. से अधिक>
          // Assign the operation result of 2>1 to the rv1 variable, at this time rv1=1
          rv1:=2>1;
          
          1. से कम<
          // Returns false, which is 0, because 2 is greater than 1
          rv3:=2<1;
          
          1. से अधिक या बराबर>=
          x:=Close;
          // Assign the result of the operation that the closing price is more than or equal to 10 to the variable rv2
          // Remark that since close is a sequence of data, when close>=10 is performed, the operation is performed in each period, so each period will have a return value of 1 and 0
          rv2:=Close>=10;
          
          1. से कम या बराबर<=
          omitted here
          
          1. के बराबर=
          A:=O=C;     // Determine whether the opening price is equal to the closing price.
          
          1. के बराबर नहीं<>
          1<>2       // To determine whether 1 is not equal to 2, the return value is 1 (true)
          
      • तार्किक संचालक

        रिटर्न मानः बुल प्रकार, या तोtrue(1) याfalse(0).

        1. तार्किक और&&, की जगह ले सकते हैंand, और और कनेक्शन के बाएं और दाएं पक्षों को एक ही समय में स्थापित किया जाना चाहिए।
        // Determine whether cond_a, cond_b, cond_c are established at the same time
        cond_a:=2>1;
        cond_b:=4>3;
        cond_c:=6>5;
        cond_a && cond_b and cond_c;    // The return value is 1, established
        
        1. तार्किक या||, आप उपयोग कर सकते हैंorया लिंक के बाएं और दाएं पक्षों को बदलने के लिए, एक पक्ष सही है (सही), पूरे सच है (वापसी मान सही है) ।
        cond_a:=1>2;
        cond_b:=4>3;
        cond_c:=5>6;
        cond_a || cond_b or cond_c;    // The return value is 1, established
        
        1. ()ऑपरेटर, कोष्ठक में अभिव्यक्ति पहले मूल्यांकन किया जाएगा.
        1>2 AND (2>3 OR 3<5)    // The result of the operation is false
        1>2 AND 2>3 OR 3<5      // The result of the operation is true
        
      • अंकगणितीय संचालक

        Return value: numeric type
        

        अंकगणितीय संचालक अंकगणितीय संचालक हैं। यह बुनियादी अंकगणितीय संचालन (गणितीय संचालक) को पूरा करने के लिए एक प्रतीक है, जो चार अंकगणितीय संचालन को संसाधित करने के लिए उपयोग किया जाने वाला प्रतीक है।

        • प्लस +

          A:=1+1;      // return 2
          
        • माइनस -

          A:=2-1;      // return 1
          
        • *गुणा करना *

          A:=2*2;      // return 4
          
        • बांटना

          A:=4/2;      // return 2
          
    • कार्य

      • कार्य

        प्रोग्रामिंग की दुनिया में, function एक कोड का एक टुकड़ा है जो एक निश्चित फ़ंक्शन को लागू करता है। और इसे अन्य कोड द्वारा बुलाया जा सकता है, सामान्य रूप निम्नानुसार हैः

        function(param1,param2,...)
        
        • संरचनाः

          फ़ंक्शन का नाम (पैरामीटर1, पैरामीटर2,...), कोई पैरामीटर नहीं हो सकता है या कई पैरामीटर हो सकते हैं। उदाहरण के लिए,MA(x,n);का सरल चलती औसत पर लौटने का मतलब हैxभीतरnपीरियड्स के बीच,MA()एक फलन है,xऔरnफलन के मापदंड हैं।

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

          Return to simple moving average
          Usage:
          AVG:=MA(X,N): N-day simple moving average of X, algorithm (X1+X2+X3+...+Xn)/N, N supports variables
          

          यह शुरुआती लोगों के लिए बहुत प्रतिकूल है, लेकिन आगे, हम फंक्शन को पूरी तरह से विच्छेदन करेंगे, फंक्शन को सीखने और उपयोग करने का एक त्वरित तरीका खोजने की कोशिश करेंगे।

      • रिटर्न मूल्य

        जल्दी से कार्यों को सीखने के लिए, हम पहले एक अवधारणा को समझने की जरूरत है, यह कहा जाता है वापसी मूल्य, लौटना, जैसा कि नाम से पता चलता है, का अर्थ है return back; मान specific value का प्रतिनिधित्व करता है, तो रिटर्न वैल्यू का अर्थ हैः प्राप्त किए जा सकने वाले डेटा।

        // Because it will be used in the following code, the variable return_value is used to receive and save the return value of function()
        // retrun_value := function(param1,param2);
        // For example:
        AVG:=MA(C,10);     // AVG is retrun_value, function is MA function, param1 parameter: C is the closing price sequence data, param2 parameter: 10.
        
      • पैरामीटर

        दूसरा, फ़ंक्शन की दूसरी महत्वपूर्ण अवधारणा पैरामीटर है, और विभिन्न पैरामीटरों में पास करके विभिन्न रिटर्न मान प्राप्त किए जा सकते हैं।

        // The variable ma5 receives the 5-day moving average of closing prices
        ma5:=MA(C,5);
        // The variable ma10 receives the 10-day moving average of closing prices
        ma10:=MA(C,10);
        

        पहला पैरामीटरXउपरोक्त चरों में सेma5, ma10हैC(समापन मूल्य), वास्तव में,Cयह भी एक फलन है (खुलने से वर्तमान तक बंद कीमतों का अनुक्रम लौटाता है), लेकिन इसमें कोई पैरामीटर नहीं है।MA()फ़ंक्शन है कि हम कुछ दिनों के लिए समापन मूल्य के चलती औसत प्राप्त करना चाहते हैं। फ़ंक्शन मापदंडों के माध्यम से उपयोग करने के लिए अधिक लचीला हो जाता है।

      • कैसे सीखें

          1. सबसे पहले, हमें यह समझने की जरूरत है कि एक फ़ंक्शन क्या करता है, यानी यह फ़ंक्शन हमें क्या डेटा वापस कर सकता है।
          1. अंतिम बात यह है कि लौटा मूल्य के प्रकार को समझने के लिए है. आखिरकार, हम लौटा मूल्य प्राप्त करने के लिए कार्यों का उपयोग करते हैं.
          1. इसके अलावा, हम पैरामीटर के डेटा प्रकार पता करने की जरूरत हैMA(x,n), यदि आप पैरामीटर के डेटा प्रकार को नहीं जानते हैंx, n, यह वापसी सही मूल्य प्राप्त करने में सक्षम नहीं होगा.

        निम्नलिखित कार्य परिचय और उपयोग में, उपरोक्त तीन सिद्धांतों का पालन करें।

    • भाषा में सुधार

      • MyLanguageऔरJavaScriptमिश्रित भाषा प्रोग्रामिंग

        %%
        // This can call any API quantified of FMZ
        scope.TEST = function(obj) {
            return obj.val * 100;
        }
        %%
        Closing price: C;
        Closing price magnified 100 times: TEST(C);
        The last closing price is magnified by 100 times: TEST(REF(C, 1)); // When the mouse moves to the K-line of the backtest, the variable value will be prompted
        
        • scopeवस्तु

          ..scopeऑब्जेक्ट विशेषताएं जोड़ सकता है और विशेषताओं के लिए गुमनाम फ़ंक्शन असाइन कर सकता है, और इस विशेषता द्वारा संदर्भित गुमनाम फ़ंक्शन को MyLanguage के कोड भाग में बुलाया जा सकता है.

        • scope.getRefs(obj)कार्य

          अंदरJavaScriptकोड ब्लॉक, कॉलscope.getRefs(obj)में पारित के डेटा वापस करने के लिए समारोहobj object.

          ..JavaScriptनिम्नलिखित कोड के साथ लपेटा गया%% %%प्राप्त होगाCमें पारित किया जबTEST(C)MyLanguage कोड में फ़ंक्शन को Close price कहा जाता है. दscope.getRefsसमारोह इस के-लाइन डेटा के सभी समापन कीमतों को वापस कर देगा.throw "stop"कार्यक्रम को बाधित करने के लिए, चरarrकेवल पहले पट्टी के समापन मूल्य शामिल है. आप हटाने का प्रयास कर सकते हैंthrow "stop", यह निष्पादित करेगाreturnके अंत मेंJavaScriptकोड, और सभी समापन मूल्य डेटा लौटाता है।

          %%
          scope.TEST = function(obj){
              var arr = scope.getRefs(obj)
              Log("arr:", arr)
              throw "stop"
              return
          }
          %%
          TEST(C);
          
        • scope.bars

          में सभी के-लाइन सलाखों का उपयोग करेंJavaScriptकोड ब्लॉक.

          ..TEST1 एक नकारात्मक रेखा है और 0 एक सकारात्मक रेखा है।

          %%
          scope.TEST = function(){
              var bars = scope.bars
              return bars[bars.length - 1].Open > bars[bars.length - 1].Close ? 1 : 0    // Only numeric values can be returned
          }
          %%
          arr:TEST;                                                                      
          
          # Attention:
          # An anonymous function received by TEST, the return value must be a numeric value.
          # If the anonymous function has no parameters, it will result in an error when calling TEST, writing VAR:=TEST; and writing VAR:=TEST(); directly.
          # TEST in scope.TEST must be uppercase.
          
        • scope.bar

          मेंJavaScriptकोड ब्लॉक, वर्तमान पट्टी का उपयोग करें।

          उच्च उद्घाटन और निम्न समापन मूल्य का औसत गणना करें।

          %%
          scope.TEST = function(){
              var bar = scope.bar
              var ret = (bar.Open + bar.Close + bar.High + bar.Low) / 4
              return ret
          }
          %%
          avg^^TEST;
          
        • scope.depth

          बाजार की गहराई के आंकड़ों तक पहुंच (ऑर्डर बुक)

          %%
          scope.TEST = function(){
              Log(scope.depth)
              throw "stop"             // After printing the depth data once, throw an exception and pause
          }
          %%
          TEST;
          
        • scope.symbol

          वर्तमान व्यापारिक जोड़ी का नाम स्ट्रिंग प्राप्त करें.

          %%
          scope.TEST = function(){
              Log(scope.symbol)
              throw "stop"
          }
          %%
          TEST;
          
        • scope.barPos

          K-लाइन की बार स्थिति प्राप्त करें.

          %%
          scope.TEST = function(){
              Log(scope.barPos)
              throw "stop"
          }
          %%
          TEST;
          
        • scope.get_locals ((name)

          इस फ़ंक्शन का उपयोग MyLanguage के कोड अनुभाग में चर प्राप्त करने के लिए किया जाता है.

          V:10;
          %%
          scope.TEST = function(obj){
              return scope.get_locals('V')
          }
          %%
          GET_V:TEST(C);
          
          # Attention:
          # If a variable cannot calculate the data due to insufficient periods, call the scope.get_locals function in the JavaScript code at this time
          # When getting this variable, an error will be reported: line:XX - undefined locals A variable name is undefined
          
        • scope.canTrade

          ..canTradeविशेषता चिह्न यह बताता है कि क्या वर्तमान पट्टी का व्यापार किया जा सकता है (क्या वर्तमान पट्टी अंतिम है)

          उदाहरण के लिए, यह आंकलन करना कि बाजार के आंकड़े तब छापे जाते हैं जब रणनीति ऐसी स्थिति में होती है जहां ऑर्डर का कारोबार किया जा सकता है

          %%
          scope.LOGTICKER = function() {
              if(exchange.IO("status") && scope.canTrade){
                  var ticker = exchange.GetTicker();
                  if(ticker){
                      Log("ticker:", ticker);
                      return ticker.Last;
                  }
              }
          }
          %%
          LASTPRICE..LOGTICKER;
          
      • अनुप्रयोग उदाहरण:

        %%
        scope.TEST = function(a){
            if (a.val) {
                throw "stop"
            }    
        }
        %%
        O>C,BK;
        C>O,SP;
        TEST(ISLASTSP);
        

        एक बार स्थिति खोलने और बंद करने के बाद रणनीति को रोकें।

    • बहु-अवधि संदर्भ

      प्रणाली स्वचालित रूप से एक उपयुक्त अंतर्निहित के-लाइन अवधि का चयन करेगी और डेटा की सटीकता सुनिश्चित करने के लिए सभी संदर्भित के-लाइन डेटा को संश्लेषित करने के लिए इन अंतर्निहित के-लाइन अवधि डेटा का उपयोग करेगी।

      • उपयोगः#EXPORT formula_name ... #ENDएक सूत्र बनाने के लिए. अगर सूत्र केवल विभिन्न अवधि के डेटा प्राप्त करने के लिए गणना नहीं की जाती है, आप भी एक खाली सूत्र लिख सकते हैं.

        एक खाली सूत्र हैः

        #EXPORT TEST 
        NOP;
        #END           // end
        
      • उपयोगः#IMPORT [MIN,period,formula name] AS variable valueएक सूत्र को संदर्भित करने के लिए निर्धारित अवधि के विभिन्न डेटा प्राप्त करें (बंद मूल्य, उद्घाटन मूल्य, आदि, चर मूल्य द्वारा प्राप्त) ।

        ..MINमेंIMPORTआदेश का अर्थमिनट का स्तर.MyLanguage FMZ क्वांट प्लेटफॉर्म, और केवलMINस्तर में समर्थित हैIMPORTआदेश. गैर मानक अवधि अब समर्थित हैं. उदाहरण के लिए, आप उपयोग कर सकते हैं#IMPORT [MIN, 240, TEST] AS VAR240240 मिनट की अवधि (4 घंटे) के-लाइन जैसे डेटा आयात करने के लिए।

        कोड उदाहरणः

        // This code demonstrates how to reference formulas of different periods in the same code
        // #EXPORT extended grammar, ending with #END marked as a formula, you can declare multiple
        #EXPORT TEST 
        Mean value 1: EMA(C, 20);
        Mean value 2: EMA(C, 10);
        #END // end
        
        #IMPORT [MIN,15,TEST] AS VAR15 // Quoting the formula, the K-line period takes 15 minutes
        #IMPORT [MIN,30,TEST] AS VAR30 // Quoting the formula, the K-line period takes 30 minutes
        CROSSUP(VAR15.Mean value is 1, VAR30.Mean value is 1),BPK;
        CROSSDOWN(VAR15.Mean value is 2, VAR30.Mean value is 2),SPK;
        The highest price in fifteen minutes:VAR15.HIGH;
        The highest price in thirty minutes:VAR30.HIGH;
        AUTOFILTER;
        
      • उपयोग करते समय ध्यान देना आवश्यक हैREF, LLV, HHVऔर कई अवधियों में डेटा को संदर्भित करते समय डेटा को संदर्भित करने के अन्य निर्देश।

        (*backtest
        start: 2021-08-05 00:00:00
        end: 2021-08-05 00:15:00
        period: 1m
        basePeriod: 1m
        exchanges: [{"eid":"Futures_OKCoin","currency":"ETH_USD"}]
        args: [["TradeAmount",100,126961],["ContractType","swap",126961]]
        *)      
        
        %%
        scope.PRINTTIME = function() {
            var bars = scope.bars;
            return _D(bars[bars.length - 1].Time);
        }
        %%
        BARTIME:PRINTTIME;      
        
        #EXPORT TEST 
        REF1C:REF(C,1);
        REF1L:REF(L,1);
        #END // end      
        
        #IMPORT [MIN,5,TEST] AS MIN5
        INFO(1, 'C:', C, 'MIN5.REF1C:', MIN5.REF1C, 'REF(MIN5.C, 1):', REF(MIN5.C, 1), 'Trigger BAR time:', BARTIME, '#FF0000');
        INFO(1, 'L:', L, 'MIN5.REF1L:', MIN5.REF1L, 'REF(MIN5.L, 1):', REF(MIN5.L, 1), 'Trigger BAR time:', BARTIME, '#32CD32');
        AUTOFILTER;
        

        अंतर की तुलना करनाMIN5.REF1CऔरREF(MIN5.C, 1),हम पा सकते हैंःMIN5.REF1C5 मिनट के के-लाइन डेटा के वर्तमान क्षण में अंतिम बार के पूर्व के बंद मूल्य का मूल्य है।REF(MIN5.C, 1)वर्तमान मॉडल की K-लाइन अवधि है (ऊपर दी गई कोड बैकटेस्ट अवधि 1 मिनट पर सेट की गई है, अर्थात ```period: 1m``), 5 मिनट की अवधि का समापन मूल्य जहां वर्तमान क्षण में पूर्व-अंतिम BAR स्थित है। इन दोनों परिभाषाओं में अंतर है और आवश्यकता के अनुसार इनका प्रयोग किया जा सकता है।

    • मोड विवरण

      • एक उद्घाटन और एक स्तर के संकेत फ़िल्टरिंग मॉडल

        मॉडल में,AUTOFILTERएक उद्घाटन और एक समापन के संकेत फ़िल्टरिंग को नियंत्रित करने और महसूस करने के लिए फ़ंक्शन लिखा गया है। जब कई उद्घाटन संकेत हैं जो शर्तों को पूरा करते हैं, तो पहला संकेत वैध संकेत के रूप में लिया जाता है, और K-लाइन पर एक ही संकेत फ़िल्टर किया जाएगा।

        फ़िल्टरिंग मॉडल द्वारा समर्थित निर्देशः BK, BP, BPK, SK, SP, SPK, CLOSEOUT, आदि। लोट नंबर जैसे BK ((5) वाले निर्देश समर्थित नहीं हैं।

        उदाहरण के लिए

        MA1:MA(CLOSE,5);
        MA2:MA(CLOSE,10);
        CROSSUP(C,MA1),BK;
        CROSSUP(MA1,MA2),BK;
        C>BKPRICE+10||C<BKPRICE-5,SP;
        AUTOFILTER;
        
        Comprehension:
        As in the above example, when AUTOFILTER is not set, the third row BK, the fourth row BK and the fifth row SP are triggered in sequence, and each K-line triggers a signal once. After opening the position, and closing the position, the model state is reset.      
        If AUTOFILTER is set, after triggering BK, only SP is triggered, other BK signals are ignored, and each K-line triggers a signal once.
        
      • वृद्धि और घटाव स्थिति मॉडल

        ..AUTOFILTERफलन मॉडल में नहीं लिखा गया है, जिससे निरंतर उद्घाटन संकेत या निरंतर समापन संकेत की अनुमति मिलती है, जो पदों को बढ़ा या घटा सकता है।

        समर्थित निर्देशः BK(N), BP(N), SK(N), SP(N), CLOSEOUT, BPK(N), SPK(N, लॉट आकार के बिना खुले और बंद ऑर्डर समर्थित नहीं हैं। (१) निर्देशों के समूह का समर्थन किया जाता है। (2) जब एक ही समय में कई निर्देश शर्तें पूरी की जाती हैं, तो संकेत उस क्रम में निष्पादित होते हैं जिसमें सशर्त कथन लिखे जाते हैं। उदाहरण के लिए:

        MA1:MA(CLOSE,5);
        MA2:MA(CLOSE,10);
        CROSSUP(C,MA1),BK(1);
        CROSSUP(MA1,MA2),BK(1);
        C>BKPRICE+10||C<BKPRICE-5,SP(BKVOL);
        

        प्रयोगTRADE\_AGAINएक ही कमांड लाइन, कई सिग्नल एक दूसरे के बाद एक कर सकते हैं।

        Comprehension:
        The above example is executed one by one, and the signal after execution is no longer triggered. Reset the model status after closing the position. A K -line triggers a signal once.
        
      • एक के-लाइन और एक संकेत वाला मॉडल

        चाहे K-लाइन समाप्त हो गई हो या नहीं, सिग्नल की गणना वास्तविक समय के आदेशों में की जाती है, यानी आदेश पूरा होने से पहले K-लाइन रखी जाती है; K-लाइन को अंत में समीक्षा की जाती है। यदि स्थिति दिशा K-लाइन के अंत में संकेत दिशा से मेल नहीं खाती है, तो स्थिति स्वचालित रूप से सिंक्रनाइज़ हो जाएगी।

        उदाहरण के लिए:

        MA1:MA(CLOSE,5);
        MA2:MA(CLOSE,10);
        CROSSUP(MA1,MA2),BPK;    //The 5-period moving average crosses up, and the 10-period moving average goes long.
        CROSSDOWN(MA1,MA2),SPK;  //The 5-period moving average crosses down, and the 10-period moving average goes short.
        AUTOFILTER;
        
      • एक के-लाइन पर कई संकेतों का एक मॉडल

        मॉडल का उपयोग करता हैmultsigएक K-लाइन से कई संकेतों को नियंत्रित करने और लागू करने के लिए।

        भले ही K-लाइन पूरी हो, सिग्नल वास्तविक समय में गणना की जाती है।

        सिग्नल की समीक्षा नहीं की जाती है, कोई सिग्नल गायब नहीं होता है, और सिग्नल की दिशा हमेशा स्थिति की दिशा के अनुरूप होती है।

        यदि एक के-लाइन में कई सिग्नल स्थितियां पूरी होती हैं, तो इसे बार-बार निष्पादित किया जा सकता है।

        For example:
        MA1:MA(CLOSE,5);
        MA2:MA(CLOSE,10);
        CROSSUP(MA1,MA2),BK;
        C>BKPRICE+10||C<BKPRICE-5,SP;
        AUTOFILTER;
        MULTSIG(0,0,2,0);
        

        MULTSIGएक K-लाइन के भीतर कई कमांड लाइन निष्पादित कर सकते हैं. एक कमांड लाइन केवल एक बार संकेत दिया जाता है।

        O<C,BK;            // These conditions may all be executed in a K-line Bar, but only one signal per line
        10+O<C,BK;         // Strategy plus TRADE_AGAIN(10);it can make multiple signals per line
        20+O<C,BK;
        40+O<C,BK;
        MULTSIG(1,1,10);
        

        पूरक: 1.पोजीशन जोड़ने और घटाने का मॉडल, एक सिग्नल और एक K-लाइन के दो तरीकेः क्लोजिंग प्राइस पर ऑर्डर डालना और ऑर्डर प्राइस पर ऑर्डर डालना, दोनों समर्थित हैं। 2.स्थिति जोड़ने और घटाने का मॉडल एक K-लाइन से कई संकेतों के आदेश को भी समर्थन करता है। पदों को जोड़ने और घटाने का मॉडल, लिखेंmultsigएक के-लाइन पर कई जोड़ या कई कटौती का एहसास करने के लिए समारोह।

    • निष्पादन मोड

      img

      • पट्टी मॉडल

        बार मॉडल उस मॉडल को संदर्भित करता है जो वर्तमान बार के पूरा होने के बाद निष्पादित किया जाता है, और व्यापार अगले बार के शुरू होने पर निष्पादित किया जाता है।

      • टिक मॉडल

        टिक मॉडल का अर्थ है कि मॉडल प्रत्येक मूल्य आंदोलन के लिए एक बार निष्पादित किया जाता है और संकेत होने पर तुरंत व्यापार किया जाता है। टिक मॉडल पिछले दिन के संकेत को नजरअंदाज करता है (पिछले दिन के संकेत को उसी दिन तुरंत निष्पादित किया जाता है), और टिक मॉडल यह निर्धारित करने के लिए केवल वर्तमान बाजार डेटा पर ध्यान केंद्रित करता है कि संकेत ट्रिगर किया गया है या नहीं।

    • चार्ट प्रदर्शित करना

      • मुख्य चार्ट के लिए अतिरिक्त संकेतक

        ऑपरेटर का प्रयोग करें^^, सेट संकेतकों को मुख्य चार्ट पर प्रदर्शित किया जाता है जबकि चरों को मान सौंपा जाता है।

        MA60^^MA(C, 60);  // Calculate the average indicator with the parameter of 60
        

        img

      • उप-चित्र के लिए अतिरिक्त संकेतक

        ऑपरेटर का प्रयोग करें:, सेट संकेतक उप-चार्ट पर प्रदर्शित होते हैं जबकि चरों को मान असाइन किया जाता है।

        ATR:MA(MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW)),26);    // Assign a value to the ATR variable, the ":" symbol is followed by the formula for calculating the ATR
        

        img

        यदि आप नहीं चाहते हैं कि यह मुख्य या उप-चार्ट पर प्रदर्शित हो, तो ... ऑपरेटर का उपयोग करें।

        MA60..MA(C, 60);  // Calculate the average indicator with the parameter of 60
        

        आप उपयोग कर सकते हैंDOTऔरCOLORREDMyLanguage से परिचित उपयोगकर्ताओं की आदतों के अनुरूप लाइन प्रकार और लाइन का रंग आदि सेट करने के लिए।

    • आम समस्याएं

      परिचयसमस्याएंसंकेतकों को लिखने की प्रक्रिया में आम तौर पर जिन बिंदुओं पर ध्यान देने की आवश्यकता होती है (लगातार जोड़ा जाता है) ।

      • सेमीकोलन पर ध्यान दें;अंत में।

      • ध्यान दें कि सिस्टम कीवर्ड को चर के रूप में घोषित नहीं किया जा सकता है.

      • ध्यान दें कि स्ट्रिंग का उपयोग करता हैएकल उद्धरण, उदाहरण के लिएः स्ट्रिंग'Open position'.

      • टिप्पणियाँ

        अनुच्छेद

        • // The Remark content(इनपुट विधि चीनी और अंग्रेजी दोनों में टाइप किया जा सकता है) का मतलब है कि कोड निष्पादन प्रक्रिया के दौरान संकलित नहीं है, यानी सामग्री के बाद//आमतौर पर हम इसका उपयोग कोड के अर्थ को चिह्नित करने के लिए करते हैं, जब यह कोड समीक्षा के लिए सुविधाजनक है, तो इसे जल्दी से समझा और याद किया जा सकता है।

        • { Remark content }ब्लॉक टिप्पणी।

          A:=MA(C,10);
          {The previous line of code is to calculate the moving average.}
          
        • (* Remark content *)ब्लॉक टिप्पणी।

          A:=MA(C,10);
          (*The previous line of code is to calculate the moving average.*)
          
      • इनपुट

        जब कोड लिखते हैं, क्योंकि इनपुट विधि अक्सर चीनी और अंग्रेजी के बीच स्विच की जाती है, जिसके परिणामस्वरूप प्रतीक त्रुटियां होती हैं। आम त्रुटियां इस प्रकार हैंः:टर्मिनेटर;, अल्पविराम,, कोष्ठक(), आदि. चीनी और अंग्रेजी के विभिन्न राज्यों में इन अक्षरों को ध्यान देने की आवश्यकता है.

        यदि आप Sogou, Baidu, या बिंग इनपुट विधियों का उपयोग करते हैं, आप जल्दी से चीनी और अंग्रेजी के बीच स्विच कर सकते हैंshiftएक बार कुंजी।

      • त्रुटि-प्रवण तर्क

        1. कम से कम, से कम नहीं, से कम नहींः संबंधित संबंध संचालक>=.
        2. अधिकतम: संबंधित संबंधपरक संचालक<=.
      • रणनीति प्रक्षेपण सिंक्रनाइजेशन

        फ्यूचर्स रणनीति में, यदि रणनीति रोबोट शुरू होने से पहले मैन्युअल रूप से खोली गई स्थिति है, जब रोबोट शुरू होता है, तो यह स्थिति की जानकारी का पता लगाएगा और इसे वास्तविक स्थिति की स्थिति के साथ सिंक्रनाइज़ करेगा। रणनीति में, आप उपयोग कर सकते हैंSP, BP, CLOSEOUTस्थिति को बंद करने के लिए आदेश।

        %%
        if (!scope.init) {
            var ticker = exchange.GetTicker();
            exchange.Buy(ticker.Sell+10, 1);
            scope.init = true;
        }
        %%
        C>0, CLOSEOUT;
        
      • दो-तरफ़ा पद समर्थित नहीं हैं

        MyLanguage एक ही अनुबंध को लंबी और छोटी स्थिति दोनों के साथ समर्थन नहीं करता है।

  • के-लाइन डेटा उद्धरण

    • खुला

      के-लाइन चार्ट का शुरुआती मूल्य प्राप्त करें।

      आरंभिक मूल्य

      कार्यः OPEN, O के लिए संक्षिप्त

      मापदंडः कोई नहीं

      स्पष्टीकरण: इस अवधि की शुरुआती कीमत देता है

      अनुक्रमिक डेटा

      OPEN gets the opening price of the K-line chart.
      
      Remark:
      1.It can be abbreviated as O.
      
      Example 1:
      OO:=O;           //Define OO as the opening price; Remark that the difference between O and 0.
      Example 2:
      NN:=BARSLAST(DATE<>REF(DATE,1));
      OO:=REF(O,NN);   //Take the opening price of the day
      Example 3:
      MA5:=MA(O,5);    //Define the 5-period moving average of the opening price (O is short for OPEN).
      
    • उच्च

      के-लाइन चार्ट पर उच्चतम मूल्य प्राप्त करें।

      उच्चतम मूल्य

      कार्यः HIGH, संक्षिप्त H

      मापदंडः कोई नहीं

      स्पष्टीकरण: इस अवधि की उच्चतम कीमत लौटाएँ

      अनुक्रमिक डेटा

      HIGH achieved the highest price on the K-line chart.
      
      Remark:
      1.It can be abbreviated as H.
      
      Example 1:
      HH:=H;         // Define HH as the highest price
      Example 2:
      HH:=HHV(H,5);  // Take the maximum value of the highest price in 5 periods
      Example 3:
      REF(H,1);      // Take the highest price of the previous K-line
      
    • कम

      K-लाइन चार्ट पर सबसे कम कीमत प्राप्त करें।

      सबसे कम कीमत

      कार्यः LOW, संक्षिप्त रूप से L

      मापदंडः कोई नहीं

      स्पष्टीकरण: इस अवधि की सबसे कम कीमत लौटाएँ

      अनुक्रमिक डेटा

      LOW gets the lowest price on the K-line chart.
      
      Remark:
      1.It can be abbreviated as L.
      
      Example 1:
      LL:=L;            // Define LL as the lowest price
      Example 2:
      LL:=LLV(L,5);     // Get the minimum value of the lowest price in 5 periods
      Example 3:
      REF(L,1);         // Get the lowest price of the previous K-line
      
    • निकट

      के-लाइन चार्ट की समापन कीमत प्राप्त करें।

      समापन मूल्य

      कार्यः CLOSE, संक्षिप्त रूप से C

      मापदंडः कोई नहीं

      स्पष्टीकरण: इस अवधि के समापन मूल्य को लौटाता है

      अनुक्रमिक डेटा

      CLOSE Get the closing price of the K-line chart
      
      Remarks:
      1.Obtain the latest price when the intraday K-line has not finished.
      2.It can be abbreviated as C.
      
      Example 1:
      A:=CLOSE;          //Define the variable A as the closing price (A is the latest price when the intraday K-line has not finished)
      Example 2:
      MA5:=MA(C,5);      //Define the 5-period moving average of the closing price (C is short for CLOSE)
      Example 3:
      A:=REF(C,1);       //Get the closing price of the previous K-line
      
    • VOL

      के-लाइन चार्ट की ट्रेडिंग वॉल्यूम प्राप्त करें.

      व्यापार की मात्रा

      कार्यः VOL, संक्षिप्त रूप से V

      मापदंडः कोई नहीं

      स्पष्टीकरण: इस अवधि की व्यापारिक मात्रा देता है

      अनुक्रमिक डेटा

      VOL obtains the trading volume of the K-line chart.
      
      Remarks:
       It can be abbreviated as V.
      The return value of this function on the current TICK is the cumulative value of all TICK trading volume on that day.
      
      Example 1:
      VV:=V;       // Define VV as the trading volume
      Example 2:
      REF(V,1);    // Indicates the trading volume of the previous period
      Example 3:
      V>=REF(V,1); // The trading volume is greater than the trading volume of the previous period, indicating that the trading volume has increased (V is the abbreviation of VOL)
      
    • ओपीआई

      वायदा (अनुबंध) बाजार में वर्तमान कुल स्थिति लें।

      OpenInterest:OPI;
      
    • आरईएफ

      अग्रिम उद्धरण।

      Reference the value of X before N periods.
      
      Remarks:
      1.When N is a valid value, but the current number of K-lines is less than N, returns null;
      2.Return the current X value when N is 0;
      3.Return a null value when N is null.
      4.N can be a variable.
      
      Example 1:
      REF(CLOSE,5);Indicate the closing price of the 5th period before the current period is referenced
      Example 2:
      AA:=IFELSE(BARSBK>=1,REF(C,BARSBK),C);//Take the closing price of the K-line of the latest position opening signal
      // 1)When the BK signal is sent, the bar BARSBK returns null, then the current K-line REF(C, BARSBK) that sends out the BK signal returns null;
      // 2)When the BK signal is sent out, the K-line BARSBK returns null, and if BARSBK>=1 is not satisfied, it is the closing price of the K-line.
      // 3)The K-line BARSBK after the BK signal is sent, returns the number of periods from the current K-line between the K-line for purchasing and opening a position, REF(C,BARSBK)
      Return the closing price of the opening K-line.
      // 4)Example: three K-lines: 1, 2, and 3, 1 K-line is the current K-line of the position opening signal, then returns the closing price of the current K-line, 2, 3
      The K-line returns the closing price of the 1 K-line.
      
    • UNIT

      डेटा अनुबंध की ट्रेडिंग इकाई प्राप्त करें.

      Get the trading unit of the data contract.
      Usage:
      UNIT takes the trading unit of the loaded data contract.
      

      क्रिप्टोकरेंसी स्पॉट

      UNIT मान 1 है।

      क्रिप्टोकरेंसी वायदा

      UNIT मूल्य अनुबंध मुद्रा से संबंधित है।

      OKEX futures currency standard contracts: 1 contract for BTC represents $100, 1 contract for other currencies represents $10
      
    • MINPRICE

      डेटा अनुबंध की न्यूनतम भिन्नता मूल्य।

      Take the minimum variation price of the data contract.
      Usage:
      MINPRICE; Take the minimum variation price of the loaded data contract.
      
    • MINPRICE1

      व्यापारिक अनुबंध की न्यूनतम भिन्नता मूल्य।

      Take the minimum variation price of a trading contract.
      Usage:
      MINPRICE1; Take the minimum variation price of a trading contract.
      
  • समय फलन

    • बारपोस

      के-लाइन की स्थिति ले लो.

      BARPOS, Returns the number of periods from the first K-line to the current one.
      
      Remarks:
      1.BARPOS returns the number of locally available K-line, counting from the data that exists on the local machine.
      2.The return value of the first K-line existing in this machine is 1.
      
      Example 1:LLV(L,BARPOS);        // Find the minimum value of locally available data.
      
      Example 2:IFELSE(BARPOS=1,H,0); // The current K-line is the first K-line that already exists in this machine, and it takes the highest value, otherwise it takes 0.
      
    • DAYBARPOS

      DAYBARPOS वर्तमान K-लाइन BAR दिन का K-लाइन BAR है।

    • अवधि

      अवधि मान मिनटों की संख्या है।

      1, 3, 5, 15, 30, 60, 1440
      
    • दिनांक

      तिथिफ़ंक्शन दिनांक, वर्ष, माह और 1900 के बाद से अवधि के दिन प्राप्त करें

      Example 1:
      AA..DATE;                  // The value of AA at the time of testing is 220218, which means February 18, 2022
      
    • समय

      के-लाइन लेने का समय।

      TIME, the time of taking the K-line.
      
      Remarks:
      1.The function returns in real time in the intraday, and returns the starting time of the K-line after the K-line is completed.
      2.This function returns the exchange data reception time, which is the exchange time.
      3.The TIME function returns a six-digit form when used on a second period, namely: HHMMSS, and displays a four-digit form on other periods, namely: HHMM.
      4.The TIME function can only be loaded in periods less than the daily period, and the return value of the function is always 1500 in the daily period and periods above the daily period.
      5. It requires attention when use the TIME function to close a position at the end of the day
      (1).It is recommended to set the time for closing positions at the end of the market to the time that can actually be obtained from the return value of the K-line (for example: the return time of the last K-line in the 5-minute period of the thread index is 1455, and the closing time at the end of the market is set to TIME>=1458, CLOSEOUT; the signal of closing the position at the end of the market cannot appear in the effect test)
      (2).If the TIME function is used as the condition for closing the position at the end of the day, it is recommended that the opening conditions should also have a corresponding time limit (for example, if the condition for closing the position at the end of the day is set to TIME>=1458, CLOSEOUT; then the condition TIME needs to be added to the corresponding opening conditions. <1458; avoid re-opening after closing)
      
      Example 1:
      C>O&&TIME<1450,BK;
      C<O&&TIME<1450,SK;
      TIME>=1450,SP;
      TIME>=1450,BP;
      AUTOFILTER;
      // Close the position after 14:50.
      Example 2:
      ISLASTSK=0&&C>O&&TIME>=0915,SK;
      
    • वर्ष

      Year.

      YEAR, year of acquisition.
      
      Remark:
      The value range of YEAR is 1970-2033.
      
      Example 1:
      N:=BARSLAST(YEAR<>REF(YEAR,1))+1;
      HH:=REF(HHV(H,N),N);
      LL:=REF(LLV(L,N),N);
      OO:=REF(VALUEWHEN(N=1,O),N);
      CC:=REF(C,N);                               // Take the highest price, lowest price, opening price, and closing price of the previous year
      Example 2:
      NN:=IFELSE(YEAR>=2000 AND MONTH>=1,0,1);
      
    • माह

      एक महीना ले लो।

      MONTH, returns the month of a period.
      
      Remark:
      The value range of MONTH is 1-12.
      
      Example 1:
      VALUEWHEN(MONTH=3&&DAY=1,C);                // Take its closing price when the K-line date is March 1
      Example 2:
      C>=VALUEWHEN(MONTH<REF(MONTH,1),O),SP;
      
    • दिन

      एक अवधि में दिनों की संख्या प्राप्त करें

      DAY, returns the number of days in a period.
      
      Remark:
      The value range of DAY is 1-31.
      
      Example 1:
      DAY=3&&TIME=0915,BK;                      // 3 days from the same day, at 9:15, buy it
      Example 2:
      N:=BARSLAST(DATE<>REF(DATE,1))+1;
      CC:=IFELSE(DAY=1,VALUEWHEN(N=1,O),0);      // When the date is 1, the opening price is taken, otherwise the value is 0
      
    • घडी

      Hour.

      HOUR, returns the number of hours in a period.
      
      Remark:
      The value range of HOUR is 0-23
      
      Example 1:
      HOUR=10;                                   // The return value is 1 on the K-line at 10:00, and the return value on the remaining K-lines is 0
      
    • मिनट

      Minute.

      MINUTE, returns the number of minutes in a period.
      
      Remarks:
      1: The value range of MINUTE is 0-59
      2: This function can only be loaded in the minute period, and returns the number of minutes when the K-line starts.
      Example 1:
      MINUTE=0;                                 // The return value of the minute K-line at the hour is 1, and the return value of the other K-lines is 0
      Example 2:
      TIME>1400&&MINUTE=50,SP;                   // Sell and close the position at 14:50
      
    • सप्ताह का दिन

      सप्ताह की संख्या प्राप्त करें।

      WEEKDAY, get the number of the week.
      
      Remark:
      1: The value range of WEEKDAY is 0-6. (Sunday ~ Saturday)
      
      Example 1:
      N:=BARSLAST(MONTH<>REF(MONTH,1))+1;
      COUNT(WEEKDAY=5,N)=3&&TIME>=1450,BP;
      COUNT(WEEKDAY=5,N)=3&&TIME>=1450,SP;
      AUTOFILTER;                               // Automatically close positions at the end of the monthly delivery day
      Example 2:
      C>VALUEWHEN(WEEKDAY<REF(WEEKDAY,1),O)+10,BK;
      AUTOFILTER;
      
  • तार्किक निर्णय कार्य

    • बारस्टैटस

      वर्तमान अवधि के लिए स्थिति स्थिति लौटाएँ.

      BARSTATUS returns the position status for the current period.
      
      Remark:
      The function returns 1 to indicate that the current period is the first period, returns 2 to indicate that it is the last period, and returns 0 to indicate that the current period is in the middle.
      
      Example:
      A:=IFELSE(BARSTATUS=1,H,0);              // If the current K-line is the first period, variable A returns the highest value of the K-line, otherwise it takes 0
      
    • बीच में

      Between.

      BETWEEN(X,Y,Z) indicates whether X is between Y and Z, returns 1 (Yes) if established, otherwise returns 0 (No).
      
      Remark:
      1.The function returns 1(Yse) if X=Y, X=Z, or X=Y and Y=Z.
      
      Example 1:
      BETWEEN(CLOSE,MA5,MA10);                // It indicates that the closing price is between the 5-day moving average and the 10-day moving average
      
    • BARSLASTCOUNT

      BARSLASTCOUNT(COND) वर्तमान अवधि से आगे की गिनती करते हुए, लगातार अवधि की संख्या को गिनती करता है जो शर्त को संतुष्ट करती है।

      Remark:
      1. The return value is the number of consecutive non zero periods calculated from the current period
      2. the first time the condition is established when the return value of the current K-line BARSLASTCOUNT(COND) is 1
      
      Example:
      BARSLASTCOUNT(CLOSE>OPEN);
      //Calculate the number of consecutive positive periods within the current K-line
      
    • क्रॉस

      क्रॉस फ़ंक्शन।

      CROSS(A,B) means that A crosses B from bottom to top, and returns 1 (Yes) if established, otherwise returns 0 (No)
      
      Remark:
      1.To meet the conditions for crossing, the previous k-line must satisfy A<=B, and when the current K-line satisfies A>B, it is considered to be crossing.
      
      Example 1:
      CROSS(CLOSE,MA(CLOSE,5));              // Indicates that the closing line crosses the 5-period moving average from below
      
    • क्रॉसडाउन

      क्रॉसडाउन

      CROSSDOWN(A,B): indicates that when A passes through B from top to bottom, it returns 1 (Yes) if it is established, otherwise it returns 0 (No)
      
      Remark:
      1.CROSSDOWN(A,B) is equivalent to CROSS(B,A), and CROSSDOWN(A,B) is easier to understand
      
      Example 1:
      MA5:=MA(C,5);
      MA10:=MA(C,10);
      CROSSDOWN(MA5,MA10),SK;               // MA5 crosses down MA10 to sell and open a position
      // CROSSDOWN(MA5,MA10),SK; Same meaning as CROSSDOWN(MA5,MA10)=1,SK;
      
    • क्रॉसअप

      Crossup.

      CROSSUP(A,B) means that when A crosses B from the bottom up, it returns 1 (Yes) if it is established, otherwise it returns 0 (No)
      
      Remark:
      1.CROSSUP(A,B) is equivalent to CROSS(A,B), and CROSSUP(A,B) is easier to understand.
      
      Example 1:
      MA5:=MA(C,5);
      MA10:=MA(C,10);
      CROSSUP(MA5,MA10),BK;                 // MA5 crosses MA10, buy open positions
      // CROSSUP(MA5,MA10),BK;与CROSSUP(MA5,MA10)=1,BK; express the same meaning
      
    • हर कोई

      यह निर्धारित करें कि क्या यह लगातार संतुष्ट है।

      EVERY(COND,N), Determine whether the COND condition is always satisfied within N periods. The return value of the function is 1 if it is satisfied, and 0 if it is not satisfied.
      
      Remarks:
      1.N contains the current K-line.
      2.If N is a valid value, but there are not so many K-lines in front, or N is a null value, it means that the condition is not satisfied, and the function returns a value of 0.
      3.N can be a variable.
      
      Example 1:
      EVERY(CLOSE>OPEN,5);                // Indicates that it has been a positive line for 5 periods
      Example 2:
      MA5:=MA(C,5);                       // Define a 5-period moving average
      MA10:=MA(C,10);                     // Define a 10-period moving average
      EVERY(MA5>MA10,4),BK;               // If MA5 is greater than MA10 within 4 periods, then buy the open position
      // EVERY(MA5>MA10,4),BK; has the same meaning as EVERY(MA5>MA10,4)=1,BK;
      
    • मौजूद है

      यह निर्धारित करें कि क्या संतुष्टि है।

      EXIST(COND, N) judges whether there is a condition that satisfies COND within N periods.
      
      Remarks:
      1.N contains the current K-line.
      2.N can be a variable.
      3.If N is a valid value, but there are not so many K-lines in front, it is calculated according to the actual number of periods.
      
      Example 1:
      EXIST(CLOSE>REF(HIGH,1),10);     // Indicates whether there is a closing price greater than the highest price of the previous period in 10 periods, returns 1 if it exists, and returns 0 if it does not exist
      Example 2:
      N:=BARSLAST(DATE<>REF(DATE,1))+1;
      EXIST(C>MA(C,5),N);              // Indicates whether there is a K-line that satisfies the closing price greater than the 5-period moving average on the day, returns 1 if it exists, returns 0 if it does not exist
      
    • यदि

      स्थिति फलन

      IF(COND,A,B)Returns A if the COND condition is true, otherwise returns B.
      
      Remarks:
      1.COND is a judgment condition; A and B can be conditions or values.
      2.This function supports the variable circular reference to the previous period's own variable, that is, supports the following writing Y: IF(CON,X,REF(Y,1)).
      Example 1:
      IF(ISUP,H,L);                   // The K-line is the positive line, the highest price is taken, otherwise the lowest price is taken
      Example 2:
      A:=IF(MA5>MA10,CROSS(DIFF,DEA),IF(CROSS(D,K),2,0));     // When MA5>MA10, check whether it satisfies the DIFF and pass through DEA, otherwise (MA5 is not greater than MA10), when K and D are dead fork, let A be assigned a value of 2, if none of the above conditions are met, A is assigned a value of 0
      A=1,BPK;                                                // When MA5>MA10, the condition for opening a long position is to cross DEA above the DIFF
      A=2,SPK;                                                // When MA5 is not greater than MA10, use K and D dead forks as the conditions for opening short positions
      
    • IFELSE

      स्थिति फलन

      IFELSE(COND,A,B) Returns A if the COND condition is true, otherwise returns B.
      
      Remarks:
      1.COND is a judgment condition; A and B can be conditions or values.
      2.This function supports variable circular reference to the previous period's own variable, that is, supports the following writing Y: IFELSE(CON,X,REF(Y,1));
      Example 1:
      IFELSE(ISUP,H,L);                                             // The K-line is the positive line, the highest price is taken, otherwise the lowest price is taken
      Example 2:
      A:=IFELSE(MA5>MA10,CROSS(DIFF,DEA),IFELSE(CROSS(D,K),2,0));   // When MA5>MA10, check whether it satisfies the DIFF and pass through DEA, otherwise (MA5 is not greater than MA10), when K and D are dead fork, let A be assigned a value of 2, if none of the above conditions are met, A is assigned a value of 0
      A=1,BPK;                                                      // When MA5>MA10, the condition for opening a long position is to cross DEA above the DIFF
      A=2,SPK;                                                      // When MA5 is not greater than MA10, use K and D dead forks as the conditio

संबंधित

अधिक