Errors, bugs, questions - page 971

 
How do I know the set test interval from OnTester()?
 
nasdaq:
How can I find out the set testing interval from OnTester()?

The end date of the test can be found immediately in OnTester.

The start date must be stored in OnInit.

Use the TimeCurrent function

Документация по MQL5: Дата и время / TimeCurrent
Документация по MQL5: Дата и время / TimeCurrent
  • www.mql5.com
Дата и время / TimeCurrent - Документация по MQL5
 

Faced a strange situation

Today, when connecting to the server, the connection from the biline USB modem stopped working.

From other channels (relay and terrestrial DSL) work successfully

193.219.127.76:4443

and in both cases telnet to this address + port passes (session opens)

trace dies on some IP pair (sticks) in both cases too

ping in general says

Ответ от 195.16.37.33: Превышен срок жизни (TTL) при передаче пакета.
Ответ от 195.16.37.33: Превышен срок жизни (TTL) при передаче пакета.
Ответ от 195.16.37.33: Превышен срок жизни (TTL) при передаче пакета.
Ответ от 195.16.37.33: Превышен срок жизни (TTL) при передаче пакета.

this is from biline

Обмен пакетами с 193.219.127.76 по с 32 байтами данных:
Ответ от 193.219.127.225: Превышен срок жизни (TTL) при передаче пакета.
Ответ от 193.219.127.225: Превышен срок жизни (TTL) при передаче пакета.
Ответ от 193.219.127.225: Превышен срок жизни (TTL) при передаче пакета.
Ответ от 193.219.127.225: Превышен срок жизни (TTL) при передаче пакета.

it's from another channel but the terminal can see the connection

I phoned the Beeline and asked them to turn the modem off and then turn it back on in about 10 minutes - did not help

But the server MetaQuotes demo sees and connects to it.

Something I've run out of imagination, what to do next?
 
How do you determine during optimisation whether a forward site is now or not?
 

Please explain, where is my mistake?Why the attached code draws an image (OBJ_BITMAP_LABEL) only in COLOR_FORMAT_XRGB_NOALPHA mode? Together withCOLOR_FORMAT_ARGB_NORMALIZE it does not show anything.

void OnStart() {
  uint Canvas[];
  uint ImgWidth = 250;
  uint ImgHeight = 100;
  long chart_id = ChartID();
  ArrayResize(Canvas, ImgWidth * ImgHeight);
  ArrayInitialize(Canvas, 0);
  for (int i = 0; i < ArraySize(Canvas); i++)
    Canvas[i] = i;
  if (ObjectCreate(chart_id, "Test", OBJ_BITMAP_LABEL, 0, 0, 0)) {
    ObjectSetString(chart_id, "Test", OBJPROP_BMPFILE, "::Test");
    ResourceCreate("::Test", Canvas, ImgWidth, ImgHeight, 0, 0, ImgWidth, COLOR_FORMAT_XRGB_NOALPHA);
    ChartRedraw(chart_id);
    Sleep(3000);
    ObjectDelete(chart_id, "Test");
  }
}
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
Files:
Test.mq5  9 kb
 
voix_kas:

Can you please explain where my mistake is?Why the attached code draws an image (OBJ_BITMAP_LABEL) only in COLOR_FORMAT_XRGB_NOALPHA mode? Together withCOLOR_FORMAT_ARGB_NORMALIZE it does not show anything.

Do you really have a 32 bit picture?
 
sergeev:
do you really have a 32 bit picture?
Unfortunately, I don't understand your question. The uint array (4 bytes, 32 bits) is used as a buffer.
 

In general, there are small gaps in knowledge. 32-bit colour is represented as 0x00BBGGRR, where first "00" is alpha-channel.

Example, we take colour clrRed, we want to make it translucent, we add value 127 (7F) to the first two bits. Obviously this is done by bitwise operations. Unfortunately, I'm not familiar with the subject. I'll try studying it for now. Maybe someone has a simple conversion code ready?

 

Strange. Running 0xFF000000 + clrBlue gives a red colour.

Blue is 0x00FF0000. I add0xFFFF000000. The result is0xFFFFFF0000. But why does it output red instead of blue?!

 
I'll save you some time if anyone is wondering about this. Use the regular ColorToARGB() function.
Reason: