Type/to search

The Gaussian Moving Average Trading Strategy

Common strategy
Created: 2024-01-03 16:06:45
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy applies the idea of Gaussian distribution and calculates the Z-score based on the 10-period exponential moving average of Heikin-Ashi candlestick closing prices. The thresholds are then set based on the 20-period exponential moving average of the Z-score for entry and exit signals when the curve crosses them.

Strategy Logic

  1. Calculate the 10-period exponential moving average of Heikin-Ashi candlestick closing prices.

  2. Based on the above moving average data, calculate the Z-score over a 25-period lookback window. The Z-score reflects how many standard deviations a data point is from the mean, which can judge whether the data is normal or abnormal.

  3. Take the 20-period exponential moving average on the Z-score to get a curve called emaScore. This curve reflects the long term trend of the Z-score.

  4. Set upper and lower thresholds based on the distribution of emaScore data. Considering some fluctuations of the curve, the 90% and 10% levels are chosen as thresholds.

  5. Long when emaScore crosses middle line or lower threshold upwards. Short when emaScore crosses upper threshold, lower threshold or 100-period highest downwards.

Advantage Analysis

  1. Apply Gaussian distribution idea through Z-score to judge normality and filter false breakouts.

  2. The double exponential moving average has a filtering effect to determine long term trend.

  3. Reasonable threshold setting lowers incorrect trading probabilities.

  4. Incorporating 100-period highest/lowest points helps catch reversal opportunities.

Risk Analysis

  1. Combination of Z-score and MAs is sensitive to parameters tuning. Optimization needed.

  2. Proper threshold levels directly relate to strategy validity. Too wide or narrow will fail.

  3. 100-period highest/lowest points can easily generate wrong signals. Relax conditions appropriately.

  4. Heikin-Ashi itself has some lag. Evaluate fit for this strategy.

Optimization Directions

  1. Test different moving averages periods, Z-score lookback windows.

  2. Utilize walk forward analysis to auto optimize parameters.

  3. Try different threshold setting methods, e.g. STD multiples.

  4. Improve highest/lowest points logic to prevent wrong signals.

  5. Test other candle types or typical prices to replace Heikin-Ashi.

Summary

This strategy judges price abnormality and generates trading signals based on the idea of Gaussian distribution, double exponential moving averages and dynamic threshold setting. The main advantages are filtering false breakouts and catching reversals. However, huge impact exists regarding parameters selection and combination. Further tests and optimization are needed to find the best parameters and combinations.

Source
Pine
/*backtest
start: 2023-12-26 00:00:00
end: 2024-01-02 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/



// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jensenvilhelm
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)