This is the function i have created, however after i run the backtest to check if this is working, it seems that the function i replaced does not work well, what is being wrong with this ?
double iAroonDown(int AroonPeriod, int index) {
int LastBars = 0;
double AroonDnBuffer[];
double AroonDn;
int ArPer,limit,i;
int UpBarDif,DnBarDif;
int counted_bars=IndicatorCounted();
ArPer=AroonPeriod; //Short name//---- check for possible errorsif(counted_bars<0) return(-1);
if(AroonPeriod<1) return(-1);
//---- initial zeroif(counted_bars<1)
{
for(i=1;i<=ArPer;i++) AroonDnBuffer[Bars-i]=0.0;
}
//---- last counted bar will be recountedif(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----Calculation---------------------------for( i=0; i<limit; i++)
{
int LL = Lowest(NULL,0,MODE_LOW,ArPer,i); //Periods from LL
DnBarDif = i-LL; //Period substraction
AroonDnBuffer[i]=100+(100/ArPer)*(DnBarDif); //Adjusted Aroon Downif (LastBars != Bars)
{
LastBars = Bars;
}
}
return AroonDnBuffer[index];
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I have the following custom indicators "Aroon_Up_Down.mq4"
In the EA it is being used like this (iCustom(NULL,0, "Aroon_Up_Down", 38, false, false, 1, 2)
What i want to do is that I want to merge "Aroon_Up_Down.mq4" Into EA.
What i understand is that iCustom will call Aroon_Up_Down.mq4 and the following highlighted code here
iCustom(NULL,0, "Aroon_Up_Down", 38, false, false, 1, 2)
I understand that It means that it will get the value from AroonDnBuffer
Since in the indicators the code is being set as
And number 2 is index array
I tried to make a simple replacement for a function call so instead of
I Use
This is the function i have created, however after i run the backtest to check if this is working, it seems that the function i replaced does not work well, what is being wrong with this ?