My EA sets orders on the signal of the indicator, and if the indicator gives a signal to re-set an existing order, for example with 0.1 lot, then the EA sets one more order which is identical to the existing order, which makes the number of orders increase unreasonably. Question: How to make the EA simply increase the lot size of the existing order in such cases? Is such a modification possible in principle?
yosuf: My EA sets orders on the signal of the indicator, and if the indicator gives a signal to re-set an existing order, for example with 0.1 lot, then the EA sets one more order which is identical to the existing order, which makes the number of orders increase unreasonably. Question: How to make the EA simply increase the lot size of the existing order in such cases? Is such a modification possible in principle?
Switch to MT5 - there will only be one aggregate position there. ;))
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Question:
How to correctly spell to insert Symbol1 and Symbol2 values in the code:
If you remove inverted commas, the code won't compile, and if you put inverted commas in it, it gives out text instead of value.
Question:
how to correctly write Symbol1 and Symbol2 values to be inserted in the code:
If you remove inverted commas, it won't compile, and if it's in inverted commas, it outputs text instead of value.
There are different options
or
There are different options
or
string Symbol2 ="AUDUSD";
string SymbolMax[2] = {Symbol1, Symbol2};
It won't compile this way:
'{' - initialization expected D:\F\\9\experts\ASH_5_102.mq4 (4, 23)
'Symbol1' - expression on global scope not allowed D:\F\9\experts\ASH_5_102.mq4 (4, 31)
'Symbol2' - expression on global scope not allowed D:\F\9\experts\ASH_5_102.mq4 (4, 40)
'}' - unbalanced parentheses D:\F\9\experts\ASH_5_102.mq4 (4, 47)
And the first variant doesn't fit, you should take the names of the pairs from the file.
string Symbol1 ="EURUSD";
string Symbol2 ="AUDUSD";
string SymbolMax[2] = {Symbol1, Symbol2};
It does not compile this way:
'{' - initialization expected D:\F\9\experts\ASH_5_102.mq4 (4, 23)
'Symbol1' - expression on global scope not allowed D:\F\9\experts\ASH_5_102.mq4 (4, 31)
'Symbol2' - expression on global scope not allowed D:\F\9\experts\ASH_5_102.mq4 (4, 40)
'}' - unbalanced parentheses D:\F\9\experts\ASH_5_102.mq4 (4, 47)
The first variant doesn't fit, we should take the names of the pairs from the file.
I agree. I didn't write it correctly.
This should work
I agree. I didn't write it correctly.
That should work.
My EA sets orders on the signal of the indicator, and if the indicator gives a signal to re-set an existing order, for example with 0.1 lot, then the EA sets one more order which is identical to the existing order, which makes the number of orders increase unreasonably. Question: How to make the EA simply increase the lot size of the existing order in such cases? Is such a modification possible in principle?
Can you tell me why when running in the tester on "EURUSD"
returns 0.0 and how to get the price of another instrument in the tester.
Can you tell me why when running in the tester on "EURUSD"
returns 0.0 and how to get the price of another instrument in the tester.