Place a pending buy and a pending sell at the same time???

 

Hi can any one please tell me how to place 2 pending orders on one criteria...


eg. if(xxx && xxx && xxx)

{

ticket = Ordersend(....,OP_BUYSTOP,.....);

ticket = Ordersend(....,OP_SELLSTOP,...);

}


I want to place a pending BUY order and a pending SELL order off one simple criteria. How do I place these two orders at the same time?


Thanx in advance.

Trk

 
Buy stop will need to be above current price, and sell stop, below.
 
phy:
Buy stop will need to be above current price, and sell stop, below.

Thanx phy, I understand that. But I can not seem to get it to place both orders with the code above. What I am asking is if some one can tell me what code is necessary to place both the limit orders off one criteria. actually want to use limit orders sorry it was late and I used the wrong example...I want to place a Buylimit order 10pips above current price and a selllimit 10pips below price but I need both orders placed at the same time..or straight after one another so they are both active orders during the same period.

Thanx

 

"Thanx phy, I understand that. But I can not seem to get it to place both orders with the code above."

The code above is incomplete. Fill in the blanks.

 
phy:
Buy stop will need to be above current price, and sell stop, below.

Phy answer is still the right answer... you need to use 'buy stop' to place 'buy limit' orders ABOVE current mkt and 'sell stop' to place 'sell limit' orders BELOW current mkt... otherwise the server will reject it.

 
code_poet:

Phy answer is still the right answer... you need to use 'buy stop' to place 'buy limit' orders ABOVE current mkt and 'sell stop' to place 'sell limit' orders BELOW current mkt... otherwise the server will reject it.

Thank you, I will use that way.

 

I tried it like this but it doesnt work...please tell me where i am going wrong...I set the entry price when I load the EA, when the price is met it should place the pending orders but it does nothing.


thanx

Files:
 

1. What error do you get?

2. Sometimes comparing doubles for equality does not give the results you expect.

 
phy:

1. What error do you get?

2. Sometimes comparing doubles for equality does not give the results you expect.

What would you suggest I do then as I want to enter the 2 limit orders based on a candles open price... eg: my trigger is the open price of the 2pm candle everyday...at the open price everyday I want the EA to place 2 pending orders...1 pending buy 10pips above price and 1 pending sell 10pips below price.


Sounds easy but I cant get it to place the 2 orders at the open of the candle.


thanx

 

"What would you suggest ..."

1. I suggest you look at the error, if there is one.

2. I suggest you investigate comparing doubles, which doesn't always work as expected. Your buy/sell code may not even be executing.

3. Answer the questions of perople who respond to you, or they will not waste their time.

Have a nice day.

 
phy:

"What would you suggest ..."

1. I suggest you look at the error, if there is one.

2. I suggest you investigate comparing doubles, which doesn't always work as expected. Your buy/sell code may not even be executing.

3. Answer the questions of perople who respond to you, or they will not waste their time.

Have a nice day.

Yes you are right I am sorry I dint answer your questions properly. I will check the things you suggested and then post it here.

Thank you for your advice and interest I have seen your many comments helping people so I appreciate your skill and knowledge and your willingness to help rookies like me.

again sorry for not answering you properly. cheers.

Reason: