evillive: What if the indicator is in the main window, whose index is still 0?
We are talking about an indicator in a separate window. Of course, if the indicator was on the price chart - yes, you can take the data from the main window with index 0
artmedia70: We are talking about an indicator in a separate window. Of course, if the indicator was on a price chart - yes, you can take data from the main window with index 0
.
Ah, well, except that we can determine Y coordinates of indicator window borders and follow the Y coordinate of the chart itself using ChartTimePriceToXY(), if this function can do that.
What time did the server clock show when the script started? And today is not Monday at all...
Well, hardly someone needs alert on every tick for a whole hour, but if you need exactly that, well...
The alert was displayed for demonstration purposes and will be deleted in the script, or rather in the Expert Advisor. Ideally all variables should be daily, not hourly. I would also like to know about the problem with the broker's time.
The alert is for illustration purposes and will be removed from the script, or rather from the EA. Ideally all variables should be daytime instead of hourly. I would also like to know about the problem with the broker's time.
There is no problem with the broker time, the problem is in your construction if(DayOfWeek()==1 && Hour()==1), which will be executed at every tick for one hour on Monday night. And I'm asking about server time because it's used in this case and running your script at any other time, except for Monday night between 1am and 2am server time, won't produce an alert.
If you put one = instead of = in if() operator when checking equality condition (erroneously), no errors are produced at any stage (compilation, defective execution). Why?
If you put one = instead of = in if() operator when checking equality condition (erroneously), no errors are produced at any stage (compilation, defective execution). Why?
Why? The programmer always produces an error! And pointing to it!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Of course it divides:
...
[in] Index of the current chart sub-window (0 - main price chart).
Correspondingly, if the indicator is not on the chart, we cannot take its window data
What if the indicator is in the main window, whose index is still 0?
Example of stop-order calculation, taking into account StopLevel requirements:
Global:
And in the Expert Advisor code before sending the trade for
Example of calculation of stop orders including StopLevel requirements:
Global:
And in the EA code before sending a trade request:
We are talking about an indicator in a separate window. Of course, if the indicator was on a price chart - yes, you can take data from the main window with index 0
.
Ah, well, except that we can determine Y coordinates of indicator window borders and follow the Y coordinate of the chart itself using ChartTimePriceToXY(), if this function can do that.
What time did the server clock show when the script started? And today is not Monday at all...
Well, hardly someone needs alert on every tick for a whole hour, but if you need exactly that, well...
The alert was displayed for demonstration purposes and will be deleted in the script, or rather in the Expert Advisor. Ideally all variables should be daily, not hourly. I would also like to know about the problem with the broker's time.
Regards, AlexMikash
The alert is for illustration purposes and will be removed from the script, or rather from the EA. Ideally all variables should be daytime instead of hourly. I would also like to know about the problem with the broker's time.
If you put one = instead of = in if() operator when checking equality condition (erroneously), no errors are produced at any stage (compilation, defective execution). Why?
If you put one = instead of = in if() operator when checking equality condition (erroneously), no errors are produced at any stage (compilation, defective execution). Why?
Why? The programmer always produces an error! And pointing to it!