Seasonal and directional strength
move(vars Data, int Length, int Horizon, var Percentile): var
Returns the price move within a given time horizon in percent, based on the given percentile of all such price moves in the Data series.
Example: if the function returns 10 at Horizon = 20 and Percentile = 95, then in 95% of all cases the Data value rised by 10% or less within 20 bars (and therefore rised by more than 10% in 5% of all cases). Uses the Percentile function. Generates a series and therefore must be called in a fixed order in the script.
season(vars Data, int Length, int Horizon, int Season): var
Returns the price move within a given time horizon in percent, based on the current time/date and the average seasonal move in the Data series. For instance, if the function returns 10 at Horizon = 20 and Season = 4, then the Data series rised by an average 10% within 20 bars after the current time/date in the past years.
|| A data series, usually from price functions price(), priceClose() etc.
||The length of the data series, f.i. the LookBack period.
||The price change duration in bars.
||The price changes 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 changes.
- Source code in indicators.c.
StartDate = 2010;
BarPeriod = 1440;
LookBack = 252; // 1 year
vars Prices = series(price());
LifeTime = 1;
var Season = season(Prices,LookBack,LifeTime,2);
if(Season > 0)
else if(Season < 0)