[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 607

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
Put it that way, I don't know any other way.......)
And so...
want to log EA actions to a file
I took an example from the MQL editor's manual, slightly remade it for my own needs
The result is that the file OrdersReport.csv is empty, although the orders are opened.
I ran into the same problem, when opening a file for reading and trying to write into it, the file is either not created, or nothing is written into it.
Servicedeck application :
When trying to add to a text file deregistered with FILE_READ|FILE_WRITE key, without first explicitly setting the file pointer with FileSeek(), writing does not happen at all.
In previous versions of the terminal, when pre-reading a text file using FileReadString() function, file pointer is set automatically.
Here is an answer from developers:
The last change of file functionality dates back to mid-2008.
Never before has it been possible to append to a file without first setting a file pointer at the end.
Again a question about extra information. Does this have anything to do with appending to the end of a file?
Any file read-write operations automatically move the file pointer around. This has always been the case and has not changed. However, if the file is opened as a csv, intermediate data buffering is possible. Then the file pointer may not be where you expect it to be. Again, this has always been the case, both in the previous version and in the pre-release, since the beginning of the official release.
We have reiterated many times that the default principle is extremely detrimental. Including for file pointers. Handle the file pointer explicitly unless you use continuous reading or continuous writing (especially the exotic mixed read-write cases).
Conclusion: use FileSeek
Check.
Your Expert Advisor trades on 30 min ADX signals. If your Expert Advisor trades on 1min ADX signals, such signals will be more frequent than in the first variant. Screenshot in your variant is taken only at BUY position opening.
You are interested in the absence of indicators from the chart in the screenshot (in test mode). You were asked to verify the presence of indicators on the screenshot in demo mode. The script with the appropriate function was added, so you could check and understand your question quickly, instead of waiting for hours. More than a day has passed. I want to know -- what are your results?
I'll keep you posted. I'm busy but I'll try to check tomorrow.
Can you tell me what the difference is when defining a name in a function or when assigning a variable name and then passing the variable to a function?
Thank you in advance.
You can do it this way, it works for me
double BullPrice()
{
double BullAveragePrice=0;
doubleSummBullLots=0;
for (int i = OrdersTotal() - 1; i >= 0; i--)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol()) continue;
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY)
{
BullAveragePrice+=OrderOpenPrice()*OrderLots();
MySummBullLots+=OrderLots();
}
}
if (MySummBullLots>0) BullAveragePrice = NormalizeDouble(BullAveragePrice / MySummBullLots, Digits);
return(BullAveragePrice);
}
In the MT4 folder there is a sample C++ code for all cases in MQL4. Compile that code and paste your own code in it. You will immediately find the difference between yours and the example.
Can you tell me what the difference is when defining a name in a function or when assigning a variable name and then passing the variable to a function?
Otherwise...
Please advise the situation is this, I read a csv file like this
but csv file has a header, the first extra line
How to skip the first line programmatically, or delete it programmatically in general when saving the value it spoils everything.
Thanks in advance.