AutomatedTradingAlgorithms

Fourier Smoothed Hybrid Volume Spread Analysis

Indicator id:
USER;91bdff47320b4284a375f428f683b21e
(only relevant to those that use API requests)

MEANINGFUL DESCRIPTION:
The Fourier Smoothed Hybrid Volume Spread Analysis (FSHVSA) indicator is an innovative trading tool designed to fuse volume analysis with trend detection capabilities, offering traders a comprehensive view of market dynamics.

This indicator stands apart by integrating the principles of the Discrete Fourier Transform (DFT) and volume spread analysis, enhanced with a layer of Fourier smoothing to distill market noise and highlight trend directions with unprecedented clarity.

This smoothing process allows traders to discern the true underlying patterns in volume and price action, stripped of the distractions of short-term fluctuations and noise.

The core functionality of the FSHVSA revolves around the innovative combination of volume change analysis, spread determination (calculated from the open and close price difference), and the strategic use of the EMA (default 10) to fine-tune the analysis of spread by incorporating volume changes.

Trend direction is validated through a moving average (MA) of the histogram, which acts analogously to the Volume MA found in traditional volume indicators. This MA serves as a pivotal reference point, enabling traders to confidently engage with the market when the histogram's movement concurs with the trend direction, particularly when it crosses the Trend MA line, signalling optimal entry points.

It returns 0 when MA of the histogram and EMA of the Price Spread are not align.

HOW TO USE THE INDICATOR:

The FSHVSA plots a positive trend when a positive Volume smoothed Spread and EMA of Volume smoothed price is above 0, and a negative when negative Volume smoothed Spread and EMA of Volume smoothed price is below 0. When this conditions are not met it plots 0.

ORIGINALITY & USEFULNESS:

The FSHVSA is unique because it applies DFT for data smoothing, effectively filtering out the minor fluctuations and leaving traders with a clear picture of the market's true movements. The DFT's ability to break down market signals into constituent frequencies offers a granular view of market dynamics, highlighting the amplitude and phase of each frequency component. This, combined with the strategic application of Ehler's Universal Oscillator principles via a histogram, furnishes traders with a nuanced understanding of market volatility and noise levels, thereby facilitating more informed trading decisions.

DETAILED DESCRIPTION:

My detailed description of the indicator and use cases which I find very valuable.


What is the meaning of price spread?

In finance, a spread refers to the difference between two prices, rates, or yields. One of the most common types is the bid-ask spread, which refers to the gap between the bid (from buyers) and the ask (from sellers) prices of a security or asset.

We are going to use Open-Close spread.


What is Volume spread analysis?

Volume spread analysis (VSA) is a method of technical analysis that compares the volume per candle, range spread, and closing price to determine price direction.


What does this mean?

We need to have a positive Volume Price Spread and a positive Moving average of Volume price spread for a positive trend. OR via versa a negative Volume Price Spread and a negative Moving average of Volume price spread for a negative trend.

What if we have a positive Volume Price Spread and a negative Moving average of Volume Price Spread?
It results in a neutral, not trending price action.

Thus the indicator returns 0.

In the next Image you can see that trend is negative on 4h, neutral on 12h and neutral on 1D. That means trend is negative.

I am sorry, the chart is a bit messy. The idea is to use the indicator over more than 1 Timeframe.

What is approximation and smoothing?

They are mathematical concepts for making a discrete set of numbers a
continuous curved line.

Fourier and Euler approximation of a spread are taken from aprox library.

Key Features:

Noise Reduction leverages Euler's White noise capabilities for effective Volume smoothing, providing a cleaner and more accurate representation of market dynamics.

Choose between the innovative Double Discrete Fourier Transform (DTF32) and Regular Open & Close price series.

Mathematical equations presented in Pinescript:

Fourier of the real (x axis) discrete:

x_0 = array.get(x, 0) + array.get(x, 1) + array.get(x, 2)
x_1 = array.get(x, 0) + array.get(x, 1) * math.cos( -2 * math.pi * _dir / 3 ) - array.get(y, 1) * math.sin( -2 * math.pi * _dir / 3 )  + array.get(x, 2) * math.cos( -4 * math.pi * _dir / 3 ) - array.get(y, 2) * math.sin( -4 * math.pi * _dir / 3 )
x_2 = array.get(x, 0) + array.get(x, 1) * math.cos( -4 * math.pi * _dir / 3 ) - array.get(y, 1) * math.sin( -4 * math.pi * _dir / 3 )  + array.get(x, 2) * math.cos( -8 * math.pi * _dir / 3 ) - array.get(y, 2) * math.sin( -8 * math.pi * _dir / 3 )

Fourier of the imaginary (y axis) discrete:

y_0 = array.get(x, 0) + array.get(x, 1) + array.get(x, 2)
	y_1 = array.get(x, 0) + array.get(x, 1) * math.sin( -2 * math.pi * _dir / 3 ) + array.get(y, 1) * math.cos( -2 * math.pi * _dir / 3 )  + array.get(x, 2) * math.sin( -4 * math.pi * _dir / 3 ) + array.get(y, 2) * math.cos( -4 * math.pi * _dir / 3 )
	y_2 = array.get(x, 0) + array.get(x, 1) * math.sin( -4 * math.pi * _dir / 3 ) + array.get(y, 1) * math.cos( -4 * math.pi * _dir / 3 )  + array.get(x, 2) * math.sin( -8 * math.pi * _dir / 3 ) + array.get(y, 2) * math.cos( -8 * math.pi * _dir / 3 )

Euler's Smooth with Discrete Furrier approximated Volume.

a = math.sqrt(2) * math.pi / _devided
	b = math.cos(math.sqrt(2) * 180 / _devided)
	c2 = 2 *  math.pow(a, 2) * b
	c3 = math.pow(a, 4)
	c1 = 1 - 2 *  math.pow(a, 2) * math.cos(b) + math.pow(a, 4)

	filt := na(filt[1]) ? 0 : c1 * (w + nz(w[1])) / 2.0  + c2 * nz(filt[1]) + c3 * nz(filt[2])


Usecase:

First option:
Leverage the script to identify Bullish and Bearish trends, shown with green and red triangle.
Combine Different Timeframes to accurately determine market trend.

Second option:
Pull the data with API sockets to automate your trading journey.

plot(close, title="ClosePrice", display=display.status_line)
plot(open, title="OpenPrice", display=display.status_line)
plot(greencon ? 1 : redcon ? -1 : 0,  title="position", display=display.status_line)

Use ClosePrice, OpenPrice and "position" titles to easily read and backtest your strategy utilising more than 1 Time Frame.

Indicator id:
USER;91bdff47320b4284a375f428f683b21e
(only relevant to those that use API requests)
Phát hành các Ghi chú:
Updated Signal plot.

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?