thomdel wrote: Sat Jun 25, 2022 3:46 am
Hi,
Attached are few ones, see this if they are useful to you.
Thanks
Thank you, but this one it's not MTF and it uses CCI, I need this other type of calculation (code below). Also the other is only ex5, I need source code, as the MT4 version has been firstly published as source code....
Code: Select all
for(int i = limit; i >= 0; i--)
{
int y = iBarShift(NULL,TimeFrame,Time[i]);
double atr = iATR(NULL,TimeFrame,period,y);
double cprice = iMA(NULL,TimeFrame,1,0,MODE_SMA,appliedPrice,y);
double mprice = (iHigh(NULL,TimeFrame,y)+iLow(NULL,TimeFrame,y))/2;
Up[i] = mprice+multiplier*atr;
Dn[i] = mprice-multiplier*atr;
Direction[i] = Direction[i+1];
if (cprice > Up[i+1]) Direction[i] = 1;
if (cprice < Dn[i+1]) Direction[i] = -1;
TrendDoA[i] = EMPTY_VALUE;
TrendDoB[i] = EMPTY_VALUE;
if (Direction[i] > 0) { Dn[i] = MathMax(Dn[i],Dn[i+1]); Trend[i] = Dn[i]; }
else { Up[i] = MathMin(Up[i],Up[i+1]); Trend[i] = Up[i]; }
if (Direction[i] == 1) TrendDoA[i] = 1;
if (Direction[i] ==-1) TrendDoB[i] = 1;
}
return(0);
}