SF09 | Source code of capital flow trading strategy, outstanding performance, strong adaptability and compatibility, 5-minute short-term trading model;

 Share quantitative strategies, training videos, Python, algorithm research and other related content.

Brief summary:

There are many factors affecting price changes, such as the global economic environment, regional conflicts, important political and economic events, interest rates, natural disasters, diseases and plagues; such as domestic policies, variety supply and demand, circulating inventory, upstream and downstream industries; so many factors In the end, it will be reflected in the price. It is a huge project that is difficult to complete by simply relying on a little manpower and material resources to master and utilize so many factors. According to the original idea of ​​technical analysis, ultimately all factors will be reflected in the price. Volume and price are the basic elements of technical analysis. Our model uses volume and price to build trading strategies, and the use of volume is particularly important.

Changes in open interest (fund flow):   

In the futures market, the open interest refers to the sum of the bought (or sold) positions before the open positions are closed, and generally refers to the sum of the open contracts in the buying and selling direction, so it is generally an even number. Change can analyze the size, change and update of long and short power in the market, thus becoming one of the technical analysis indicators different from stock investment.

In the technical analysis of futures graphics, the interaction between trading volume and open interest is very important. Correctly understanding the relationship between trading volume and open interest changes can more accurately grasp the combination of graphical K-line analysis, which is conducive to in-depth understanding of market language.

Flow of funds calculation method:

  1. Active inflow: the sum of the open interest * (volatility) in the LENTH period when the statistical CC[1] is greater than 0;

  2. Active outflow: the sum of open interest * (volatility) within the LENTH period when the statistical CC[1] is less than 0;

  3. Calculate the sum ratio of active inflow and outflow in X period and convert it to percentage;

Among them, it is necessary to calculate the value of each past variable in the cycle, present dynamic iteration, and use FOR loop to process;

Conditional logic:

  1. The price rises, and at the same time, the net inflow of capital initiative per unit time;

  2. The price rises, and at the same time, there is a net outflow of capital initiative within a unit time;

  3. The price falls, and at the same time, there is a net inflow of capital initiative within a unit time;

  4. The price falls, and at the same time, there is a net outflow of capital initiative within a unit time;

Disadvantages improvement:

  1. The simple usage of energy indicators will lead to wrong trend judgment, frequent false signals, and poor trading results. Therefore, we have added the conditional factors of price trends, capital management, and risk management;

The strategy module consists of:

    1. Active energy calculation module;

    2. Price trend judgment module;

    3. Floating profit withdrawal and take profit module;

    4. Mobile chandelier dynamic take profit and stop loss module;

Test performance:

        

The strategy is applicable to active targets: stock indexes, some industries, agriculture, chemicals, non-ferrous metals, etc.;

 This strategy is only used for learning and communication, and investors are personally responsible for the profit and loss of real trading.

Guess you like

Origin blog.csdn.net/m0_56236921/article/details/123106262