Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1913
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
The point is only one, so that the ChartSetSymbolPeriod() function is not pulled unnecessarily;
In principle, yes. But the question was about error presence, not about expediency of this condition...
Good afternoon, dear developers!
I am faced with the need to group orders to work with each group separately (closing, topping up, etc.). I think the task is not too difficult, but I have no idea how to solve it. I have a very unclear idea, that's all. No one has faced such a problem? Grouping may be done in any way(global variables terminal, comments, etc.). I would be grateful for any help.
Why do not you want to use Magik? Because there may be more than one magician in one EA...
Why isn't a magician suitable? After all, there can be more than one magician in one councillor...
Magik is also suitable. I assume that all these options will have almost the same algorithm. So, it does not matter. The main thing is to find the solution).
Magik
Magik is also suitable. I assume that all these options will have almost the same algorithm. So it's all the same. The main thing is to find a solution).
Of course the solution is the same. You define the criterion according to which the order belongs to this or that group and identify it according to this criterion...
Thank you for your participation. The mission statement is clear to me. I'm stuck with the implementation...
Tried it with the comments. Up to the second group it numbers correctly. On the third it returns one for the comment, although the first group is still on the market. The idea is not to multiply numbers, but to take the vacated ones. I hope I explained it clearly).
for(int a=1; a<10; a++)
{
comment=";
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic)
{
//Print(OrderComment();
if(OrderComment()==IntegerToString(a)) continue;
else
{
comment=IntegerToString(a);
break;
}
}
}
}
if(comment!="") break;
}
if(CountOfBuy(magic)<1 && CountOfSell(magic)<1) comment="1";
Thank you for your participation. The mission statement is clear to me. I'm stuck with the implementation...
Tried it with the comments. Up to the second group it numbers correctly. On the third it returns one for the comment, although the first group is still on the market. The idea is not to multiply the numbers, but to take the vacated ones. I hope I explained it clearly).
Not quite clear, but still use the button to insert code
or ALT+s
Good evening everyone!
I've written a function that determines if a pending order is already set, but the function doesn't work for some reason. Can you please tell us where the error is? Sincerely, Vladimir.
I HAVE FOUND THE ERROR MYSELF!!!
Here is a normally working code. May be useful for someone. Regards, Vladimir.