Current location - Trademark Inquiry Complete Network - Futures platform - How to calculate MACD, DIF and DEA in futures respectively?
How to calculate MACD, DIF and DEA in futures respectively?
DIF:EMA (close, short) -EMA (close, long);

DEA:EMA(DIF, medium);

The default parameters are SHORT= 12, LONG=26, MID=9, and then close is the closing price of the day;

EMA(X, n) finds the smma of the n-day exponent of x, and the algorithm is:

If Y=EMA(X, n), then y = [2 * x+(n-1) * y']/(n+1), where y' represents the y value of the last cycle. Calculation method of KDJ k, d and j;

RSV:=(CLOSE-LLV (low, N))/(HHV (high, N)-LLV (low, n)) *100;

K:SMA(RSV,M 1, 1);

D:SMA(K,M2, 1);

j:3 * K-2 * D;

Default parameters: N=9, M 1=3, M2=3.

LLV(LOW, n) is the lowest price in n days.

HHV(HIGH, n) is the highest price in n days. As for the calculation method of SMA, it's a bit complicated, see if you need it. . As long as the daily value is substituted into the corresponding closing price, the lowest draft price can be calculated

Well, there is also a saying in the programming world that the person who writes a function may not know what the function is for, and the person who is proficient in the function may not write this function. So if we want to master these two indicators, we may not know why the authors of these two indicators write like this ... It is really complicated to understand. More complicated. I don't know if Xiao Xia's benefactor understands. . .