Smart people, advise a simple thing. I have three Expert Advisors working simultaneously on different currency pairs. If one of them wants to trade, how can I check, if there are already open trades on this currency pair? When only one Expert Advisor is working, everything is easy. OrderTotal(). When there are a lot of them, what to do?
Smart people, advise a simple thing. I have three Expert Advisors working simultaneously on different currency pairs. If one of them wants to trade, how can I check, if there are already open trades on this currency pair? When only one Expert Advisor is working, everything is easy. OrderTotal(). When there are a lot of them, what to do?
Before you search for "your" (opened by a specific advisor) order, you need to assign it a unique MAGIC when it is opened. And then use the MAGIC to decide your question.
TarasBY: Before you look for "your" (open by a specific EA) order, you need to assign it a unique MAGIC when you open it. And then, using the MAGIC, your question will be solved.
You can also use the OrderSymbol() command
like this
int count_orders=0;
string Symbole=eurusd;
for (int i = OrdersTotal() - 1; i >= 0; i--)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if ( OrderSymbol()==Symbole) count_orders=count_orders+1;
}
Hello Dear forum users, I'm a newbie, I'm writing my first Expert Advisor, can you help me fix an algorithmic bug, (closing orders by criterion does not work((?)), here is a file ...
Equilibrium: Hello Dear forum users, I am a newbie, I am writing my first Expert Advisor, can you help me fix an algorithmic error, (closing orders by criterion does not work((?), here is the file...
would you add a message to log when order closes or does it not work at all to try to close?
Can you please tell me if there are ways to output elements of a one-dimensional array to comment () (or something else), and the size of the array can vary, but it's unlikely to be more than 20 elements there in my case.
Can you please tell me if there are ways to output elements of a one-dimensional array to comment() (or something else), and the size of the array can vary, but it's unlikely to be more than 20 elements there in my case.
In the loop, consecutively read all the elements of the array and form one string variable (with separators) from them. And output this variable to Comment.
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.
Hello.
Smart people, advise a simple thing. I have three Expert Advisors working simultaneously on different currency pairs. If one of them wants to trade, how can I check, if there are already open trades on this currency pair? When only one Expert Advisor is working, everything is easy. OrderTotal(). When there are a lot of them, what to do?
Hello.
Smart people, advise a simple thing. I have three Expert Advisors working simultaneously on different currency pairs. If one of them wants to trade, how can I check, if there are already open trades on this currency pair? When only one Expert Advisor is working, everything is easy. OrderTotal(). When there are a lot of them, what to do?
Good evening all.
I tried to write an indicator (it's my first indicator) which should display minimum and maximum price value among the last n bars.
I can't figure out where I'm going wrong.
Please help me to understand what i want to do!
The countdown starts from 1 bar.
Try it:
TarasBY:
Взрослый вопрос! Про OrderMagicNumber() что-нибудь слышали?
Heard it. I don't see how it will help me in solving my problem.
Let me rephrase the question: how do I determine whether there are open trades on a particular currency pair or not?
Before you look for "your" (open by a specific EA) order, you need to assign it a unique MAGIC when you open it. And then, using the MAGIC, your question will be solved.
You can also use the OrderSymbol() command
like this
Hello Dear forum users, I am a newbie, I am writing my first Expert Advisor, can you help me fix an algorithmic error, (closing orders by criterion does not work((?), here is the file...
would you add a message to log when order closes or does it not work at all to try to close?
Hello all.
Can you please tell me if there are ways to output elements of a one-dimensional array to comment () (or something else), and the size of the array can vary, but it's unlikely to be more than 20 elements there in my case.
Hello all.
Can you please tell me if there are ways to output elements of a one-dimensional array to comment() (or something else), and the size of the array can vary, but it's unlikely to be more than 20 elements there in my case.