Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1692

 

Good evening, could you please advise why in mql5 in mt5 x64 there is no text on the chart with a string variable, after the date if I hover the mouse over a vertical line the price is something?

ObjectCreate(0,Obj_Name,OBJ_VLINE,0,Dat_DtTm,0);       //Создаем объект..
ObjectSetString(0,Obj_Name,OBJPROP_TEXT,"Text");       // ..и описание 
ObjectSetInteger(0,Obj_Name,OBJPROP_COLOR, Col);       // ..и его цвет,..
ObjectSetInteger(0,Obj_Name,OBJPROP_STYLE, Stl);       // ..стиль.
 
grimc124 #:

Good evening, could you please advise why in mql5 in mt5 x64 there is no text on the chart with a string variable, after the date if I move the mouse over a vertical line the price is something?

ObjectSetString(0,Obj_Name,OBJPROP_TOOLTIP,"tooltip"); // это описание
ObjectSetString(0,Obj_Name,OBJPROP_TEXT,"Text");   // а это выводимый текст 
 
Valeriy Yastremskiy #:

And you only open new pending orders after the last order from the first series of pending orders is closed?

No, as many as you like. All the pending orders are written to the array + parameters of the bar on which it was opened. A new pending order is +1 entry in the array and -1 entry if it was deleted or became a marker. Only now my magic is generated much easier: all I need is one line "magic = rand()"

 

Why aren't the buttons in the tester working? On a real account everything is OK.


void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
  {
    if(id==CHARTEVENT_OBJECT_CLICK && sparam=="button1"){      
      ...
    }
  }
 
Nerd Trader On a real account everything is OK.


They do not work in Expert Advisors, only in indicators

In Expert Advisors you have to do it outside the OnChartEvent

 
MakarFX #:

They do not work in EAs, only in indicators

Hmmm, now we have to wait until Monday.
 
MakarFX #:

Do not work in EAs, only in indicators

You have to do it outside OnChartEvent in Expert Advisors

And if you do it in OnTester()

 
Nerd Trader #:

And if in OnTester()

void OnTick()
  {
//---
   if (IsTesting()) 
     {
      if(ObjectGetInteger(0,"lab_Button",OBJPROP_STATE)==true)
        {
         ....
        }
      if(ObjectGetInteger(0,"lab_Button",OBJPROP_STATE)==false)
        {
         ....
        }
     }
  }
 
Nerd Trader #:

No, as many as you like. All pending orders are written to the array + parameters of the bar it was opened on. A new pending order is +1 entry in the array, if it was deleted or became a marker, then -1 entry. Only now my magicians are generated much easier, all I need is one line "magic = rand()".

You can do it that way too. The probability of coincidence is low.

 
MakarFX #:

it is better to use IsVisualMode instead of IsTesting

Reason: