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
Igor has functions NumberOfOrders and NumberOfPositions that return the number of orders and positions. How can I make a universal function that would return both
OP_BUY and OP_SELL and OP_BUYSTOP and OP_SELLLIMIT in one function?
fill in an array of counters - for each order type.
How does it work? The function must return either a specific order type or if -1, all 6 types
.
Igor has functions NumberOfOrders and NumberOfPositions that return the number of orders and positions. How can I make a universal function that would return both
OP_BUY and OP_SELL and OP_BUYSTOP and OP_SELLLIMIT in one function?
It is not very difficult to make. Or rather, there is one. More than once I have posted mine on all types of orders
Igor has functions NumberOfOrders and NumberOfPositions that return the number of orders and positions. How can I make a universal function that would return both
OP_BUY and OP_SELL and OP_BUYSTOP and OP_SELLLIMIT in one function?
It's not hard to do. Or rather, there is one. I have posted mine more than once on all types of orders
Please tell me what's wrong ???? It opens two pendants and deletes them at once. I need the second one to be deleted when one triggered..... please help...... I've been struggling with it for 2 days now.......
int total = OrdersTotal();
int i;if ((Ask>=OP_BUYSTOP || Bid<=OP_SELLSTOP)==-1)
{
i=0;
total = OrdersTotal();
for(i = 0; i <= total; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderMagicNumber() == 227)
{
if(OrderType()>1)OrderDelete(OrderTicket());
}
}
}
Please tell me what's wrong ???? It opens two pendants and deletes them at once. I need the second one to be deleted when one triggered..... please help...... I've been struggling with it for 2 days now.......
int total = OrdersTotal();
int i;if ((Ask>=OP_BUYSTOP || Bid<=OP_SELLSTOP)==-1) ??????? What is it ? You are comparing prices with order types. It's like this: "which is longer: a litre or a kilo ?" and why the comparison with -1 ? And for which instrument are the ask and bid between 4 and 5 constantly "dangling" ?
{
i=0;
total = OrdersTotal();
for(i = 0; i <= total; i++) // if (OrderMagicNumber() == 227) // the direction of search is wrong and out of array
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderMagicNumber() == 227)
{
if(OrderType()>1)OrderDelete(OrderTicket()); ??????? And here you delete all pending orders
}
}
}
Use code insertion tags for better readability.