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
So I ask again, why do you have to rename the file? Just create it with the proper name to start with.
I am not trying to rename an extg. file. I've already created it with a proper name. but part of the name should be the date (which should be dynamically generated daily) - and for this reason, i'm hoping to generate this within the OnStart so that different functions doing different things can share the same filename. like a global variable.
But as i mentioned earlier, i discovered there's no way for OnStart to accept parameters nor can it return a result which i can assign to a variable....in my limited knowledge, i cannot find a way around this and so am stuck...
will very much appreciate just a point to the right direction.
thanks dominik but i dont quite understand how assigning a filename string to a global variable inside the OnStart will allow my other functions(outside OnStart) to access the filename since as i mentioned, in my limited knowledge, it seems OnStart does cannot output or return a variable which i can then assign to another outside itself nor can it accept parameters by reference. ...I am not trying to rename a file but trying to generate a filename dynamically daily with date as part of this filename. ....hope its ok to seek further clarification since it's fuzzy to me.
Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.
Don't post pictures of code, they are too hard to read.
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor
“Why this is false?” What is “this”.
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
TimeToStruct(TimeCurrent(),servertime);
servertime.day_of_week != 0 // ( not sunday please)
/* comments about mqldate time. use it in mql5 !!! comments all below:
MqlDateTime
The date type structure contains eight fields of the int type:
struct MqlDateTime
{
int year; // Year
int mon; // Month
int day; // Day
int hour; // Hour
int min; // Minutes
int sec; // Seconds
int day_of_week; // Day of week (0-Sunday, 1-Monday, ... ,6-Saturday)
int day_of_year; // Day number of the year (January 1st is assigned the number value of zero)
};
*/
this is the basic function :
returned value (1 = Friday)One simple script for MT5 B and four questions & problems - General - MQL5 #81 (2023)