The double moving average line strategy, by establishing the m-day and n-day moving average line, which these two moving average lines must have intersections during the price moves. If m>n, the n-day moving average line “up cross” m-day moving average is the buying point, and vice versa. This strategy is based on the intersection of different days of moving averages, grasping the strong and weak moments of the trading pairs, and execute trading. The short-period moving average up cross long-period moving average is called “Buying Point” and vice versa. Ok, now we can build a simple strategy: buying when up cross, selling when down cross.
Now we will use the Chinese commodity future rebar index 15 minutes K line as the data source for backtesting. let's take a look of the power of the moving average.
Single moving average strategy
The single moving average can also engage in strategy. In fact, it is a variant of the double moving average. The current price will be treat as one of the moving averages.
CROSS(C,MA5),BK;
CROSSDOWN(C,MA5),SP;
AUTOFILTER;
1.Simple double moving average line strategy
MA10:=MA(CLOSE,10);
CROSS(MA5,MA10),BK;
CROSSDOWN(MA5,MA10),BP;
CROSS(MA10,MA5),SK;
CROSSDOWN(MA10,MA5),SP;
AUTOFILTER;
2.Small improvement of the double moving average
MA10:=MA(CLOSE,10);
CROSS(MA5,MA10)&&MA10>REF(MA10,1)&&REF(MA10,1)>REF(MA10,2)&&MA5>REF(MA5,1)&&REF(MA5,1)>REF(MA5,2),BK;
CROSSDOWN(MA5,MA10),BP;
CROSS(MA10,MA5)&&MA10CROSSDOWN(MA10,MA5),SP;
AUTOFILTER;
The final backtest results performed well:
3.Moving average line difference strategy
MA2:=EMA(MA1,9);//Calculate the average of the 9-cycle MA1 index
MA3:=MA1-MA2;//Calculate the difference between MA1 and MA2 as MA3
MA4:=(MA(MA3,3)*3-MA3)/2;//Calculate difference of 3 times the average of 3 cycles of MA3 and half of the MA3
MA3>MA4&&C>=REF(C,1),BPK;//When MA3 is greater than MA4 and the closing price is not less than the closing price of the previous K-line, close position and open long position
MA3
When the current value of MA3 is greater than the average of the previous two periods, buy long, here added a filter condition that the current price is greater than the previous K-line closing price, which improves the winning rate. You can try it yourself.
The effect of removing this condition has little effect. The specific backtest results are as follows:
4.Three moving average line strategy
With the double moving average line, we will naturally think of the results of the three moving averages, and the three moving averages have more filtering conditions.
MA2: MA (C, 30);
MA3: MA (C, 90);
MA1>MA2&&MA2>MA3, BPK;
MA1
Through the introduction of the previous five strategies, we can see how the average line strategy evolves. The single moving average strategy is easy to trigger repeatedly. It is necessary to increase the filtering conditions. Different conditions produce different strategies, but the nature of the moving average strategy has not changed. The short-period represents the short-period trends, long period represent long-period trends, and crossing represents a breakthrough in trends.
With these strategies as examples, it is estimated that readers can easily inspire their own moving average improvements.
(pics won't show on this post, for the full version, please check it here: https://www.fmz.com/bbs-topic/2806)