Hi


I have a request about something that i'm sure many MT4/5 coders are probably struggling with (at least I am...) :

"TA" and "price" functions are not multi-timeframe.

I explain:

If i test/run my script in Daily charts, I set BarPeriod=1440.

However, all TA functions such as ATR(), EMA(), LowPass(), etc only have a "int TimePeriod" argument, but no equivalent of the MT4 "timeframe" argument.

Therefore, when i call

Code:
var atr = ATR(60);



this will return the ATR(Daily,60) value if i'm running my script with BarPeriod=1440 and TimeFrame=1.

If i switch to another BarPeriod, say 5,
then ATR(60) will return the equivalent of ATR(M5,60).

There is no way to get the ATR(Daily, 60) whatever BarPeriod/TimeFrame i would be using for my test.

What makes things even more confusing is that the "TimePeriod" argument of TA functions not only depend on BarPeriod, but ALSO on TimeFrame...

How do we (simply!) solve this ?

I would be really happy to have a separate "int timeframe" argument that clearly specifies the timeframe on which the "timeperiod" argument applies, just like MT4 has.

These 2 arguments together would then make the TA function calls completely independent on the BarPeriod and TimeFrame global variables that otherwise affect the trade functions

My "daily ATR" request woudl then always look identical like this (for instance):

Code:
var atr = ATR(PERIOD_D1,60);



regardless of the BarPeriod and TimeFrame arguments that are set to run the script.

Note that this should also likely apply to the price functions (priceOpen(), etc).

The current way it is implemented is very confusing, and makes it very difficult to code scripts that can be run on any BarPeriod values.

Thanks.

Sq