Guide to using QTYX, a quantitative stock analysis tool - bottom breakthrough pattern stock selection (double bottom & box) (updated 2.7.4)


e057e6429679755aee56cf6087582d53.png

Build your own quantification system

4eeddfa380b439792f1a95f1a06c8b6b.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.4. Subsequent upgrades will update the document content simultaneously.

a918abb73b02be31ef4322cafd72e52c.png

Functional Overview

abbb269a8d4657fe6998bd75addf70a6.png

For students who are betting on high margin of safety at the bottom (you can also do morphological analysis on ETF data after upgrading later), QTYX has included two stock selection patterns: "double bottom pattern breakthrough" and "box pattern breakthrough" from version 2.7.4 Made an overlay.

c6dcfe49164b342983bbb34bc24db5b5.png

Quick to use‍‍‍‍‍

c64e335a5bef23f62719ddf2305cfbe7.png

Next, let’s talk about how to use it!

On the [Stock Selection Process] page, there are three stock selection ideas: "data-driven", "form-driven" and "RPS-driven", which complement each other.

Here the "Stock Selection Model" selects "Bottom Breakthrough (Box Form & Double Bottom Form)".

8817fcfee23e9e4ad247273bd9cd0cfc.png

Introducing the functions of several key options:

  • Stock selection date: Select the date for morphological analysis (supports selecting historical dates for backtesting)

  • Listing time: Filter out sub-new stocks based on listing time (the tool will filter out sub-new stocks after the set time). After the listing of new stocks, they are in a state of rapid rise and fall. The trend is not stable, and there is not enough data for backtesting. When selecting stocks, you should eliminate such stocks in advance.

  • Eliminate ST/*ST: ST stocks face a very high risk of delisting and investors should avoid them. Such stocks should be eliminated in advance when selecting stocks.

  • Overlay analysis data: Currently supports "Quarterly Profit Statement" and "Daily Fundamental Indicators". After checking, the corresponding data will be superimposed in the generated stock list.

  • Stock pool: Select the stock pool to scan, the whole market stock pool, the self-selected stock pool, the concept sector pool, and the industry sector pool

  • Stock selection model: Choose a stock selection model, such as main rising wave (long moving average & breaking through the previous high), bottom breakthrough (box shape & double bottom shape)

Many times we pay more attention to stocks in currently popular sectors. Therefore, the QTYX system stock selection function has added classification options for concept sectors and industry sectors. In this way, we can specifically select stocks in the sectors we care about, and stock selection becomes very fast.

For example, after selecting "Concept Stock Pool", a list dialog box appears. The left side is the unselected concept section, and the right side is the selected one. Clicking on a sector in the list on the left will add it to the stock selection list on the right. Clicking on a sector in the stock selection list on the right will cancel it and return to the left. The same applies to "industry stock pools". After closing the sector selection dialog box, the stock pool takes effect.

83ad06d6f0ef1bca3aa4879a7be52a8c.png

Click "Confirm" to configure the pattern stock selection parameters. By enabling the switch, the two previously independent models of "box pattern breakthrough" and "double bottom pattern breakthrough" are superimposed.

02c72a4d0ec7ba4d97cb511c8ab16ef8.png

The key parameters of "box shape" and "double bottom shape" will be introduced in detail below.

Note: The two models "Box Form" and "Double Bottom Form" can be used together or separately. Just check the "Enable" box.

Note: This version starts before morphological analysis, so there is no need to update the stock market data in advance! ! !

After starting stock selection, the log bar in the upper left corner will automatically switch to the [Stock Selection Log] to display stocks that meet the characteristics.

After starting to select stocks, for example, if you find that the parameter configuration is wrong, you can stop and modify the parameters, and then start again. If you want to cancel stock selection, just click [Stop Stock Selection]->[Form-driven Stock Selection].

The list of stocks after filtering is as shown below. You can see that the stocks in the pink box chart are in line with the double bottom form, and the stocks in the red box chart are in line with the box form. If a stock meets both forms at the same time, the corresponding data column is The data will be identified.

66ec4aa37edca7f8f2bbfb3723b881a5.png

After the stock selection is completed, the stock selection results will be saved under the "ConfigFiles/Full Market Stock Selection Results" path. After selecting, you can proceed to the next step of stock selection.

0e43c56ca0226268bfbf9d9fa8dab4bb.png

double bottom pattern breakout

74e1ee1ef4729cbcb5bf5e255bd2328b.png

The double bottom pattern is formed by market forces. We just need to follow the trend. Especially the double bottom pattern formed by large cycles and multiple K lines has better effects!

A double bottom, also known as a "W bottom", means that after a period of decline, the stock price forms a low point and then rebounds, then falls again, forming a new low near the previous low point, and then the stock price moves upward again. This forms two bottoms and becomes a double bottom.

The line connecting the two lowest points is called a "support line."

The high price between the two lows is called the "neckline" price.

Usually when heavy volume breaks through the neckline, it is a good buying point.

There will be two forms after a breakthrough: the first is to pull up quickly immediately after the breakthrough; the second is to shrink back to near the neckline after the breakthrough, and then pull up quickly after confirming that the breakthrough is effective.

fcbbe93277638848f9b7e84f9a6c7630.png

ed4e9c368bc5ae818222be61527e58ba.png

As shown in the figure above, we use the closing price time series of individual stocks as analysis data. The current trading date is the end point, and two consecutive intervals are selected from the historical trading days.

The two intervals are first set in exactly equal ranges, and then an interval superposition variable is added. The function of this variable is to further filter out patterns such as head-and-shoulders bottoms or V-shaped bottoms.

Of course, it can also be divided dynamically, and the rules of division can be set according to the overall trend of the market.

Then analyze according to the following steps:

  • Find the minimum value of interval 1, which is the left bottom

  • Find the minimum value of interval 2, which is the right bottom

  • Find the maximum value of the area between the left bottom and the right bottom

  • Compare the increases of the left bottom and the right bottom, whether the difference is <3%

  • Whether the closing price on the current date breaks through the neckline >3%

The source code for pattern recognition is stored in StrategyGath/PattenGath.py. Interested friends can study it.

Click "Confirm" in the stock selection data dialog box, and the configuration interface for parameters related to the pattern recognition algorithm will appear.

A total of these parameters are open: the selection of the K-line range, the selection of the middle area error, the error between the double bottom lows, the range of effective breakthrough confirmation, the increase or decrease of the effective breakthrough on the day, and the effective breakthrough of the trading volume threshold.

247b827f0e27da4f25901cf358d8fdc5.png

The meaning of most parameters can be understood in conjunction with algorithm principles. The meanings of some special parameters are explained as follows:

"Judgment of whether it is the first breakthrough." For example, today we used the tool QTYX to search for stocks that meet the form conditions in the entire market, and found the following stock. This stock conforms to a double bottom pattern, but it has broken through for several days (note: if you use the tool to screen it every day, you can find the day of the first breakthrough), so the buying position is not very suitable now.

5461d1050f95273f3ef78f11730941e3.png

We prefer to choose stocks that break through the neckline for the first time, which is the perfect time to buy.

For example, for Wasu Media, it has been 5 trading days since the breakthrough day, which is not the first breakthrough!

3a387d2514e2ab95c5addbaff028a7c4.png

For example, like Tongcheng Holdings, since we have set the effective breakthrough range to be more than 3% greater than the neckline, today is the first breakthrough day!

7a703396f307e1b56443cb0403c58f22.png

dd7f29ff2242ba05c8953a2d5e46a2cd.png

In addition, we also combine the trading volume and the day's rise and fall to superimpose the judgment. After all, when there is a large-volume jump at the bottom, it means that the stock is stronger, making the rise after the double bottom pattern breaks through a greater success rate.

(1) For example, when a double bottom pattern breaks through, whether the trading volume is enlarged will be used to determine whether it is an effective breakthrough. An effective breakthrough of the trading volume threshold indicates that the trading volume on the day of the breakthrough is more than X percent higher than the average trading volume within the "selected K-line range".

(2) For example, while identifying the double bottom pattern, determine whether the stock has an upward jump gap in the near future. If so, it can illustrate the strength of the stock.

02cae7c45273c3f062859ea29d926fa3.png

Box bottom pattern breakthrough

1869b92e1eb7fb6d0dd3dc83a95a6b1c.png

Big bull stocks often have some characteristic signals in the early stages of their rise. Based on these characteristics, you can filter out targets that may become bull stocks, and then focus on tracking them. This is undoubtedly a very effective way to select stocks.

Let’s take a look at the characteristics of Huanrui Century in the early stages of its rise. The stock price fluctuates up and down within the range, and the 20-day, 30-day, 60-day, and 120-day moving averages gradually converge. When a long Yang reaches a recent high, the moving averages begin to diverge rapidly, thus starting an unstoppable rise.

8320c202ec4aeefaa241d4ec4a4a66b3.png

Usually we call the early characteristics of bull stocks - "Bottom moving average sticking, Changyang breakthrough" a box breakthrough pattern. The stock selection function of the quantitative stock analysis tool QTYX supports the screening of stocks in this form.

On the [Stock Selection Process] page, select the "Form-driven" stock selection strategy, and select "Bottom Breakthrough (Box Form & Double Bottom Form)" for "Stock Selection Model".

Then you can see the dedicated configuration interface for box shape breakthrough.

Select parameters corresponding to the morphological characteristics of the cabinet. The parameters here indicate that the stock price fluctuates no more than 15% above and below the 40-day moving average, the convergence range of the 20-day, 30-day, and 60-day moving average is less than 5%, the day's increase exceeds 5%, and the stock price reaches a new 40-day high.

6b0737a10ac507f453cb30c9110f586d.png

f72d2b860d0052d90175e30532ca4fd6.png

Pattern Stock Picking Backtest

45f87fa2835d8098546c51660f4dbdd2.png

After buying a stock that matches the pattern, whether it is a loss or a profit, we have added a backtest function to make it clear at a glance. For example, during the holding period, the profit can exceed 10%, while the loss is only 3%, then we can design our strategy from the perspective of profit-loss ratio.

For usage of the backtest function, please refer to the usage guide:

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

In principle, the backtesting function takes two pieces of data, one piece of data is used to identify the pattern (buy when the pattern conditions are met), and the other piece of data is used to calculate the profit and loss after buying the stock.

3837492ecb12369e07d61453781557c8.png

a66cca25eeb34ad874402fc1ab946074.png

Follow-up stock selection analysis‍

f5f8dcc8e0bffd3adfcab6d3d33781f9.png

Since "data-driven stock selection" and "form-driven stock selection" have been integrated in QTYX, click "Start Stock Selection" -> "Start Conditional Stock Selection", and then you can use conditional expressions to select stocks.

For example, select stocks with good fundamentals based on performance data (need to superimpose "quarterly profit statement"),

bd7b77c1ed3e78ac1602e80c2c07bcb7.png

9a10aae298cb417be7f5aafdbf66850b.png

0041729a91ed536c54505736f96c0135.png

1dc5ed2557504570e12f116415d1b137.png

You can also select individual stocks that belong to recent popular sectors based on industry sector rotation ideas (need to superimpose "daily fundamental indicators").

7a683cd93451925859914709d6127f07.png

Other advanced QTYX analysis features can also be used by double-clicking a stock name or symbol:

ee23eb9c3f3d443057fcff426a2409e6.png

a83803b48f1a2e1892c48c476c1efcc0.png

Summarize

fac87ab82e014fc24f5c152e99dc3619.png

In terms of use, the stock pool we identified is a stock pool that has a "high probability" of producing bull stocks. Then add your own analysis factors from other dimensions and further narrow down to a few stocks as your trading targets.

At the same time, set the stop-profit and stop-loss points to ensure the overall profit-loss ratio. When you lose a little, stop the loss, and when you make a profit, you make a lot of money. This is the core gameplay of the bottom form!

Trading is actually very simple. Sometimes we lose money because we think about it too complicated!

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"

34e39169e373352773828de6654eb84b.jpeg

おすすめ

転載: blog.csdn.net/hangzhouyx/article/details/134984455