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

 

Colleagues! Last week everything was working - I had access to the account!!! what does this error mean and how do I connect to the account? Passwords are all there!!!


put up the latest version...

here's the line highlighted - what is it? Remove the current old version?


 
Andrey Sokolov:

Then perhaps, as already suggested, on magik

In the Magician's Four, only the opening can be monitored. the question was about closing.

 
Andrey Sokolov:

Then perhaps, as already suggested, by magicka

The very moment of closing is of interest... That is, for example, there is an EA that has set the same magiks everywhere in its orders. But at a certain moment it needs to find out if it closed the deal itself or someone has interfered and closed it... You can't change either magiks or comments...?

 
Alexandr Sokolov:

these arrows are drawn, but why aren't the arrows coded 241 and 242 drawn?

Says who? I didn't ask to change the codes for nothing :)

Test number two: look closely at theWingdings font

Wingdingsfont characters used withOBJ_ARROWobject:

wingdings


and now compare codes 241, 242 with OBJ_ARROW_UP and OBJ_ARROW_DOWN objects and see ... What do we see?

 
Vladimir Karputov:

Says who? I didn't ask to change the codes for nothing :)

Test number two: look closely at theWingdings font

Wingdingsfont characters used withOBJ_ARROWobject:



and now compare codes 241, 242 with OBJ_ARROW_UP and OBJ_ARROW_DOWN objects and see ... What do we see?

OBJ_ARROW_UP and OBJ_ARROW_DOWN are not used to specify the type of an object but they are used to distinguish it easily ...


here I have done as in the example on the link

void ArrowCreate(ENUM_OBJECT             type,
                 datetime                time,
                 double                  price)
  {
   
   string name = (type == OBJ_ARROW_UP ? "Arrow Up №"+(string)(up+1) : "Arrow Down №"+(string)(down+1));
   if(type == OBJ_ARROW_UP)  { up++; }
   else                      { down++; };
   
   ObjectCreate(0,name,OBJ_ARROW,0,0,0,0,0);          // создадим стрелку
      ObjectSetInteger(0,name,OBJPROP_ARROWCODE,(type == OBJ_ARROW_UP ? 241 : 242));    // установим код стрелки
      ObjectSetInteger(0,name,OBJPROP_TIME,time);        // зададим время
      ObjectSetDouble(0,name,OBJPROP_PRICE,price);
   
   /*
   ResetLastError();
   if(ObjectCreate(ChartID(),name,OBJ_ARROW,0,time,price))
     {
      ObjectSetInteger(ChartID(),name,OBJPROP_ARROWCODE,(type == OBJ_ARROW_UP ? 225 : 226));
     }
   else
     {
      Print(__FUNCTION__,
            ": не удалось создать знак \"Стрелка\"! Код ошибки = ",GetLastError()); return;
     };
   ObjectSetInteger(ChartID(),name,OBJPROP_ANCHOR,(type == OBJ_ARROW_UP ? ANCHOR_TOP : ANCHOR_BOTTOM)); 
   ObjectSetInteger(ChartID(),name,OBJPROP_COLOR,(type == OBJ_ARROW_UP ? a_color_buy : a_color_sell));
   ObjectSetInteger(ChartID(),name,OBJPROP_STYLE,STYLE_SOLID); 
   ObjectSetInteger(ChartID(),name,OBJPROP_WIDTH,a_size); 
   ObjectSetInteger(ChartID(),name,OBJPROP_BACK,false); 
   ObjectSetInteger(ChartID(),name,OBJPROP_SELECTABLE,false); 
   ObjectSetInteger(ChartID(),name,OBJPROP_SELECTED,false); 
   ObjectSetInteger(ChartID(),name,OBJPROP_HIDDEN,true); 
   ObjectSetInteger(ChartID(),name,OBJPROP_ZORDER,0);*/
  }


... and this is the result...


 
Alexandr Sokolov:

OBJ_ARROW_UP and OBJ_ARROW_DOWN are not used to indicate object type, they are for convenience to make it easier to distinguish


here I did as in the example at the link


... and here's the result.


OK, it's night and YOU still don't get it. OBJ_ARROW object is a graphical object, to which you can set a symbol from Wingdings font. So, OBJ_ARROW_UP and OBJ_ARROW_DOWN are a common case of OBJ_ARROW with code 241,242.

 
Vladimir Karputov:

OK, it's night and YOU still don't get it. The OBJ_ARROW object is a graphical object to which a character from the Wingdings font can be set. Well, OBJ_ARROW_UP and OBJ_ARROW_DOWN are a common case of OBJ_ARROW with code 241,242.

Then how can I create an arrow that is similar in size but filled inside?

I've seen one somewhere but can't find it now.

 
Alexandr Sokolov:

Then how do you create an arrow that is similar in size but filled inside?

I saw one somewhere but can't find it now.

Try replacing OBJ_ARROW_UP and OBJ_ARROW_DOWN withOBJ_ARROW

 
Alexandr Sokolov:

Then how do you create an arrow similar in size but with a fill inside?

I've seen one of these somewhere before but can't find it now.

This is OBJ_ARROW with codes 231-238.

 

Greetings!

I can't close opposite orders of different lots using CTrade.PositionCloseBy(ticket1,ticket2).

ResultRetCode() - I get error 10035.

Please advise what is the reason?