Seasonal and directional strength
predictMove (vars Data, int Length, int Horizon, var Percentile): var
Predicts the magnitude of a price movement, based on statistical analysis of
price changes in the Data series. Returns the given Percentile of
Data changes within the given time Horizon.
Example: if the function returns 10 at Horizon = 20 and Percentile = 95, then in 95% of all cases the Data value
moved by 10 or less in any direction within 20 bars (and therefore
moved by more than 10 only in 5% of all cases). For
statistical significance Length should be large compared to
predictSeason (vars Data, int Length, int Horizon, int Season): var
Predicts the expected price movement within a given time Horizon,
based on the current time and seasonal movement in the Data series.
Example: if the function returns 1.5 at Horizon = 20 and Season = 4, then the Data series
is expected to rise by 1.5 within 20 bars from now, based on
the annual movement at the same date in previous years. If Horizon == 0,
the function returns no price move, but the average seasonal Data
value at the current date. For statistical significance the Data
series should cover at least 3 or 4 seasons.
Predicted data change / average seasonal data.
|| A data series, usually from price functions price(), priceClose(),
||The length of the data series, normally the LookBack period.
||Price movement duration in bars.
||Price movement percentile to return, f.i. 5 for the lowest 5% or 95 for the highest 5%.
||1 for daily, 2 for weekly, 3 for monthly, or 4 for annual
StartDate = 2010;
BarPeriod = 1440;
LookBack = 300;
vars Prices = series(price());
LifeTime = 1;
var WeeklyMove = predictSeason(Prices,LookBack,LifeTime,2);
if(WeeklyMove > 0)
else if(WeeklyMove < 0)