about : ordercloseby function

 

Hi everbody. At the same time I have several open orders at different parity at different lots, generally my orders are opposite

(example: 1 lot sell at gbpjpy and 0.8 lot buy at gpbjpy).

I want to close all of them at the same time, but pay half commision for opposite orders with ordercloseby function. I urgently need programme code.

Please help me.

Thanks all

 
turtauu wrote >>

Hi everbody. At the same time I have several open orders at different parity at different lots, generally my orders are opposite

(example: 1 lot sell at gbpjpy and 0.8 lot buy at gpbjpy).

I want to close all of them at the same time, but pay half commision for opposite orders with ordercloseby function. I urgently need programme code.

Please help me.

Thanks alot.

Helloooooooo. I need urgent help.................
 

> need urgent help.................

I dont recognise the functionality you describe - please clarify

-BB-

 
BarrowBoy wrote >>

> need urgent help.................

We dont recognise the functionality you describe - please clarify

-BB-

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);
    }
 
turtauu wrote >>

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:

Any opinion about ordercloseby function?

Please help urgently.................

 
turtauu wrote >>

Any opinion about ordercloseby function?

Please help urgently.................

thanks all

i find it :

https://book.mql4.com/trading/orderclose

Reason: