Type/to search

Cross Timeframe Hull Moving Average Buy Sell Strategy

Cryptocurrency
Created: 2023-11-07 16:54:14
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This strategy is based on the Hull Moving Average indicator, calculating Hull MA on different timeframes and comparing the Hull MA trends across timeframes to identify trend changes. It generates buy signals when the shorter period Hull MA crosses above the longer period Hull MA, and sell signals when the shorter Hull MA crosses below the longer one.

Strategy Logic

  1. Input parameters: Hull MA period Period, HMA2 timeframe Resolution2, HMA3 timeframe Resolution3

  2. Calculate current bar's Hull MA value HMA

  3. Calculate Hull MA value HMA2 on Resolution2 timeframe

  4. Calculate Hull MA value HMA3 on Resolution3 timeframe

  5. Compare the magnitude relationship between HMA, HMA2, HMA3

  6. Generate buy signal when HMA>HMA2>HMA3

  7. Generate sell signal when HMA<HMA2<HMA3

  8. Display Hull MA values and signals on different timeframes on top left of chart

  9. Use colors to distinguish uptrend and downtrend

Advantage Analysis

  1. Using multiple timeframes can filter false breakouts and avoid traps.

  2. Customizable timeframe parameters, adaptable to different periods and volatility.

  3. Real-time signal display, intuitive operation.

  4. Visualized Hull MA trends help determine current trend.

Risk Analysis

  1. Improper parameter settings may cause over-trading.

  2. Larger timeframe Hull MA has lagging effect, may miss trend turning points.

  3. May generate false signals around bull-bear transition.

  4. Breakout strategies are prone to getting trapped by false breakouts.

  5. Trading commissions are not considered which impacts actual profit.

Risks can be reduced by optimizing parameters, combining other indicators for filtration, and allowing wider stop loss.

Optimization Directions

  1. Optimize Hull MA period adaptable to different periods and volatility.

  2. Add volume indicator to avoid false breakouts.

  3. Add oscillators to determine trend strength.

  4. Incorporate machine learning models for buy/sell timing.

  5. Combine sentiment indicators to detect market hype.

  6. Adjust stop loss strategy for better risk management.

  7. Customize buy/sell conditions with other indicator signals.

  8. Add price channel or wave based trading strategies.

Conclusion

This strategy uses multi-timeframe Hull MA to determine trend direction by comparing moving average slopes across timeframes and generates signals at trend reversals. Multi-timeframe Hull MA is more effective in filtering false breakouts than single MA. But this strategy also has limitations in parameter tuning, trend determination etc. Integrating more indicators, optimizing parameters, improving stop loss can enhance profitability and control risk.

Source
Pine
/*backtest
start: 2023-10-07 00:00:00
end: 2023-11-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
//
strategy("wtfBUYorSELLffs",overlay=true,currency="USD",initial_capital=100000,default_qty_type=strategy.percent_of_equity,default_qty_value=100,commission_type=strategy.commission.percent,commission_value=0.1)
Period=input(title="Hull MA Period",type=input.integer,defval=6,minval=1)
Strategy parameters
Strategy parameters
Hull MA Period
HMA2 Resolution
HMA3 Resolution
Source of Price
Panel offset (X-Axis)
Panel offset (y-Axis)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)