Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1511

 
Hello !
Is it possible to colour a panel created with <Controls\Dialog. mgh> ?
Could you share an example code how it can be done? (If it is possible of course).
 
Igor168 #:
Hello !
Is it possible to colour a panel created with <Controls\Dialog. mgh> ?
Could you share an example code how it can be done? (If it is possible of course).

I'm not sure at all, but I think the drummer showed it. Or maybe I'm just wrong....

 
Alexey Viktorov #:
without steps and other nonsense at any moment, regardless of the profit/loss made by other co's.

You can do the same thing.

We do it this way. On a signal, we calculate the risk \ TP \ SP \ SL \ Remember the balance \.

Open an order (or a group). Accordingly, we know the profit +1=10 and we know the loss -1=-10.

Done.

 
Hello!
//+------------------------------------------------------------------+
//| Event handler                                                    |
//+------------------------------------------------------------------+
void CControlsDialog::OnClickButton2(void)
  {
  for(int i=0; i<SymbolsTotal(true);i++){ 
btn2[i].ColorBorder(clrGreen);  
Comment(__FUNCTION__);
   }
  }
 
//+------------------------------------------------------------------+
Is there any possibility to add actions to created buttons from <Controls\Button.mqh> library
With the above code I failed.

//Глобальная переменная
CButton btn2[];

//Макросы
void              OnClickButton2(void); 

// Событие
for(int i=0; i<SymbolsTotal(true);i++){ 
ON_EVENT(ON_CLICK,btn2[i],OnClickButton2)
}


//OnInit
for(int i=0; i<SymbolsTotal(true);i++){ 
int total = SymbolsTotal(true);

ArrayResize(btn2, total);
btn2[i].Create(0,"BTN1"+ IntegerToString(i),0,130,20+i*20,100,40); 
btn2[i].Height(BTN_HEIGHT);
btn2[i].Text(CharToString(182));  
btn2[i].Font("Wingdings");       
ExtDialog.Add(btn2[i]); 

//Нажатие кнопки
void CControlsDialog::OnClickButton2(void)
  {
  for(int i=0; i<SymbolsTotal(true);i++){ 
btn2[i].ColorBorder(clrGreen);  
Comment(__FUNCTION__);
   }
  }
 
//+------------------------------------------------------------------+  
Full code involving btn2, thanks in advance
 

Hi all.

Can you tell me, if in my code I get CopyRates, SymbolInfoDouble several times?

For example, for one script I get 10 bars from H1, 10 bars from M15 and 10 bars from H4, for another script I get 4 bars from M15, there is also CopyBuffer for AO.

What confuses me is that in case of an error in one of them all logic will go to the same place. The question is how often it glitches , for example CopyRates, is there any sense to make a separate script that first checks it all - all CopyRates, SymbolInfoDouble, CopyBuffer, and if at least one of them has an error, it just starts again, and only after all of them have returned to work, spreads them in the right places and the logic starts to work...?

 

In the properties of the indicator there is an option to hide it on any timeframes.


How to do it programmatically?

 
Aleksandr Slavskii #:

In the properties of the indicator there is an option to hide it on any timeframes.


How to do it programmatically?

OBJPROP_TIMEFRAMES

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Видимость объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Видимость объектов
  • www.mql5.com
Комбинация флагов видимости объекта определяет таймфреймы графика, на которых объект отображаем. Для установки/получения значения свойства...
 
Artyom Trishkin #:

OBJPROP_TIMEFRAMES

This is for objects.

ObjectSetInteger(0, name, OBJPROP_TIMEFRAMES, OBJ_NO_PERIODS);

Indicator lines are not shown in the object lists.

I don't understand what name I should specify here to hide the indicator line.

Or should I use some other function?

 
Aleksandr Slavskii #:

It's for objects.

Indicator lines are not displayed in the object lists.

I don't understand what name I should specify here to hide the indicator line.

Or should I use some other function?

Yeah, that's a tough question.) Maybe set the colour to invisible

indicator_colorN

depending on the TF.

When changing the TF, re-initialisation and recalculation are performed. Display calculations can be affected accordingly...

It also depends on the indicator... maybe you have arrows ), then the solution above will work.

According to moderators, there is no option to programmatically hide on any TF " It's not possible to set an indicator visualisation timeframes by code. "

 
Aleksandr Slavskii #:

It's for objects.

Indicator lines are not displayed in the object lists.

I don't understand what name I should specify here to hide the indicator line.

Or should I use some other function?

I didn't realise the question. I thought it was about objects.

I can't tell you about indicators, I was curious myself....

Reason: