38
2016.10.16 14:37

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

15259
2016.10.19 10:25

You can use this :

int DayAgo = 14; // 14 Days ago
3342
2016.10.23 14:13
Biantoro Kunarto:

You can use this :

int DayAgo = 14; // 14 Days ago
38
2016.10.24 20:30
Biantoro Kunarto:

You can use this :

int DayAgo = 14; // 14 Days ago

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--)

{

}

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--)

{

}  ?

Thank you  for your help and best regards,

Eric

56241
2016.10.25 16:52
Eric Tschumi:

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--)

{

}

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--)

{

}  ?

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

38
2016.10.25 22:50

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

Everything is clear now ! thank you very much, Mladen !
5
2016.11.09 10:11

hello everybody,

i want to change my adx too, where do i go to put this code ?

thanks a lot.

56241
2016.11.09 10:23
squalle:

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