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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good afternoon!
Can you please tell me if the code compilation can be set in the code itself? Thank you.
I am displaying the mouse parameters and the 4 digit price tag in the comments when the wheel is clicked.
As long as the wheel is pressed, the marker runs behind the cursor, but I can't make the same happen when the wheel is released before the mouse is pressed on the LC.
Help me figure this out.
I am displaying the mouse parameters and the 4 digit price tag in the comments when the wheel is clicked.
As long as the wheel is pressed, the marker runs behind the cursor, but I can't make the same thing happen when the wheel is released before the mouse is pressed on the LK.
remove (commented out)
// if(sparam =="16")
remove (commented out)
// if(sparam =="16")
Then the marker is on the screen all the time, while you want it to appear only when you press the wheel.
PS
Your reply has given me the right idea thank you :-)
I am displaying the mouse parameters and the 4 digit price tag in the comments when the wheel is clicked.
While the wheel is pressed, the marker runs behind the cursor, but I can't make the same thing happen when the wheel is released before the mouse is pressed on the LK.
Help me figure this out.
label is of bool type
label is of the bool type
Can I move it before creating the label?
Now I have another question: I want to place a label to the right side of the screen, this is calculated in OnCalculate
It somehow turns out to be at the far left position, while the same calculation in OnChartEvent for another marker gives a correct result.
Why does it cause countdown inversion?
Can the move be done before the marker is created?
Now I have another question: I want to move a marker to the right side of the screen, this is calculated in OnCalculate
It seems to be in leftmost position for some reason. But the same calculation in OnChartEvent for another marker gives correct result.
Why does the countdown inversion happen?
The label was initially set to false, so no code fragment with moving marker will be executed. But even if it is executed before the label is created nothing will happen, the program will continue to run and the label that is created later won't be affected.
Watch the anchor point, different anchor points will cause different results. You can immediately try to write 0 instead of width and if it behaves as it should, it means that it was a matter of anchor points.
label is initially set to false, so the piece of code to move the label will not be executed. But even if it is executed before the label is created, nothing will happen, the program will continue to run and the label that is created afterwards will not be affected.
Watch the anchor point, different anchor points will cause different results. You can immediately try to write 0 instead of width and if it behaves as expected, it means that the problem was with the anchor points.
I have no anchor points, I only move vertically, and I set the horizon once, across the width of the screen. It's not a problem to count from the other side, but it's surprising that the same action is performed differently in different functions.
And one more question - if Bid is displayed as the label text, which function should I use to do it optimally -OnChartEvent orOnCalculate?
Good afternoon!
Can you please tell me if the code compilation can be set in the code itself? Thank you.
This may be a silly question since no one is answering, but how else do I deal with the EA stopping and resuming after compilation?
The platform gives the message:array out of range (284,17).
line 284: NewsArr[0][NomNews]=StringSubstr(TEXT,sh,sh2-sh);position 17 opens a square bracket with NomNews, which is globally initiated by 0.
I changed 0 to 1 with no result.
I changed theline if(NomNews==300)break; 300 to 360000, to no av ail.
I compile it - it works fine for a few minutes. And what to do?
This may be a silly question, since no one is answering, but how else do I deal with the EA stopping and resuming after compilation?
The platform gives the message:array out of range (284,17).
Line 284: NewsArr[0][NomNews]=StringSubstr(TEXT,sh,sh2-sh);position 17 opens a square bracket with NomNews, which is globally initiated by 0.
I changed 0 to 1 with no result.
I changed theline if(NomNews==300)break; 300 to 360000, to no av ail.
I compile it - it works fine for a few minutes. And what to do?