FUTU HK Help Center-How to identify the problems in a strategy
English
Back
Open Account
Clear
All
Quotes
News
Learn
Help
All
HK
US
CN
SG
AU
JP
CA
MY
All
News
Announcements
Reports
No matches yet
Operations too frequent. Please try again later.
Please check network settings and try again Refresh Refresh
Loading
History record
    Latest News
      Quotes More
      News More
      Learn More
      Help More
      Loading
      News More
      Announcements More
      Reports More

      How to identify the problems in a strategy

      1. Use "Detect Error"

      While creating a strategy, click on the "Detect Error" button in the upper right corner of the canvas, and the system will check the strategy in real time for missing parameters, inapplicable Conditions and Operations, and other problems.

      Click on the text in the "Detection Results", and the system will locate the abnormal Conditions Cards or Operations Cards so that you can you fix them.

       

      2. Use "Backtesting"

      Backtesting can help test the effectiveness of a strategy. Before conducting live trading, it is recommended that you perform multiple backtestings on the strategy to see if it has been configured properly and if it will be executed as you expect.

      In addition, Futu supports trading of a variety of products in multiple markets, including the Hong Kong stock, US stock, A-share, and futures markets. However, the specific types of products you can trade vary slightly with each market. For example, the A-share market does not support market orders, while stop loss market orders and market if touched orders are not available in the futures market. You will discover it via backtest.

       

      3. Use "Running Log"

      3.1 Running log

      Running logs are available for both backtesting and live trading. Running logs contain details of Operations Cards execution, order status and transaction status after an order is placed, reports of various exceptions, etc.

      Each log consists of 3 parts:

      ● Time: Beijing time

      ●  Properties: 3 categories

        ○ Info: information and records during normal running. E.g.: operations execution results, order status changes, transaction status changes, quotes access changes, etc.

        ○ Warning: exception alerts that will not interrupt the running of the entire strategy. E.g.: order failed, order invalid, etc.

        ○ Error: exception reports that will interrupt the running of the strategy. E.g.: global variable assignment exception leading to strategy initialization failure, quotes subscription exception leading to strategy initialization failure, insufficient validity period after trade is unlocked, etc.

      ●  Details:

        ○ Title: If the log content is related to a Condition card or Operation, the format of the title will be "Condition/Operation Name-Condition/Operation Type" so as to indicate the corresponding Condition Card or Operation Card on the canvas

        ○ Body: details

      3.2 How to use running logs

      1)Check the running logs of a strategy for errors or warnings. If there are any errors or warnings, adjust the strategy according to the instructions in the logs to prevent these errors from happening again.

      2)If you want to check whether a Condition judged correctly, you can use "Value Assignment Card" to print the values of its variables (see 3.2.1 for details). Or you can use "Alert Settings Card" to print customized information (see 3.2.2 for details).

      3.2.1 How to use "Value Assignment Card"

      You can now print logs of execution results of Operations, but you may wonder how to identify problems of Conditions. In fact, we only need to print the values of Conditions’ variables.

      E.g.: When comparing the sizes of two MAs, we usually configure a Condition as below.

      However, when MA(5) was found to be less than MA(10) in the backtest, the system did not continue to run the strategy. In this case, we can create two new global variables, and assign MA(5) and MA(10) to the two global variables by using "Value Assignment Card", so that we can view the exact values of MA(5) and MA(10) in the logs during the running of the strategy.

      3.2.2 How to use "Alert Settings Card"

      You can print customized alerts in the logs by adding "Alert Settings Card" as needed.

      E.g.: For a double moving average strategy, you may want to know which condition was not met, thus leading to the failed execution of the order. In this case, we can put a "Alert Settings Card" after each Condition Card and get the answer from the logs.

       

      4. Contact Our Project Team

      If you still have problems after trying all the above methods, please join our official QQ group for algorithmic trading communication (Group No.: 972441253), and contact our project team for assistance.

      Market Insights

      Discussing

      關稅風暴暫離高壓區!市場能否迎來反彈?
      當地時間4月22日,美國總統特朗普公開承認美國目前對中國出口商品的關稅過高,預計稅率將大幅降低;美國財政部長貝森特也表示中美雙方關稅戰將很快降溫。4月25日,特朗普表示將爲不同國家設定「公平的」關稅稅率。特朗普此次對華關稅態度的轉變,能否平息市場恐慌情緒?關稅拉鋸戰最終結局如何? Show More
      特朗普對華態度緩和!近期你會如何操作?
      67%
      33%
      做多
      做空
      13K votes