MQL4 Reference
Trading functions
OrderCloseBy
| bool OrderCloseBy( |
int ticket, int opposite, color Color=CLR_NONE) |
Closes an opened order by another opposite opened order.
If the function succeeds, the return value is true.
If the function fails, the return value is false.
To get the detailed error information, call GetLastError().
Parameters:
| ticket |
- |
Unique number of the order ticket. |
| opposite |
- |
Unique number of the opposite order ticket. |
| Color |
- |
Color of the closing arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart. |
Sample:
if(iRSI(NULL,0,14,PRICE_CLOSE,0)>75)
{
OrderCloseBy(order_id,opposite_id);
return(0);
}
|
|
|