Aleksei Stepanenko: Baffling. Tried from Excel to save a book with 3 sheets to csv:
There's only column separators inside the csv, there's no other markup
Oops! Didn't know this was a feature of the format. Me, when trying to save a book with multiple sheets, it doesn't unsubscribe like that... It just erases the previous sheet and saves a blank new one
Good day. Please tell me please, Iwrote an indicator with Alert (message and sound outputs under certain conditions), everything works, but every time I change Timeframe chart, it gives a signal again. How can I fix it? The Alert code is placed in a separate function that is called to check from OnCalculate. If it is just an EA, it works fine, but I need it with graphical representation as I have done, without triggering again when change of timeframe.
Для разработки торговых систем в платформу встроен собственный язык программирования MetaQuotes Language 5 (MQL5), среда разработки MetaEditor и инструменты тестирования стратегий. Любую информацию о разработке торговых стратегий на языке MQL5 можно найти на официальном сайте MQL5.community. На этом же сайте в разделе Code Base могут быть...
Progaus: Good afternoon. Can you please tell me please, Iwrote an indicator with Alert (message and sound outputs under certain conditions), everything works, but every time you change timeframe chart, again gives a signal. How can I fix it? The Alert code is placed in a separate function that is called to check from OnCalculate. If it is just an EA, it works fine, but I need it with graphical representation as I have done, without triggering again when change of timeframe.
When the timeframe is switched, the indicator starts from 0.
Accordingly, we should teach it to remember that Alert has already been issued - reliably, by storing such information in global variables of the terminal or in a temporary file, and it seems to be possible (I haven't used it myself) just to make a static variable.
For example, you can save time of last alert and not whistle a new Alert if time has passed less than 2 seconds.
and it seems to be possible (I haven't used it myself) just to make a static variable.
When you switch TF, a new copy of the indicator is created and the old one is deleted.
for EA it is possible (and necessary ?) to use static (or globally declared) variables ... there are however some nuances, but in general there are no problems
Maxim Kuznetsov:
when you switch timeframe, indicator will start from 0.
prev_calculated will be reset to zero at the first call of OnCalculated()
i.e., create a global variable of the terminal or a graphic object as a marker that the indicator was already on this chart and look for this graphic object during the first call.
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.
datetime o_open = OrderOpenTime();
MqlDateTime dt_struct;
TimeToStruct( o_open, dt_struct;)
int min = dt_struct.min;
new sheets when writing to csv

There are only column separators inside the csv, I don't think there is any other markupBaffling. Tried from Excel to save a book with 3 sheets to csv:
There's only column separators inside the csv, there's no other markupOops! Didn't know this was a feature of the format. Me, when trying to save a book with multiple sheets, it doesn't unsubscribe like that... It just erases the previous sheet and saves a blank new one
Thank you!
You're welcome :)
Good afternoon. Can you please tell me please, Iwrote an indicator with Alert (message and sound outputs under certain conditions), everything works, but every time you change timeframe chart, again gives a signal. How can I fix it? The Alert code is placed in a separate function that is called to check from OnCalculate. If it is just an EA, it works fine, but I need it with graphical representation as I have done, without triggering again when change of timeframe.
When the timeframe is switched, the indicator starts from 0.
Accordingly, we should teach it to remember that Alert has already been issued - reliably, by storing such information in global variables of the terminal or in a temporary file, and it seems to be possible (I haven't used it myself) just to make a static variable.
For example, you can save time of last alert and not whistle a new Alert if time has passed less than 2 seconds.
and it seems to be possible (I haven't used it myself) just to make a static variable.
When you switch TF, a new copy of the indicator is created and the old one is deleted.
for EA it is possible (and necessary ?) to use static (or globally declared) variables ... there are however some nuances, but in general there are no problems
when you switch timeframe, indicator will start from 0.
prev_calculated will be reset to zero at the first call of OnCalculated()
i.e., create a global variable of the terminal or a graphic object as a marker that the indicator was already on this chart and look for this graphic object during the first call.
Colleagues, sorry at once for the elementary question, I just do not have a computer, but I have to.
TimeCurrent()https://www.mql5.com/ru/docs/dateandtime/timecurrent
Use the second version of the signature of this function:
ZS: I should tell at once - it works in MT4, I used it ;)
UPD: in MT4 I also used Hour() and Minute() - I don't use them for a long time, but they should give the last server time in hours and minutes