The HOTT LOTT is based off Anıl Özekşi's OTT - Optimized Trend Tracker.
This particular version has two lines of Optimized Trend Tracker which uses the HIGHEST price values (HOTT) and LOWEST price values (LOTT). The difference with this version is that the OTT uses a CLOSE price.
Guys I don't think this part is right for the upper channel
Code: Select all
if (MaType==ma_vidya) valH[i] = iVidya(MathMax(iHigh(NULL,0,iHighest(NULL,0,(int)PriceH,HLPeriod,i)),iHigh(NULL,0,iHighest(NULL,0,(int)PriceL,HLPeriod,i))),MaLength,VidyaSmoothPeriod,i,0);
else valH[i] = iCustomMa(MaType,MathMax(iHigh(NULL,0,iHighest(NULL,0,(int)PriceH,HLPeriod,i)),iHigh(NULL,0,iHighest(NULL,0,(int)PriceL,HLPeriod,i))),MaLength,i,Bars,0);
Code: Select all
if (MaType==ma_vidya) valL[i] = iVidya(MathMin(iLow(NULL,0,iLowest(NULL,0,(int)PriceH,HLPeriod,i)),iLow(NULL,0,iLowest(NULL,0,(int)PriceL,HLPeriod,i))),MaLength,VidyaSmoothPeriod,i,1);
else valL[i] = iCustomMa(MaType,MathMin(iLow(NULL,0,iLowest(NULL,0,(int)PriceH,HLPeriod,i)),iLow(NULL,0,iLowest(NULL,0,(int)PriceL,HLPeriod,i))),MaLength,i,Bars,1);
I did something like this
Code: Select all
double hi = high[ArrayMinimum(high,HLPeriod,i)];
double lo = low[ArrayMinimum( low,HLPeriod,i)];
wrk[r].valH = iCustomMa(MaType,hi,MaLength,i,rates_total,0);
wrk[r].valL = iCustomMa(MaType,lo,MaLength,i,rates_total,1);