English
Back
Log in to access Online Inquiry
Back to the Top

How to identify 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 Cards and Operations Cards, 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 fix them.

(Images provided are not current and any securities or strategies are shown for illustrative purposes only and are not recommendation.)

 

2. Use “Backtest”

Backtesting can help test the effectiveness of a strategy configuration. 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 process as you expect.

In addition, the moomoo app can support trading of a variety of products in multiple markets, including the Hong Kong stock, US stock, A-share, and futures markets. However, the specific order types of products that can be traded 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.

Please note, futures trading is not offered by Moomoo Financial Inc. and is not available to US customers. Futures trading involves high risks and is not suitable for all investors. The amount you could lose may be greater than your initial investment.

 

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 card, 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

(Images provided are not current and any securities are shown for illustrative purposes only.)

3.2 How to use running logs

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.

(Images provided are not current and any securities or strategies are shown for illustrative purposes only and are not recommendation.)

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.

(Images provided are not current and any securities or strategies are shown for illustrative purposes only and are not recommendation.)

 

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 and get the answer from the logs.

(Images provided are not current and any securities or strategies are shown for illustrative purposes only and are not recommendation.)

Losses can happen more quickly with quant and algorithmic trading compared to other forms of trading. Trading in financial markets carries inherent risks, making effective risk management a crucial aspect of quantitative trading systems. These risks encompass various factors that can disrupt the performance of such systems, including market volatility leading to losses.

Moreover, quants face additional risks such as capital allocation, technology, and broker-related uncertainties. It's important to note that automated investment strategies do not guarantee profits or protect against losses. The responsiveness of the trading system or app may vary due to market conditions, system performance, and other factors. Account access, real-time data, and trade execution may be affected by factors such as market volatility.

Any illustrations, scenarios, or specific securities referenced herein are strictly for educational and illustrative purposes and is not a recommendation or endorsement of any particular investment or investment strategy.

This presentation is for informational and educational use only and is not a recommendation or endorsement of any particular investment or investment strategy. Investment information provided in this content is general in nature, strictly for illustrative purposes, and may not be appropriate for all investors.  It is provided without respect to individual investors’ financial sophistication, financial situation, investment objectives, investing time horizon, or risk tolerance. You should consider the appropriateness of this information having regard to your relevant personal circumstances before making any investment decisions. Past investment performance does not indicate or guarantee future success. Returns will vary, and all investments carry risks, including loss of principal. Moomoo makes no representation or warranty as to its adequacy, completeness, accuracy or timeliness for any particular purpose of the above content.