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

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
In OnTick() control the button pressing. If it works in the tester - control in OnTick(), but in real life this control block will not be executed and will be controlled in OnChartEvent()
How come? No event parameters are passed to OnTick().
How can this be? No event parameters are passed to OnTick().
But the push of the button is monitored
It is exactly the same control in OnChartEvent() with the difference that it is checked only at the moment of pressing, not on each tick.But pressing the button is controlled
Exactly the same control in OnChartEvent() with the only difference is that the check takes place exclusively at the moment of click, not on every tick.Isn't it at the moment of release? Clicking on an object is only counted if you press-release within the object. If you click on an object, move the cursor away from it while holding down the button, and then release it, is the object clicked on?
However, I haven't experimented yet.
Isn't it at the moment of push-back? Clicking on an object only counts if you press and release within the object. If you click on an object, move the cursor away from it while holding down the button, and then release it, is the object clicked on?
However, I haven't experimented yet.
I have not experimented either, so I can't say anything for sure. But it seems to be by pushing. There was even a thread somewhere discussing this. If memory serves me correctly, it seems that they even asked to separate the event for pressing and releasing the mouse button.
OnChartEvent() does not work in the tester.
Please show the button that can work in the tester. For example, click on which, the flag trade = true will be raised; click again? trade = false;
How can this be done? No event parameters are passed to OnTick().
https://www.mql5.com/ru/forum/171668#comment_10574757
Taking apart the code of the EquityChartModeller indicator.
It has 2 custom functions:
I don't understand where it's highlighted in yellow. If portfolio formula looks like: "USDSEK-4 USDCAD+9 EURJPY-5 AUDNZD-5 EURAUD-1 GBPJPY+6 USDNOK-2", then how can the loop while(p>=0) be overridden to if(p==0) if it only breaks if(X=="+"||X=="-") break; ??
And then below, if(p==0) , why is the lot set to 1 -Lots[Total-1]=1;? ?
Indicator here: https://www.mql5.com/ru/code/10962
Taking apart the code of the EquityChartModeller indicator.
It has 2 custom functions:
...Indicator here: https://www.mql5.com/ru/code/10962
Insert code correctly:
Insert the code correctly:
corrected
corrected
How about a styler? Ctrl+, (comma in English)
I'm not picking on you. It's just that you're the one who needs help, so it's up to you to give the information in a usable form, not a dump.