Guide to using the quantitative stock analysis tool QTYX - Backtesting to evaluate pattern stock selection returns (updated to v2.7.2)

54092b14b76d4bd9c571d9b1161c4705.png

QTYX system introduction

5a5e7a23104d9c37ea6f2dfc38e7a55f.png

Quantitative Stock TradingSystem QTYX is a system that can be used for both learning and practical stock trading analysis.

The purpose of sharing the QTYX system is to provide everyone with a template for building a quantitative system, and ultimately help everyone build their own system. Therefore, we provide source code for secondary development according to your own style.

For QTYX usage guide, please check the link:QTYX usage guide

QTYX has been updated iteratively, the current versionV2.7.2. Subsequent upgrades will update the document content simultaneously.

7a52905344d167fbbc13fba81c267986.png

Feature overview

ac95332fb74a0bd118bf505381e07d0e.png

In stock trading, many traders easily fall into the misunderstanding of winning rate. They always think that the winning rate of a strategy must be high to be profitable, but this is not the case. When a strategy only has an ordinary winning rate, it can still be profitable in the long term if it can make good use of the odds.

For example, the stock selection framework of the quantitative stock analysis tool QTYX aims to seize the big bull stocks and make a lot of money every time it makes a profit. When it loses, it has set a stop loss point and stops the loss when it only loses a little. This way, it will still be better in the long run. You can let profits run.

So after buying a stock that meets the form conditions, will it be a loss or a profit? How to design our trading system from the perspective of profit-loss ratio during the holding period? Adding the backtest evaluation function will make it clear at a glance.

77a00e3b89818f97c9305adead92f553.png

how to use

9ac7358f94abeb39be5c47873ddf9f8e.png

In principle, the backtesting function is to count the profits and retracements that have occurred since the stocks that meet the pattern are identified (buy when the pattern conditions are met) and held until the latest trading day.

For example, the time we select stocks is August 14, 2023, and the current date is August 25, 2022, then the evaluation will be from August 14, 2023August 14< /span>, the profit and loss of the stock. To August 25, 2023

Note: The latest date depends on the latest date of updated stock ticker data.

Next, we will introduce how to use the backtest function.

After starting QTYX, there is a "Stock Picking Results" index table on the left side of the page (only available in version 2.7.2 and above), which loads the stock picking result files in "ConfigFiles/All Market Stock Picking Results". (After the pattern stock selection is completed, the stock selection results will be saved in this path, such as "Moving average long arrangement analysis results_2023-08-14_High-speed version.csv", this file was selected on 2023-08-14. Individual stocks with a long moving average arrangement).

Then just click on the file name to display the stock selection results in the table page of "Stock Selection Process".

c1eb96facef0701d39981cb6f94f07ce.png

At the same time, you will be asked whether you need to backtest the results of this stock selection. After selecting "Yes", start backtesting and calculate the profit and loss of individual stocks from the selection date (such as 2023-08-14) to the latest trading day (such as 2023-11-14).

It includes the highest price, lowest price, highest time, lowest time, highest number of days to reach (new), lowest number of days to reach (new), maximum profit ratio %, maximum retracement ratio %, and current profit % in the holding period. .

a76cffd3fdc425a7318592dcd60f794e.png

Among themthe four columns are the highest number of days reached, the lowest number of days reached, the mostmaximum profit ratio%, and the maximum drawdown ratio% , we can use it to objectively evaluate the effectiveness of stock selection strategies, thereby designing a profit-loss ratio for stop-profit and stop-loss.

The number of days to reach the highest point refers to the number of days after buying a stock when the stock reaches the highest return.

The number of days to reach the minimum refers to the number of days after buying a stock when the stock retraces to its maximum loss.

In addition, the "Backtest Evaluation Report" is also provided in the upper left corner of the QTYX interface. For example, the results of this stock selection backtest are as follows: 

  1. Average maximum return: 6.75%

  2. The average number of days of profit-making holdings is 3.1 days

  3. Average maximum drawdown -10.59%

  4. The average number of days allowed to decline is 8.04 days

Note: From this evaluation report, it can be seen that the stocks selected by the stock selection strategy are suitable for short-term operations, and must be combined with a stop-loss strategy.

If the stock selection process is executed and a new stock selection result csv file is generated, you only need to click on the main node of the "Stock Selection Results" list to complete the refresh of the new file. There is no need to restart the system, which improves the efficiency of everyone's operations!

1d626265c69bb3c3a9908c3da076c478.png

In addition, the profit and loss details of the backtest evaluation are also stored locally for subsequent comprehensive review and analysis. The storage path is /QTYX/ConfigFiles/all-market stock selection results, which can be imported into QTYX for viewing through the "offline custom data" method, or It can be opened and viewed using Excel.

b3d8e48ec55850928a3575697a0a60ac.png

If you want to backtest and evaluate historical stock selection results, you can adjust the "stock selection date" to the historical date when generating the stock selection results.

4a1a267463e370abb0375a0f3643d12d.png

illustrate

Friends who want to join Knowledge Planet's "Fun with Stock Quantitative Trading" remember to call me on WeChat to get benefits!

Click for introduction to Knowledge Planet:Overview of the essence of Knowledge Planet’s "Fun with Stock Quantitative Trading"

18e1ba04842ccc2b94103dd96f92f8fc.jpeg

Guess you like

Origin blog.csdn.net/hangzhouyx/article/details/134432538