TradingView
DasanC
18 фев 2019 г., 00:24

Signal to Noise Ratio [SNR] 

USD/JPYOANDA

Описание

Intro
This script measures the Signal to Noise ratio of a security and plots it in deciBels scale!

Usage
Ideally, you would want the ratio to be above 10 dB, meaning the Signal strength is 10x the noise strength.
As a baseline, you should not rely on indicators that use any kind of moving average if the SNR is below 6 dB - meaning Signal strength is only 4x noise strength.

I've written the SNR as a functional block so you may simply copy and paste, then call getSNR() to get the ratio in dB.

Principle
I consider a bar's High and Low to be the range of that period and (High + Low)/2 to be the "real" value of the signal.
This script compares a bars range (noise) to the perceived signal using a Hilbert Transform.

Cheers,
DasanC

Информация о релизе

Changed the visual styles. You can drop this code snippet into another indicator and changed the transparency settings to have it in the background!
Комментарии
chrysopoetics
Thank you very much for your work brother. It always goes appreciated.
Glamours
How to use it? Any example?
X3EM
ChatGPT explains:
High SNR (Above 10 dB): When the SNR is above 10 dB (and the area is navy in the script), this generally means that the signal is strong compared to the noise. In simple terms, the stock price is moving in a more predictable and stable manner. This might be a good time to consider trading that stock using other indicators to look for buy or sell signals, as the high SNR suggests that those signals will be more reliable.

Medium SNR (Between 6 and 10 dB): When the SNR is between 6 and 10 dB (and the area is orange in the script), it's a cautionary zone. The price is not as stable as you might like, but it's not super noisy either. You might want to proceed with caution, perhaps reducing the size of your trades or waiting for other indicators to confirm a trading decision.

Low SNR (Below 6 dB): If the SNR is below 6 dB (and the area is red in the script), the noise is almost as strong as the signal. This means the stock price is pretty volatile and less predictable. It's generally advisable to avoid trading based solely on indicators, especially those based on moving averages, in such a noisy environment.

So, while the SNR itself is not a buy or sell signal, it serves as a "quality filter" for your other indicators:

For example, if you're using a moving average crossover strategy and you see that the SNR is above 10 dB, you might feel more confident taking a buy or sell signal from that strategy.
On the flip side, if the SNR is below 6 dB, you might decide to ignore the signals from your moving average crossover strategy because they are likely to be less reliable.
In summary, a high SNR can give you the confidence to trust other trading signals, while a low SNR might suggest that you should be more cautious and skeptical of other indicators.
allanster
Great stuff, turn it up!
scarf
Excellent idea and implementation, thanks
Ещё