Research and development of high frequency trading algorithm--rsi index and its application
In the previous article we mentioned the MA Ema (including Ema,sma), MACD, and SAR indicators, there is a common feature of these three types of indicators, namely: from the fixed-period price as the guiding ideology of interpretation, and the price is smoothed, and then obtain a reference to the interpretation results .
Today we change our minds and consider the problem from a market perspective, and at the same time, to talk about RSI indicators.
1. Indicator Definition
RSI: Relative Strength Index (Relative strength index)is a technical curve based on the ratio of the rise points and the sum of the points in a given period. Can reflect the market in a certain period of economic prosperity. The pseudo function of its n-day is defined as follows:
Double RSI (int N) { //1. First calculates the total rise price of N days Double totalup = Gettotalup (N); // 2. Then calculates the total fall price for n days (the value is absolute) Double Totaldown = Gettotaldown (N); // 2. Calculate the RSI, i.e.: the ratio of total increase to the total change price Double RSI = (totalup)/(Totalup + totaldown); return rsi; }
Note: The above formula evaluates to a different value than what you see in common software, and the results displayed in the common software are multiplied by 100 so that the result is displayed in the following range: [0~100].
Described by the above formula, crossing are not difficult to find, in fact, the RSI indicator is the use of the market to buy cabbage , namely:
- If the rate of increase in the number of total changes in the proportion of the relatively small (most of the situation is down), then it may be higher prices.
- If the rate of increase in the price of the total change in the proportion of the larger (in most cases, rising), then may be reduced.
- Because the calculation is achieved by means of a ratio, the value range is [0,1], so it is suitable for programming quantization.
2. how to apply
In general, the RSI can be interpreted in the following two ways:
- The upper and lower bounds of a short periodic line
Whether crossing are doing software, you will understand that a computer CPU usage is too high, it must not be normal state, to be careful whether the CPU will burn, if the CPU usage is too low (server), you will consider, I spend more money.
In the same way, a sustained increase in the proportion of high or low, represents the current market in a high or low temperature unstable state. Refer to the Baidu Encyclopedia, generally identified [70%~80%] as the upper limit reference point for the sale, [20%~30%] for the lower limit of the buy reference point, while in the middle ratio, for the ambiguous point, you can wait and see, as follows:
Operation |
RSI interval |
Overbought (Buy) |
Extreme situation: [0%~10%] |
Normal condition: [10%~20%] |
Watching |
[30%~70%] |
Oversold (Sell) |
Normal condition: [80%~90%] |
Extreme situation: [90%~100%] |
Typical characteristics of its application are as follows:
- Judging by the cross-over between short and long periods
This method is the same as the interpretation of the MA moving average crossing, i.e.:
When the short-period moving averages wear long cycle lines, the overall trend is declining and can be sold.
When the short-period moving averages wear long cycle lines, the overall trend is long and can be bought.
The typical characteristics are as follows:
- 3. Summary
By observing a few of the above graphs, it is easy to see that the short cycle line fluctuations of the RSI are very large, so it is best not to crossing the RSI as the main interpretation indicator.
This article only describes the RSI pseudo-algorithm, the user can call Warensoft Stock service to implement the algorithm, in the 2017.1.12 version of the client driver, has added the algorithm's calling interface, welcome to test and feedback.
Scientists
Email:[email protected]
: 43175692
Research and development of high frequency trading algorithm--rsi index and its application