Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1066

 

I need help!!! I wanted to create a button, which would look like. I created the button using mql4 help.

The essence of the problem is to set a triangle in the button, I tried to do it withSymbolic constants by translating them to a string, specifying them in the text of the button.

explicit symbol '▼' is not recognized in the log says Y.

Who has already encountered the solution, please share!!!!

I couldn't find any ASCII code in the character table.

//--- добавим символ в строку 
   string test=""; 
   StringSetCharacter(test,0,0xAE); 
   Print(test); 
 
korobok777:   wanted to create a button, ..... with a triangle in the '▼' button
//+------------------------------------------------------------------+
//| Создается кнопь и демонстрируется что надо.         Э-Кнопка.mq4 |
//+------------------------------------------------------------------+
#property strict

//+------------------------------------------------------------------+
//| Инициализация - создается кнопь                                  |
//+------------------------------------------------------------------+
int OnInit()
{
   ObjectCreate    (0,"Кнопь",OBJ_BUTTON,0,0,0);           // Создать кнопку
   ObjectSetInteger(0,"Кнопь",OBJPROP_CORNER,CORNER_RIGHT_UPPER); // Правый верхний угол
   ObjectSetInteger(0,"Кнопь",OBJPROP_XDISTANCE,185);      // Расстояние от (правого) края окна
   ObjectSetInteger(0,"Кнопь",OBJPROP_YDISTANCE,52);       // Расстояние по высоте от (верха окна) 
   ObjectSetInteger(0,"Кнопь",OBJPROP_XSIZE,180);          // Размер по ширине
   ObjectSetInteger(0,"Кнопь",OBJPROP_YSIZE,25);           // Размер по высоте
   ObjectSetString (0,"Кнопь",OBJPROP_FONT,"Wingdings 3"); // А это что? Угадай!!!
   ObjectSetString (0,"Кнопь",OBJPROP_TEXT,"qsИФЬд");      // Надпись из 6 стрелок
   ObjectSetInteger(0,"Кнопь",OBJPROP_COLOR,White);        // Цвет надписи - можно и черный
   ObjectSetInteger(0,"Кнопь",OBJPROP_BGCOLOR,Green);      // Цвет фона    - можно ...
   ObjectSetInteger(0,"Кнопь",OBJPROP_BORDER_COLOR,Yellow);// Цвет рамки
   ObjectSetInteger(0,"Кнопь",OBJPROP_HIDDEN,false);       // Не прятать в списке объектов
   ObjectSetInteger(0,"Кнопь",OBJPROP_STATE,false);        // Ненажатое состояние
   ObjectSetInteger(0,"Кнопь",OBJPROP_FONTSIZE,12);        // Размер шрифта
   return(INIT_SUCCEEDED);
}


//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{

}


//+------------------------------------------------------------------+
//| Реакция на события                                               |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &ИмяКнопки)
{
  if(ИмяКнопки=="Кнопь")
  {
    ObjectSetInteger(0,"Кнопь",OBJPROP_STATE,false);
    ObjectSetInteger(0,"Кнопь",OBJPROP_BGCOLOR,Yellow);
    ObjectSetString (0,"Кнопь",OBJPROP_TEXT,"Ладно, ухожу");
    ObjectSetInteger(0,"Кнопь",OBJPROP_COLOR,Black);
    ObjectSetInteger(0,"Кнопь",OBJPROP_BORDER_COLOR,Red);
    ObjectSetString (0,"Кнопь",OBJPROP_FONT,"Arial");
    WindowRedraw();         // Перерисовать окно
    Sleep(777);             // Пауза для разглядывания
    ObjectDelete("Кнопь");  // Поглядели - и хватит
    ExpertRemove();         // Дело сделано, вы свободны...
  }
}


Take your pick ...

Files:
fonts.mq4  21 kb
 
LRA:


Take your pick ...

Thank you very much,where can I see more information about fonts?

ObjectSetString (0,"Кнопь",OBJPROP_FONT,"Wingdings 3"); // А это что? Угадай!!!
   ObjectSetString (0,"Кнопь",OBJPROP_TEXT,"p или  q");    //вот что мне нужно

Thank you,thank you,thank you!!!!!!

 
Good afternoon. I need help. maybe there is already such a code element. i need to view the order history and return the opening price of the last order. thank you in advance
 
korobok777:     where to look for information on fonts?

BUT! Instead of studying fonts and buttons, the point of entry into the market is sought!!!!!! This is more important than anything else. And when we write an income-generating Expert Advisor, then we will go ... and there at our leisure we'll look for everything else

 
LRA:

BUT! Instead of studying fonts and buttons, the point of entry into the market is sought!!!!!! This is more important than anything else. And when we write an income-generating Expert Advisor, then we will go ... and at our leisure we will look for everything else.

Thanks again, I've been racking my brain....

The Expert Advisor is written!!! Now all that is left is buttons at your leisure :-):-)and jokes...

 
ara66676:
I can't understand why position search and closing stops in the loop, I've already reversed the loop and increased the number of positions, in the tester it still skips (leaves) positions. Please advise if you can see where and what is wrong...
Doubtful is the value of -1 for x1. If it is used as position number in their list, there is no such number.
 
Good afternoon!
I can't find the \Terminal\Common\Files folder. I can't even find the file name if FILE_COMMON is added. Can you explain where this shared folder of all client terminals is?
 

Tuta.


 

Help, please! There are 2 files: an indicator and an Expert Advisor. How to correctly refer to the function in the indicator via #include? iCustom is not suitable for various reasons. This is what I have written in the indicator:

bool BuyTrue(double& переменная, int переменная) export
{
   //тело функции

   return(true);
}   

And this is what I wrote in the Expert Advisor:

#import "НазваниеИндикатора.ex4"
   bool BuyTrue(double& переменная, int переменная);
if (BuyTrue(переменная, переменная))
Opn_B = true;

But for some reason, the Expert Advisor does not work, the indicator does not appear in the price chart during testing. Did I write it correctly, and if there is an error, where is it?

Reason: