Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 248
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
Why are you reading from a file? You have the whole file in the ReadCBOE variable, you can use it,
No problem with it, but not all line fits in the variable! MT has its own restrictions on the length of line, while the file is written to the info from the site, and the file ends </body></html> while the line - breaks at 65k characters (or so). In any case the final file size is 69KB.
Read the article. Basically there is no way in nature to read a given line of a file, you have to read all lines up to a given line... There is a function in the article for reading a text file line by line.
Wow, thanks, didn't find it myself, should have searched by HTML tag.
That's how it works. Checked it out.
Anyway, there is an error, and here it is
You're a hero, Junko, silently fixing the code and... as if that's what happened. You're going to tell me it was like that, and I'm just bullshitting you? Yeah?
Fixed what? Checking for NULL? That's fine. What's wrong? If I find a mistake, I fix it.
You don't fix it. I saw that. Even when you pointed it out, you didn't correct it. You like making mistakes and not correcting them? Then you brag about it?
=============
I'm excused. I almost never write in MQL4. I have written everything I need. I don't work with descriptors and errors. They were written long ago, encapsulated and forgotten.
In C++, descriptors are usually compared to NULL.
Anyway, there is an error, and here it is
Write something else, or delete the file, or put a write-only flag on it.
Fixed what? Checking for NULL? That's fine. What's wrong? If I find a mistake, I fix it.
You don't fix it. I saw that. Even when you pointed it out, you didn't correct it. You like making mistakes and not correcting them? Then you brag about it?
=============
I'm excused. I almost never write in MQL4. I have written everything I need. I do not work with descriptors and errors. They were written long ago, encapsulated and forgotten.
In C++, descriptors are usually compared to NULL.
It's not. It works. It's just that this code doesn't overwrite the file. You're looking at a file that's already written. It doesn't seem to work. In fact, it was written where it should be, but the continuation of the line is still the old one.Write something else, or delete a file or set a write-only flag.
Yep, it's working...Thanks.
extern int OpenMM = 25; // Время открытия ордеров (минуты).
extern int CloseHH = 23; // Время закрытие/удаление ордеров (часы).
extern int CloseMM = 45; // Время закрытие/удаление ордеров (минуты).
This part of the code works and there are no complaints about it. Orders on Friday, 23:45 close normally. The DeleteOrders() function works fine.
if (!IsTradeAllowed()) return(0); // Пропустить тик, если терминал занят.
if (Close_All_Orders) // Разрешение на закрытие ордеров.
if (DayOfWeek() >= 5 && // Если пятница и закрытие ордеров разрешено, то
TimeHour(TimeCurrent()) >= CloseHH && // в назначенный час
TimeMinute(TimeCurrent()) >= CloseMM ) // в назначенные минуты -
{ DeleteOrders(); return(0); } // все ордера закрываются.
The code for opening orders is made by analogy. The code does not work at all in the specified form.
However, if we remove or comment out the line with minutes, everything works fine and orders open at 14:00. The function OpenOrders() works fine.
What may be the problem in this (or other) code line: TimeMinute(TimeCurrent()) >= OpenMM ?
if (TimeHour(TimeCurrent()) >= OpenHH && // В назначенный час,
TimeMinute(TimeCurrent()) >= OpenMM ) // в назначенные минуты -
{ OpenOrders(); return(0); } // открыть ордера.
PS: Basically, there are quite a few EAs on the Internet which open and close orders by time. But, for one reason or another, they may not be satisfactory. I would like to deal with the above error...
Thank you...
Good afternoon. Help me out with this error.
Everything seems to be correct, it should work. Tried your code in mine - it works with minutes. But only from 14:25 to 14:59, from 15:25 to 15:59 etc.
Maybe that's better.
Maybe that's better.