Understand the Tongdaxin indicator formula in one article

What is the indicator formula?

Indicator formula is a formula programming language built into software such as Tongdaxin, Flush, and Great Wisdom. It is mainly used to write technical indicators, stock selection formulas, trading systems and other functions for stocks and futures markets. The indicator formula is easy to learn, powerful, and flexible to use. It provides a rich library of functions and indicators, including commonly used moving averages, MACD, KDJ, RSI, BOLL and other indicators, as well as commonly used mathematical, logical, string and other functions. . Investors can customize variables and functions to expand them according to their own needs and habits, and can also be used to implement their own trading strategies.

The functions of indicator formulas are as follows:

  • Technical indicator drawing: By performing certain calculations on the data, the output results of the technical indicators are intuitively displayed on the analysis chart to facilitate investors to analyze and judge the market.
  • Conditional stock selection: Use the conditional stock selection formula to select stocks that meet certain technical forms and output a list of target stocks.
  • Trading system: Used to indicate buying points and selling points. The indicator formula that meets the requirements can also be used for backtesting
  • Colorful K-line: assign color to the continuous K-line form that meets the conditions, which is different from other K-line colors.

Some friends may want to ask, since you already have python, why do you need to understand the indicator formula? The main reasons are:

  • Tongdaxin, Flush, Great Wisdom, Oriental Fortune, Mandarin and many other software support indicator formulas
  • There are a large number of excellent strategies on the Internet that are implemented using indicator formulas. After understanding them, it will be easier to learn and communicate.
  • Compared with python, the indicator formula is much simpler and more direct, suitable for friends who have no programming foundation.
  • Some quantitative systems also support directly calling indicator formulas for quantitative trading, such as qmt, etc.

Introduction to indicator formulas

In order to facilitate users to use, the indicator formulas supported by Tongdaxin, Flush, Great Wisdom, Oriental Fortune, Mandarin, etc. are not much different. The following is an example of the Tongdaxin formula. Tongdaxin formula system provides many functions that can be called in strategies. The function categories it supports include market functions, financial functions, calculation functions, trading functions and other functions.

The specific categories are as follows:

  • Serial market function: For example, HIGH/H represents the highest price
  • Real-time market function: such as DYNAINFO(28) means buying price
  • Fund flow function: For example, TRADENUM represents the total number of transactions
  • Shape function: For example, COST(10) indicates the price of 10% profit order.
  • Plate function: For example, CODE returns the product code
  • Index underlying function: For example, INDEXA represents the trading volume of the market
  • Professional financial functions: such as FINVALUE represents professional financial data (sequence)
  • Related financial functions: For example, FINANCE(1) represents the total share capital (10,000 shares)
  • Logical function: For example, CROSS(A, B) means that when A crosses B from bottom to top, it returns 1, otherwise it returns 0;
  • Selection function: IF represents conditional judgment
  • Mathematical functions: For example, COS(X) returns the cosine value of X, and MAX means finding the maximum value.
  • Statistical function: For example, STD(X, N) returns the estimated standard deviation
  • Operator functions: such as +, -, *, etc.
  • Trading signal function: For example, BUY means buying and opening a position
  • Account function: For example, TOTALPOSITION represents total positions
  • Time function: For example, DATE represents date
  • Reference function: For example, COUNT(X, N) means counting the number of periods that meet the conditions; REF(X, A) means referencing the X value before period A
  • Drawing function: such as DRAWKLINE to draw K line
  • Line shape and color attributes: such as COLORBLUE to draw blue

Indicator formula example

Take the moving average long arrangement indicator formula as an example. The long moving average arrangement refers to the order from short period to long period moving average, arranged in order from top to bottom. The following is the code implementation. In the code, each line of code is followed by comments. Use {I am a comment} to implement. Note: The flush formula annotation method is different, you need to use // annotation

AA:=MA(CLOSE,5); {短周期均线}
BB:=MA(CLOSE,10); {中周期均线}
CC:=MA(CLOSE,30); {长周期均线}
T1:=AA>BB AND BB>CC; {中周期均线大于短周期均线 且 长周期均线大雨中周期均线}
COUNT(T1,4)=4; {COUNT(X,N)表示统计在N天内满足条件X的有几天}

It can be seen that the moving average long arrangement implemented by the indicator formula is very simple. You will be able to see the stock selection results after a while after execution. Click on the first result to see that the moving averages are arranged in a long position for 4 consecutive days. As shown in the picture at the beginning of the article, the results are in line with expectations.

Conclusion & Communication

Follow the public account: Zhuge Shuo Talk to get more interesting content.

Writing articles is not easy. If you think this article is helpful to you, please help me like and repost it so that I can have the motivation to keep writing good articles and better help my friends.

Guess you like

Origin blog.csdn.net/richardzhutalk/article/details/130475337