I have 2 or more sell order, how get OrderOpenPrice each of them???

 

Hi everybody, 

I have >= 2 sell orders, how can i get OrderOpenPrice each of them???

Exam: i have 2 sell orders, 3 buy ordesr, 1 buystop order, 1 sellstop order.

I want get OrderTicket each of them to compare OrderOpenPrice between sell order vs  sellstop, buy vs buystop, 

This is my code, it get only one order :( 

switch ( OrderType() )

            {

               case OP_BUY:  BuyOrders++  ; int magicbuy = OrderTicket(); //Print ("Order ticket =", magicbuy);

               break;

               case OP_SELL: SellOrders++ ; int magicsell = OrderTicket(); //Print ("Order ticket =", magicsell);

               break;

               case OP_BUYSTOP:  BuyStopOrders++  ; int magicbuystop = OrderTicket(); //Print ("Order ticket =", magicbuy);

               break;

               case OP_SELLSTOP: SellStopOrders++ ; int magicsellstop = OrderTicket(); //Print ("Order ticket =", magicsell);

               break;

            }   



Plz  help me.

 
mr.thanduc:

Hi everybody, 

I have >= 2 sell orders, how can i get OrderOpenPrice each of them???

Exam: i have 2 sell orders, 3 buy ordesr, 1 buystop order, 1 sellstop order.

I want get OrderTicket each of them to compare OrderOpenPrice between sell order vs  sellstop, buy vs buystop, 

<CODE DELETED>

 Ah, when i send ordersend, i set magic is 1111

<CODE DELETED> 

 But when i select

 <CODE DELETED>

 It not run ??? how to fix it ?

Plz  help me.

Please read some other posts before posting . . .

Please   edit   your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 


 
mr.thanduc:

Hi everybody, 

I have >= 2 sell orders, how can i get OrderOpenPrice each of them???

Exam: i have 2 sell orders, 3 buy ordesr, 1 buystop order, 1 sellstop order.

I want get OrderTicket each of them to compare OrderOpenPrice between sell order vs  sellstop, buy vs buystop, 

Please read the documentation for OrderSelect() . . .  you do not use the magic number for the ticket number,  you use the ticket number.
 
RaptorUK:
Please read the documentation for OrderSelect() . . .  you do not use the magic number for the ticket number,  you use the ticket number.


or if you have not the orderticket of all your trades you have to use a loop checking your trades then

SELECT_BY_POS      ( - index in the order pool,)  instead of SELECT_BY_TICKET
 
RaptorUK:

Please read some other posts before posting . . .

Please   edit   your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 




Thanks Mod 

Plz show me detail how to do, i'm a noob coder @_@ 

 
mr.thanduc:


Thanks Mod 

Plz show me detail how to do, i'm a noob coder @_@ 

Click the link I gave and watch the animated gif . . .  then edit your post . .  please

 

Reason: