These are adaptive bands based on Ehlers' Instantaneous Trendline from ADSI and the adaptive Stdev function from ASI.
ITrend := ExtFml( "ADSI.ITrend",
MP(), .18);
diffH := HIGH - ITrend;
diffL := ITrend - LOW;
minDiff := Min(diffH,diffL);
periods := ExtFml("ADSI.CyclePeriod", MP(), .18,
.05, 1.1);
devs := 5.5 * ExtFml("ASI.Stdev", minDiff, periods,
.5);
finalDevs := If((HIGH-LOW) < devs, 1.5 *(HIGH-LOW), devs);
smoothFinalDevs := Mid(finalDevs, 3); {Just some smoothing}
UpBand := ITrend + smoothFinalDevs;
DownBand := ITrend - smoothFinalDevs;
ITrend; UpBand; DownBand; {Plot the Trendline and the Bands}
|