Errors, bugs, questions - page 2168

 
Sergey Lazarenko:
I have an Alpari esn mt5 account, just for fun I looked at the demo from metaquotes, they show it correctly

Thank you for your feedback. Already aware of the problem, we are dealing with it.

 
Andrey Khatimlianskii:

What is the task? Why the state of the button?


And where are the attempts? )

Seems to be a standard way to catch combinations, but not sure it will work for the reserved one.

illuminate the price tag (the price to which the crosshair points) when the crosshair appears

and consequently follow the crosshair and remove the marker when the crosshair is off.

ewa

 
Sergey Dzyublik:

Since my message promising to find the old code was deleted, it turns out I didn't promise anything...
Just kidding.


It was written in those dark days (more than 3 years ago), when keyboard functionality was still small and, to put it mildly, unimpressive.
Nowadays, however, as far as memory serves, there are standard features to track the status of a particular key.
So the code snippet below is unlikely to be of any use:

where:
lparam - code of pressed key in current event;
last_key_code - code of the pressed key in the previous event;
g_first_key - code of the first key of the combination;
g_second_key - code of the second key from the combination;
time - time of the current event of the key pressing;
last_time_code - time of previous key press event;
g_time_limit - maximum time between first and second key presses to be considered as a key combination;

Thanks, I'll give it a try.

 
Alexandr Bryzgalov:

Thanks. I'll give it a try.

Why guess when there are examples in the help? https://www.mql5.com/ru/docs/constants/chartconstants/enum_chartevents

But no one would think to look there )

Event

Parameter value id

Parameter value lparam

Parameter value dparam

Parameter value sparam

Keyboard press event

CHARTEVENT_KEYDOWN

code of the pressed key

Number of times the key is pressed, generated while it is held down

String value of bitmask describing the status of the keyboard keys


I already told Andrei (Hatimlansky) - first we create (invent) a problem, then we solve it valiantly, regardless of...
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика
  • www.mql5.com
Существуют 11 видов событий, которые можно обрабатывать с помощью функции предопределенной функции OnChartEvent(). Для пользовательских событий предусмотрено 65535 идентификаторов в диапазоне от CHARTEVENT_CUSTOM до CHARTEVENT_CUSTOM_LAST включительно. Для генерации пользовательского события необходимо использовать функцию EventChartCustom...
 
Rashid Umarov:

Why guess when there are examples in the help? https://www.mql5.com/ru/docs/constants/chartconstants/enum_chartevents

But no one would ever guess to look there )

I already told Andrei (Hatimlansky) - first we create (invent) the problem, then we solve it valiantly, regardless of...

I did look at this part of documentation.

I could not find the solution for the keyboard shortcut on the surface or did not understand it, so I reached out to the community.

In general, I expected that you can catch the "crosshair" button clicking in the terminal, but that's how it is.

SZY: For the mouse button, I took the code from this example.
 
Rashid Umarov:

I have already told Andrei (Hatimlansky) - first we create (invent) a problem, then we valiantly solve it, regardless of...

Roche, I was responding to that comment of yours. Just because you don't see a problem doesn't mean there isn't one.

 
In the HTML report in the MT4 tester, does the landing count by equity or by balance?
 
Andrey Khatimlianskii:

Roche, I was responding to that comment you made. Just because you don't see a problem doesn't mean there isn't one.

I'm talking about finding code to catch keystrokes. About the crosshair - you need to write to servicedesk if there is a real error or you need functionality

 
Rashid Umarov:

I am talking about searching for code to catch keystrokes. About the crosshair - need to write to servicedesk, if a real error or need functionality

I wasn't interested in the code, but in the algorithm.

Now I see that I need to catch the first key, remember the time, catch the second key to check if the time has run out.

I don't quite understand how an event handler works

for example, if I press two keys, will it alternate between them or something else?

It's the first thing I look at, but sometimes I look and see nothing.

ZS: and when one key is pressed, does it pick up any other keys at all?
 

Compilation error

template<typename T>
void f() {}
template<typename T1, typename T2>
void f() {} //Error: 'f' - function already defined and has body