mrtools wrote: Tue Dec 06, 2022 7:32 pm
HIGH and LOW Optimized Trend Tracker HOTT LOTT
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);
and this for the lower channel
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);
unless I am missing something please let me now, anyway, did a version too.
Thank you MrTools and Kvak for picking up on this. I had indeed corrected already some errors since then but was still aiming to debug more before posting an update.
Only saw your efforts this morning (after the daily download mention) and I yet need to drop it on a chart this evening, but MrTools can you check 1 thing:
You indicated you have incorporated the iVidya into the iCustomMa call, which sounds fine but you provide the following code:
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);
Pls confirm but I reckon the High should be looking for the maximum and therefore look like this:
Code: Select all
double hi = high[ArrayMaximum(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);
Also curious how the VidyaSmoothPeriod is handled now that the Vidya is incorporated in the iCustom call. Will see that tonight.
Furthermore, and again I need to see how it is handled this evening when I drop the indie on a chart, but I think it is lost in this latest version given that you are calling the arrays "high" and "low" which normally means you have replaced the "start"-function by the "OnCalculate"-function, which in turn would mean that the HOTTLOTT has lost the functionality (at least the one I added) of using the open and close as well as the high and low to create the channels. Is this deduction correct?
Nonetheless thank you both for pushing this one along quicker than I have managed thus far, much appreciated.
Cheers, Norbert