Wrong values returned from ObjectGetValueByTime

 

I'm getting the wrong values returned from the function ObjectGetValueByTime.

First I create the object with: ObjectCreate(0, DivName, OBJ_STDDEVCHANNEL, 0, fromDate, fromPrice, toDate, toPrice);

Then I try to get the first value with: double FirstPrice0 = ObjectGetValueByTime(0, DivName, fromDate, 0); Everytime I run the EA, I get a different result without changing anything, all wrong values.

 

What am I doing wrong?

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5