Please use this to post code . . . it makes it easier to read.
If you are using MarketInfo(Symbol, MODE_BID) you are not using a PredefinedVariable so you don't need to refresh the predefined variable that you aren't using . . .
What is int() ?
RaptorUK:
Please use this to post code . . . it makes it easier to read.
If you are using MarketInfo(Symbol, MODE_BID) you are not using a PredefinedVariable so you don't need to refresh the predefined variable that you aren't using . . .
What is int() ?
vulcano:
vulcano:
It will make it faster . . . . but maybe not by much.
Then I have to remove the refrehsrates?
That will make closing faster?
That will make closing faster?
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
I have a problem. I want to close all open orders at a time but takes longer than 5 minutes to close them. Usually more than 50 orders simultaneously.
This is the code I'm using to close:
OrdersTotal iOrdersTotal1 = int ();
for (int i1 = iOrdersTotal1-1, i1> = 0, i1 -)
{
OrderSelect (i1, SELECT_BY_POS);
OrderType iOrderType1 = int ();
switch (iOrderType1)
{
OP_BUY case:
{
RefreshRates (); OrderClose (OrderTicket (), OrderLots (), MarketInfo (OrderSymbol (),MODE_BID), 3, CLR_NONE);
}
OP_SELL case:
{
RefreshRates (); OrderClose (OrderTicket (), OrderLots (), MarketInfo (OrderSymbol (),MODE_ASK), 3, CLR_NONE);
}
}
}
The question is:
Is there any way to close all orders at once but take so long?
Thank you.