FunctionPatternDecompositionLibrary "FunctionPatternDecomposition"
Methods for decomposing price into common grid/matrix patterns.
series_to_array(source, length) Helper for converting series to array.
Parameters:
source : float, data series.
length : int, size.
Returns: float array.
smooth_data_2d(data, rate) Smooth data sample into 2d points.
Parameters:
data : float array, source data.
rate : float, default=0.25, the rate of smoothness to apply.
Returns: tuple with 2 float arrays.
thin_points(data_x, data_y, rate) Thin the number of points.
Parameters:
data_x : float array, points x value.
data_y : float array, points y value.
rate : float, default=2.0, minimum threshold rate of sample stdev to accept points.
Returns: tuple with 2 float arrays.
extract_point_direction(data_x, data_y) Extract the direction each point faces.
Parameters:
data_x : float array, points x value.
data_y : float array, points y value.
Returns: float array.
find_corners(data_x, data_y, rate) ...
Parameters:
data_x : float array, points x value.
data_y : float array, points y value.
rate : float, minimum threshold rate of data y stdev.
Returns: tuple with 2 float arrays.
grid_coordinates(data_x, data_y, m_size) transforms points data to a constrained sized matrix format.
Parameters:
data_x : float array, points x value.
data_y : float array, points y value.
m_size : int, default=10, size of the matrix.
Returns: flat 2d pseudo matrix.
Decomposition
Decomposed Average True RangeThis simple script decomposes the value of the Average True Range into a bullish component and a bearish component .
The script supports two plotting methods; Mirrored and Two Lines . If Mirrored is chosen, the indicator plots the bullish component as a positive number, and the bearish component as a negative number. If Two Lines is chosen, the indicator plots two lines, both of positive values. It is the same data, just visualized differently.
Side note: This is very similar to how the strength (average gain) part in the Relative Strength Index calculation works. However, the RSI uses the realized range (close - previous close) rather than true range. If we were to use the bullish component of the ATR as the average bullish gain part in the RSI calculation, and the bearish component of the ATR as the average bearish gain part in the RSI calculation, we would get very similar (but not equal) results to the standard RSI. This shows how the ATR and the RSI are related to each other.
Combo Backtest 123 Reversal & Empirical Mode Decomposition This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The related article is copyrighted material from Stocks & Commodities Mar 2010
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Strategy 123 Reversal & Empirical Mode Decomposition This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The related article is copyrighted material from Stocks & Commodities Mar 2010
WARNING:
- For purpose educate only
- This script to change bars colors.
Empirical Mode Decomposition The related article is copyrighted material from Stocks & Commodities Mar 2010
You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...