Download MetaTrader 5

CHARTEVENT_OBJECT_DRAG

To add comments, please log in or register
Henrique Vilela
1277
Henrique Vilela  

Hi,

I'm trying to retrieve the new price property from a object (horizontal line) after it's dragged, but it returns the old value and not the new one.

Am I doing something wrong? How to get new new value (price to where it was dragged to)?

    virtual void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
     {
      if(id==CHARTEVENT_OBJECT_DRAG)
        {
         double value;
         ObjectGetDouble(0,sparam,OBJPROP_PRICE,0,value);
         Print(value); // Old Value
        }
     }
Vladimir Karputov
Moderator
50046
Vladimir Karputov  
Henrique Vilela:

Hi,

I'm trying to retrieve the new price property from a object (horizontal line) after it's dragged, but it returns the old value and not the new one.

Am I doing something wrong? How to get new new value (price to where it was dragged to)?

I have the code working correctly - I get new price value.

MetaTrader 5 x64 build 1210 started (MetaQuotes Software Corp.)
To add comments, please log in or register