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

 
Andrey Kaunov #:

It's a shaitan, I don't understand anything. Maybe I don't see something obvious, my eye has blurred (((( I attach the code

From line 379 onwards you have recursion to the indicator (call itself). There are parameters there and you need to match them too after changing the order of parameters.

 
Nikolay Ivanov #:

From line 379 onwards you have recursion to the indicator (calling itself). There are parameters there and you need to adjust them too after changing the order of parameters.

Thank you very much, Nikolay.

Yes, I should have dug deeper. I am stuck in parameters.

 

Can you tell me why the inner loop does not work in this cycle?

for (int Try=0; Try<1;) 

  {  Print("цикл 1");

      for (int Try2=0; Try2<1;) 

        {  Print("цикл 2"); Try=1; Try2=1;
...


It does not print "cycle 2". Only "cycle 1".

 
Who knows how to fix the size of OBJ_RECTANGLE_LABEL so that it is the same on different monitors? I made a small panel to the size of the built-in OneClickTrading panel (in pixels), but on different monitors mine changes size, but the built-in one does not.
 
Ivan Butko #:

Can you tell me why the inner loop does not work in this cycle?

for (int Try=0; Try<1;) 

  {  Print("цикл 1");

      for (int Try2=0; Try2<1;) 

        {  Print("цикл 2"); Try=1; Try2=1;
...


The "cycle 2" is not printed. Only "cycle 1"

everything prints, alerts.

void OnStart()
  {
//---
for (int Try=0; Try<1;) 

  { Alert("цикл 1");

      for (int Try2=0; Try2<1;) 

        {  Alert("цикл 2"); Try=1; Try2=1;
        }}
   
  }
//+------------------------------------------------------------------+

2022.03.20 10:28:29.373 Script qqq EURUSD,M1: removed
2022.03.20 10:28:29.373 qqq EURUSD,M1: uninit reason 0
2022.03.20 10:28:29.373 qqq EURUSD,M1: Alert: Cycle 2
2022.03.20 10:28:29.357 qqq EURUSD,M1: Alert: Cycle 1
2022.03.20 10:28:29.326 qqq EURUSD,M1: initialized

 
Valeriy Yastremskiy #:

everything prints, alerts

2022.03.20 10:28:29.373 Script qqq EURUSD,M1: removed
2022.03.20 10:28:29.373 qqq EURUSD,M1: uninit reason 0
2022.03.20 10:28:29.373 qqq EURUSD,M1: Alert: Cycle 2
2022.03.20 10:28:29.357 qqq EURUSD,M1: Alert: Cycle 1
2022.03.20 10:28:29.326 qqq EURUSD,M1: initialized

Thanks for the check! I will look at

 
EVGENII SHELIPOV #:

Good afternoon!!!!

Please help me to change a function which calculates only losses of unprofitable orders in a grid of orders

We need to change the function which calculates only minimum lot size from each order in the net of orders. Min Lot=0.01

Thanks!!!!

Describe more clearly what you want
 
Can you please tell me how to manage the order of plans (foreground, background) of graphical objects? For example, I have a small square infofield with a graph underneath and a trend line climbing on the field itself, and a label hiding under the field.
 
Ivan Butko #:
Can you please tell me how to manage the sequence of plans (foreground, background) of graphic objects? For example, I have a small square infofield with a chart under it, and a trend line is climbing on the field itself, and a label is hiding under the field.
  1. Set OBJPROP_TIMEFRAMES to OBJ_NO_PERIODS
  2. Set the object parameter OBJPROP_TIMEFRAMES to OBJ_ALL_PERIODS
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Видимость объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Видимость объектов
  • www.mql5.com
Видимость объектов - Константы объектов - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Artyom Trishkin #:
  1. Set OBJPROP_TIMEFRAMES to OBJ_NO_PERIODS
  2. Set the parameter OBJPROP_TIMEFRAMES to OBJ_ALL_PERIODS

Artyom, I probably didn't quite understand, maybe I asked the question crookedly:

There are three(four, five...) man-made objects (ObjectCreate). The first one hides behind the third one, the second one is in the foreground,. How to set one to foreground, second to second, third to background. So that the first object is always visible, the second is always visible, but not behind the first one. The third object is also always visible, but not behind the first and the second. It's a kind of alternation of plans.
I just didn't quite understand the TF.

Reason: