该弹性加权移动平均交叉策略Overall, this elastic weighted moving average cross strategy通过计算并让双EVWMA线交叉操作,可以有效发现趋势变化,产生交易信号。策略简单易行,但存在一些风险及优化方向。通过优化止损机制、参数选择、结合其他指标等手段,可以强化该策略,使其更适应实盘交易。总体来说,该策略为移动平均交叉类策略的有益探索,值得进一步研究与应用。
||
## Overview
This strategy uses two EVWMA lines with different periods to generate crossovers and produce buy and sell signals. When the short period line crosses over the long period line, it generates a buy signal. When the short period line crosses below the long period line, it generates a sell signal.
## Strategy Logic
The strategy identifies trend changes by calculating and crossing two EVWMA lines with different periods.
Specifically, it first calculates two EVWMA lines:
1. Short period line m1, with period length1, default to 5
2. Long period line m2, with period length2, default to 40
It then uses the crossover and crossunder functions to determine the crossover situations between m1 and m2:
- If m1 crosses over m2, it generates a buy signal and executes long operation
- If m1 crosses below m2, it generates a sell signal and executes short operation
Note that EVWMA gives more weight to recent data compared to simple moving average. The calculation formula is:
```
data = (nz(data[1]) * (nb_floating_shares - volume)/nb_floating_shares) + (volume_price/nb_floating_shares)
```
Where nz(data[1]) is the EVWMA value of previous period, nb_floating_shares is total volume of the period, volume is current period volume, and volume_price is current period turnover. This achieves the effect of assigning higher weights on recent data.
## Advantage Analysis
The advantages of this strategy include:
1. EVWMA responds faster to price changes and improves profit opportunities
2. Crossover of dual EVWMA lines identifies turning points timely
3. Simple logic and easy to implement
4. Customizable period lengths to adapt different market environments
5. No complex parameter optimization needed and easy for live trading
## Risks and Solutions
There are also some risks with this strategy:
1. Crossovers may generate excessive invalid signals without filtering market noise
- Solution: Combine with volume or other indicators to filter signals
2. Hard to identify trend reversal points and risks missing reversals
- Solution: Adjust period parameters or add other reversal indicators
3. No stop loss or take profit, unable to effectively control risks
- Solution: Set proper stop loss and take profit ratios based on historical data and volatility
4. Insufficient parameter optimization leads to improper period settings
- Solution: Optimize parameters through backtesting and choose proper lengths
## Improvement Directions
Some directions to improve the strategy:
1. Add stop loss and take profit to strictly control risks
2. Optimize period lengths to find the best parameters
3. Add volume filter to reduce invalid trades
4. Combine with reversal indicators to avoid missing reversals
5. Dynamically optimize parameters based on market changes
6. Differentiate bull and bear markets and use different parameters
7. Introduce machine learning models to determine trading timing based on big data
## Conclusion
In summary, this EVWMA cross strategy can effectively identify trend changes and generate trading signals by calculating and crossing dual EVWMA lines. The logic is simple but there are risks and improvement directions. By optimizing stop loss, parameter selection, integrating other indicators etc, the strategy can be strengthened for live trading. Overall, this is a beneficial exploration of moving average cross strategies and worth further research and application.