ZVWAP Strategy Based on Z-Distance from VWAP
Overview
This strategy is based on the Z-distance from VWAP indicator by LazyBear. It uses the Z-distance between price and VWAP to determine overbought and oversold conditions, as well as entries and exits. The strategy incorporates EMA lines and Z-distance crossing 0 level to filter out some noise.
Strategy Logic
- Calculate VWAP value
- Calculate Z-distance between price and VWAP
- Set overbought line (2.5) and oversold line (-0.5)
- Go long when fast EMA > slow EMA, Z-distance < oversold line and Z-distance crosses above 0
- Close position when Z-distance > overbought line
- Incorporate stop loss logic
Key Functions:
- calc_zvwap: Calculate Z-distance between price and VWAP
- VWAP value: vwap(hlc3)
- Fast EMA: ema(close,fastEma)
- Slow EMA: ema(close,slowEma)
Advantage Analysis
- Z-distance intuitively shows overbought/oversold levels
- EMA filters out false breakouts
- Allows pyramiding to capitalize on trends
- Has stop loss logic to control risk
Risk Analysis
- Need to ensure parameters like lines, EMA periods are set properly
- Z-distance indicator lags, may miss key turning points
- Pyramiding can increase loss if trend reverses
- Stop loss needs to be set reasonably
Solutions:
- Optimize parameters via backtesting
- Add other indicators to filter signals
- Set proper conditions for pyramiding
- Use dynamic stop loss
Optimization Directions
- Optimize EMA periods
- Test different overbought/oversold criteria
- Add other indicators to filter noise
- Test different stop loss techniques
- Optimize entry, pyramiding and stop loss logic
Summary
The strategy uses Z-distance to determine price-VWAP relationship and adds EMA to filter signals, aiming to capture trend opportunities. It allows pyramiding to follow trends and has a stop loss to control risk. Optimization and adding other indicators can improve robustness. However, lagging issue of Z-distance should be considered during optimization. Overall, this is a trend-following strategy with simple, clear logic. When fully optimized, it can be an efficient tool to trade trends.
- 1

