ObjectGetValueByShift suggestion

 
Since the function ObjectGetValueByShift returns a different value for each time frame, it would be nice if we could specify which time frame we want to get the value from.
 
It took me several hours to figure out that one, and the reason why my code was not working. Is there an alternative?
 
skatt: Since the function ObjectGetValueByShift returns a different value for each time frame, it would be nice if we could specify which time frame we want to get the value from.

It doesn't return a different value for each time frame. You are asking for the values at different times. iTime(NULL,PERIOD_D1,x) != iTime(NULL,PERIOD_M1,x) so of course you get different values from ByShift(x) from different timeframes.

If you want the value from another timeframe, get the proper shift

datetime  BOD = iTime(NULL, PERIOD_D1, 0);
int      iBOD = iBarShift(NULL,0, BOD);
double   valueAtBOD = ObjectGetValueByShift(name, iBOD);

Reason: