OrderSelect()

 

hello,

ticket = OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)

I know if among open or pending orders at position pos if there is an order then ticket = TRUE.

But in which case   ticket = FALSE ?

 
Perhaps you should read the manual. OrderSelect does not return a ticket.
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
          Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
 

In MQL4 manual it's said that OrderSelect return a boolean value.So what do you mean ?May be you're confused by variable ticket and pos


bool  OrderSelect( 
   int     index,            // index or order ticket 
   int     select,           // flag 
   int     pool=MODE_TRADES  // mode 
   );

Parameters

ticket

[in]  Order index or order ticket depending on the second parameter.

select

[in]  Selecting flags. It can be any of the following values:

SELECT_BY_POS - index in the order pool,
SELECT_BY_TICKET - index is order ticket.

pool=MODE_TRADES

[in]  Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values:

MODE_TRADES (default)- order selected from trading pool(opened and pending orders),
MODE_HISTORY - order selected from history pool (closed and canceled order).

Returned value

It returns true if the function succeeds, otherwise falses. To get the error information, one has to call the GetLastError() function.

 
paulselvan: In MQL4 manual it's said that OrderSelect return a boolean value.So what do you mean ?May be you're confused by variable ticket and pos
  1. ticket = OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)
    I'm not confused, you are. It returns a bool. So why did you assign it to ticket. True or False is not a ticket, ever.
  2. You asked "But in which case   ticket = FALSE ?." Read the link previously provided.
 

In this case the word ticket is a variable that contains the booelan return value of the instruction OrderSelct()

I can also call it  by the word bill or anything else...that will not affect this instruction

I suppose when you add a comment your aim is  to extol your knowledge..rather then to answer clearly 

 
paulselvan:

In this case the word ticket is a variable that contains the booelan return value of the instruction OrderSelct()

I can also call it  by the word bill or anything else...that will not affect this instruction

I suppose when you add a comment your aim is  to extol your knowledge..rather then to answer clearly 

If you want answers on this forum I suggest to change your way to answer.

When you receive an answer you should say thank you.  When you don't understand the answer, you should ask more explanation. You should not start to offend the one who tried to help you.

 
paulselvan:

In MQL4 manual it's said that OrderSelect return a boolean value.So what do you mean ?May be you're confused by variable ticket and pos


Parameters

ticket

[in]  Order index or order ticket depending on the second parameter.

select

[in]  Selecting flags. It can be any of the following values:

SELECT_BY_POS - index in the order pool,
SELECT_BY_TICKET - index is order ticket.

pool=MODE_TRADES

[in]  Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values:

MODE_TRADES (default)- order selected from trading pool(opened and pending orders),
MODE_HISTORY - order selected from history pool (closed and canceled order).

Returned value

It returns true if the function succeeds, otherwise falses. To get the error information, one has to call the GetLastError() function.

Hello,

You have supported the answer given to you in 1# and 3#

BTW ticket should be "int ticket"

 
paulselvan:

hello,

ticket = OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)

I know if among open or pending orders at position pos if there is an order then ticket = TRUE.

But in which case   ticket = FALSE ?

You should used <code>(Alt+s)  to show your code issues.

 
paulselvan:

In this case the word ticket is a variable that contains the booelan return value of the instruction OrderSelct()

I can also call it  by the word bill or anything else...that will not affect this instruction

I suppose when you add a comment your aim is  to extol your knowledge..rather then to answer clearly 

Dear friend,

use (Alt+s)

Please reframe from insulting members trying to guide you.

Reason: