[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 524
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
My Expert Advisor opens three orders in my terminal, at some point it should close all three orders, but for some reason it closes only two, it gives no errors.
Here is this piece which should close trades
I do not understand what's wrong and why only two deals are closed. Please tell me who knows what.
Do the cycle differently
This didn't help either though. Not rearranging the loop or substituting continue didn't help, as if the EA doesn't see its own three orders, and only deletes two.
Sometimes things are so incomprehensible, not logical at all, I think there are errors in the terminal environment itself.
How would you better organise the maximum drawdown of the EA, at which it stops working, can you set a static variable that will accumulate the amount of losses?
The Expert Advisor should stop working, but it will start working again after restarting or changing parameters.
When initializing an EA, you can save the current balance in a static variable. And in the Start function, you can check how many percent of the current balance has decreased from the initial one and if the percentage is more than permissible - prohibit to trade. Briefly, without any code. After restarting, the Expert Advisor will remember the new initial balance...
When initializing the Expert Advisor, the current balance can be saved in a static variable. And in the Start function, check how much the current balance has slipped from the initial balance, and if the percentage is higher than allowed - trade is prohibited. Briefly, without any code. After restarting, the Expert Advisor will remember the new initial balance.
Have you understood the question?
1. When initializing the Expert Advisor, you can save the current balance to a static variable. Then the Start function checks by how many percent the current balance has declined from the initial one and if the percentage is higher, the trade will be prohibited. In brief, without any code.
2. After restarting, the assessor will remember the new original balance...
1. You can. I have this option (with code) - you initialize variables yourself:
2. No. It will not remember the balance level that was before the start of this EXPERT the first time. Will only remember the current level in the variable
AccountBalance()
. for this account.
Good afternoon! I had a question before about the correct representation of quotes in Excel. This question has been answered thanks tocosty .Now I have a question, is it possible to make (without MQL5 and dll) the data for more currencies to be uploaded? The schematic is shown below, instead of "..." the corresponding date values, closing price values and current period.
I assume the answer to the question will involve possible corrections to my code. I am attaching the code of Expert Advisor that writes values of closing prices for one, current financial instrument to the file.