You can use this :
int ADXPeriod = 14;
double ADXValue14Ago = iADX(Symbol(),PERIOD_D1,ADXPeriod,PRICE_CLOSE,MODE_MAIN,DayAgo);
You can use this :
int ADXPeriod = 14;
double ADXValue14Ago = iADX(Symbol(),PERIOD_D1,ADXPeriod,PRICE_CLOSE,MODE_MAIN,DayAgo);
You can use this :
int ADXPeriod = 14;
double ADXValue14Ago = iADX(Symbol(),PERIOD_D1,ADXPeriod,PRICE_CLOSE,MODE_MAIN,DayAgo);
Thank you very much Biantoro,
Ok, I suppose this for the last bar of the current chart. For all the current chart I think the formula will be :
for (int i=Bars-1;i>=0;i--)
{
adx[i]=iADX(Symbol(),PERIOD_D1,ADXPeriod,PRICE_CLOSE,MODE_MAIN,i-14);
}
Is it right ?
But now, if I want the formula is applicable for all the timeframe :
How to write this formula ?
int 4HourAgo = ?
int HourAgo = ?
int 5MinuteAgo = ?
int MinuteAGo = ?
->
for (int i=Bars-1;i>=0;i--)
{
adx[i]=iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,i-???);
} ?
Thank you for your help and best regards,
Eric
Thank you very much Biantoro,
Ok, I suppose this for the last bar of the current chart. For all the current chart I think the formula will be :
for (int i=Bars-1;i>=0;i--)
{
adx[i]=iADX(Symbol(),PERIOD_D1,ADXPeriod,PRICE_CLOSE,MODE_MAIN,i-14);
}
Is it right ?
But now, if I want the formula is applicable for all the timeframe :
How to write this formula ?
int 4HourAgo = ?
int HourAgo = ?
int 5MinuteAgo = ?
int MinuteAGo = ?
->
for (int i=Bars-1;i>=0;i--)
{
adx[i]=iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,i-???);
} ?
Thank you for your help and best regards,
Eric
Yes, that would be the correct formula
For the rest : use this general formula
and (in that format) it will try to find the first bar with that desired time (approximations will happen if the exact time does not match) and return the value of adx for that bar
Yes, that would be the correct formula
For the rest : use this general formula
and (in that format) it will try to find the first bar with that desired time (approximations will happen if the exact time does not match) and return the value of adx for that bar
hello everybody,
i want to change my adx too, where do i go to put this code ?
thanks a lot.
hello everybody,
i want to change my adx too, where do i go to put this code ?
thanks a lot.
You have to have a custom indicator for that
You can not change the built in indicators
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
Can somebody indicate me how is it possible to get an array with ADX(14 days ago) for all the bars of current chart (MQL4) ?
Thank you very much in advance !
Eric