[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 392
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
Good evening!
Please advise me on the possible source of the error. I'm just learning the language, so I'm a little stumped.
The task in Expert Advisor code is to read data from .scv file (two values in a line, 400 lines) and write them into an array.
The problem is this: if I throw the EA on a chart, it prints an alert with the correct values from the array, but if I try to test the EA, it prints an alert "No file" in the log. That is, it seems it cannot access the file (although it's unbelievable) and writes values into the array (which is confirmed by another alert), but gets stuck on finding the file, according to the log. Confused. Below is a screenshot.
If a file is open, it should be closed, even if an error is received in working with it. I don't see any more errors so far.
It can be read like this:
signals_array[i][j] = FileReadDouble(Handle);
In the tester and in the chart, the files are written and read in different directories:
Yuri, respect! I have understood it now and fixed it.
Zhunko, thank you. I tried it that way, but I got an error something like can't read binary data from string file or something like that. Anyway, my construction works.
Imho, I would not create an array of tickets to close, but in the market order enumeration loop check each order by feeding its ticket to the input of the closing function with a check of possible conditions.
Can you show this in the code?
I mean, how can this be implemented?
Good afternoon everyone!
Maybe this question is not for the newbies, but I couldn't find another thread where I could ask a question:
How can I unload a detailed report from MetaTrader 4 to have equity on the chart instead of balance? I don't know, if I uploaded it from MT4 or some other convenient way, would it be realistic? I don't know if I have the right balance or not, I just want to know the drawdown results.
I have no idea how to use this brokers.
Can you show it in code?
I mean, how can it be implemented?
Something like this?
help please.
Here's the code
I have no way to make a loop open when a deal was closed in minus and if the next order closed above zero, i.e. positive balance, but less than negative, we add plus to negative and get a new negative value, which is already less.
If it is more negative, according to the signal, we close the order and start the cycle from the beginning.
The situation is that when this code closes the deal in loss, then it remembers the minus balance, and when it closes the deal in the plus, and the plus is less than the balance, then it resets Sum_Loss and I need that it would not zeroed, and mowed down.
So this is how it works now:
it checks a closed order, if the profit of closed order is less than zero, then this profit is added to Sum_Loss, and so on until the profit of open trade exceeds (will be more than) Sum_Loss, when reached, the trade is closed, and Sum_Loss is zeroed and the cycle begins again.
I need:
order closed in minus, its minus profit was added to Sum_Loss, then if the next deal closed with a positive profit, Sum_Loss is reduced by the amount derived from the profit, which means that the next open order Sum_Loss is already a smaller amount, and so on until the order profit is greater than Sum_Loss, and then Sum_Loss is cleared and a new cycle starts.
Sum_Loss = 0;
1st closed order: Profit (-50) < 0
Sum_Loss + profit (Sum_Loss + (-50))
Sum_Loss = -50;
2nd closed order: Profit (+40) > 0 and Sum_Loss < 0
Sum_Loss + profit (Sum_Loss + 40)
Sum_Loss = -10
Maybe the Sum_Loss variable should be specified as a negative variable? in general I am confused. I have tried many variants, but I have not got the right result. I have tried a lot of variants and still do not get the right result.How can I test an EA without taking the spread into account? Is it possible?
Who has such a turkey?
Please help.
I put a modifier of pending orders, in the EA, and it gives me an error - 1 when testing in the Journal.
I.e. - "If I pass unchanged values as function parameters, error 1 (ERR_NO_RSULT) will be generated".
I put a check before modification, but it doesn't help. What is the error? The EA is being tested, but how can I sift out orders with unchanged values?