i can not used this function (ObjectGetValueByTime)

 

ObjectGetValueByTime()

All time retrun 0.0

double LastUpRedrawValue =ObjectGetValueByTime(0,"Toptahlil_UpperTrendLine_"+GetPeriod(Period()),Time[iUp],OBJ_TREND);
 
Perhaps you should read the manual. What is the last parameter of the function, what value are you passing to it?
 
whroeder1:
Perhaps you should read the manual. What is the last parameter of the function, what value are you passing to it?

i want read the trend line value in every candles but all read result 0.0

 
mehdi khoshbakhtvash:

i want read the trend line value in every candles but all read result 0.0

double LastUpRedrawValue =ObjectGetValueByTime(0,"Toptahlil_UpperTrendLine_"+GetPeriod(Period()),Time[iUp],0);
i used this code but return value no change my result is 0.0 and my last error is 0 after call this function
 
double  ObjectGetValueByTime(
   long       chart_id,      // chart ID
   string     object_name,   // object name
   datetime   time,          // time
   int        line_id=0      // line ID
   );
 
Marco vd Heijden:
i used this code but return 0.0 value
 

Are you trying to say that the function is faulty?

Maybe you want to check your code again.

 
mehdi khoshbakhtvash: i used this code but return 0.0 value
mehdi khoshbakhtvash: i want read the trend line value in every candles but all read result 0.0
mehdi khoshbakhtvash: i used this code but return value no change my result is 0.0 and my last error is 0 after call this function
  1. You keep saying the same thing as your original post. That isn't helpful, stop repeating what you've already stated.
  2. whroeder1: Perhaps you should read the manual. What is the last parameter of the function, what value are you passing to it?
    Answer the question and you will find out why.
 
Marco vd Heijden #:

Are you trying to say that the function is faulty?

Maybe you want to check your code again.

To get value by time after creating an object with a same script first you should use the function Sleep(). Put a program to sleep for at least 50 milliseconds. Though on my computer sometimes even 100 milliseconds is not enough.

Then you should use ChartRedraw().

Then you will get ObjectGetValueByTime() working correctly. Maybe.

So, to get this function work for some reason you need to wait undefined amount of time and use another function which makes no common sense and no guide is writing about it.


So, yeah. The function is faulty. The whole mt4 is faulty. 

 
Mikhail Sobolev #:

To get value by time after creating an object with a same script first you should use the function Sleep(). Put a program to sleep for at least 50 milliseconds. Though on my computer sometimes even 100 milliseconds is not enough.

Then you should use ChartRedraw().

Then you will get ObjectGetValueByTime() working correctly. Maybe.

So, to get this function work for some reason you need to wait undefined amount of time and use another function which makes no common sense and no guide is writing about it.


So, yeah. The function is faulty. The whole mt4 is faulty. 

I removed your inflammatory post.

This is an MT5 topic.

Unless proven otherwise there is no issue with ObjectGetValueByTime(), it works as documented.
 
Alain Verleyen #:

I removed your inflammatory post.

This is an MT5 topic.

Unless proven otherwise there is no issue with ObjectGetValueByTime(), it works as documented.

In my documentation it says that Mikhail Sobolev should be banned for a while for his language in the publication you removed from it.

You look very soft and cuddly today....

Reason: