Hi All,
I am trying to code the closeby function in my EA.
Can anyone tell me how I get the order ticket numbers? Below is the example in the help file.
if I use the order select, select by ticket, wont that just give me the last ticket number?
And how do I know this order ID number before it is opened?
if it is simple to code an example, could someone just knock one out and explain how it works?
//--------------------------------------------------------------------
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);
}
//-------------------------------------------------------------------
Thanks A
I am trying to code the closeby function in my EA.
Can anyone tell me how I get the order ticket numbers? Below is the example in the help file.
if I use the order select, select by ticket, wont that just give me the last ticket number?
And how do I know this order ID number before it is opened?
if it is simple to code an example, could someone just knock one out and explain how it works?
//--------------------------------------------------------------------
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);
}
//-------------------------------------------------------------------
Thanks A