Wormhole007

SMA Cross with a Price Filter

Wormhole007 已更新   
A moving average strategy generates an entry (buy) signal when the price goes above the moving average, and an exit (sell) signal when the price goes below the moving average. But it gives lots of whipsaws and noise depends on the moving average we use. A fast moving average gives more whipsaws and a slow moving average gives less whipsaws. To reduce the noise/whipsaws, we can add a filter on a fast/slow moving average. It will improve entry/exit performance significantly specially for those who don't want to watch the market actively.

I created this indicator with a price filter. This means the price of an underlying asset must be at least a specific percentage above its moving average to generate a buy signal and a specific percentage below its moving average to generate a sell signal. This price filter can also be a confirmation after the price crosses above/below its SMA. I couldn't find any indicator yet based on this idea. So I wrote this indicator and publishing it so it helps those who are interested.

I use 200 SMA and 3% price filter as default and using SPY as an example. So,

ENTRY signal when the closing price of SPY is 3% above its 200 SMA.
EXIT signal when the closing price of SPY is 3% below its 200 SMA.

Enjoy and let me know if it works.

** This chart only generates entry (buy) and exit (sell) signals. Please, do your own diligence to make any investment or trading decisions.
版本注释:
A moving average strategy generates a buy signal when the price rises above the moving average and a sell signal when the price falls below it. However, this approach often results in numerous whipsaws and noise, depending on the selected moving average. Faster moving averages tend to produce more whipsaws, while slower ones generate fewer. To mitigate these issues, a filter can be applied to both fast and slow moving averages, significantly improving entry and exit performance, particularly for those who prefer a less active market monitoring approach.

I have developed an indicator that incorporates a price filter. This means a buy signal is generated only when the price of an underlying asset is at least a specific percentage above its moving average, and a sell signal is generated when it is a specific percentage below the moving average. This price filter can also serve as a confirmation after the price crosses above or below its Simple Moving Average (SMA). Notably, I have not found any existing indicators based on this concept, so I have created and published this indicator in the hopes that it proves beneficial to those interested.

As a default setting, I have used a 200 SMA with a 3% price filter, employing SPY as an example. Therefore,

An entry signal occurs when the closing price of SPY is 3% above its 200 SMA.
An exit signal occurs when the closing price of SPY is 3% below its 200 SMA.
Feel free to explore and let me know about your experience with its functionality.

Please be aware that this chart exclusively generates entry and exit signals. It is crucial to conduct your own due diligence before making any investment or trading decisions.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?