Data | A data series, usually from price functions price(), priceClose(), |
Length | The length of the data series, normally the LookBack period. |
Horizon | Price movement duration in bars. |
Percentile | Price movement percentile to return, f.i. 5 for the lowest 5% or 95 for the highest 5%. |
Season | 1 for daily, 2 for weekly, 3 for monthly, or 4 for annual seasons. |
function run()
{
StartDate = 2010;
BarPeriod = 1440;
LookBack = 300;
vars Prices = series(price());
if(!is(LOOKBACK)) {
LifeTime = 1;
var WeeklyMove = predictSeason(Prices,LookBack,LifeTime,2);
if(WeeklyMove > 0)
enterLong();
else if(WeeklyMove < 0)
enterShort();
}
}