Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 521

 
artmedia70:

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? It may be hidden on a given timeframe, but the window is still there.
 
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
 
Look at line number 113 of your advisor, perhaps there is an extra comma?
 
artmedia70:

Example of stop-order calculation, taking into account StopLevel requirements:

Global:

And in the Expert Advisor code before sending the trade for

artmedia70:

Example of calculation of stop orders including StopLevel requirements:

Global:

And in the EA code before sending a trade request:


Thank you!
 
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.
 
evillive:

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

 
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.

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.
 
All available and understandable! Thank you!
 

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?

 
MEN_Odessa:

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!
Reason: