Is there a way to ensure two pending orders are filled on the next bar?

 

Hi guys,

I'm just wondering if there's a way to do something like a fill-or-kill with two pending orders - so that if one couldn't be filled, the other wouldn't either?

I suspect not. In that case, is there a way to bias the likelihood of two pending orders being filled in my favour?

There is a buy limit x pips below a sell limit, where x > spread.

Cheers, Paul. 

 
monsterer:

Hi guys,

I'm just wondering if there's a way to do something like a fill-or-kill with two pending orders - so that if one couldn't be filled, the other wouldn't either?

I suspect not. In that case, is there a way to bias the likelihood of two pending orders being filled in my favour?

There is a buy limit x pips below a sell limit, where x > spread.

Cheers, Paul. 


If you wait for long it might you hit both limit trades but no way it will be happen at same time


 Requirements and Limitations in Making Trades   

placing a limit trade there are some rules for distance to place

I don't know what you or maybe your customer is wanting

This is not the same as programming games you have to learn yourself trading forex

Maybe it might be easier to program two levels a buylevel and a selllevel

if that level is hit then place a directly  buy/sell trade depending what level is hit

 

to ensure two pending orders are filled on the next bar?

and if no pending is hit in the time you like to see them hit,  then you just delete them   OrderDelete(orderTicket()) 

 
monsterer:

Hi guys,

I'm just wondering if there's a way to do something like a fill-or-kill with two pending orders - so that if one couldn't be filled, the other wouldn't either?

I suspect not. In that case, is there a way to bias the likelihood of two pending orders being filled in my favour?

There is a buy limit x pips below a sell limit, where x > spread.

Cheers, Paul. 


It depends on what you're doing and any time limit you have for the orders being filled but you could have a look at setting an expiry date/time on the orders so they are both removed automatically at a specified later time.

Regards, Paul.

 

The most troublesome problem for me is having one order fill and then the price moves away and doesn't return for days, so the other order is left hanging (since this is a hedging strategy).

I might try to gather some statistics on where the candles big enough to fill these orders together form and at what price the centre must be positioned at on the current bar in order to hit them next bar.

Cheers, Paul. 

 
monsterer:
I'm just wondering if there's a way to do something like a fill-or-kill with two pending orders - so that if one couldn't be filled, the other wouldn't either?
I suspect not

Of course not.

Are you trying to open two in the same direction? Use one with partial close.

 
WHRoeder:

Of course not.

Are you trying to open two in the same direction? Use one with partial close.



No, opposite directions spaced apart by some amount of pips - the buy is always lower than the sell, therefore it always makes a profit provided that both orders actually fill, and the gap is larger than the spread.
 
monsterer:

No, opposite directions spaced apart by some amount of pips - the buy is always lower than the sell, therefore it always makes a profit provided that both orders actually fill, and the gap is larger than the spread.


try it out open buytrade 1 lot

if price goes up open selltrade 1 lot 

how much more profit will you get if price goes up more ???

and what will happen then after selltrade opened   if price goes down ???

in that case why not close buy ???  and takeprofit ...... 

 
deVries:


try it out open buytrade 1 lot

if price goes up open selltrade 1 lot 

how much more profit will you get if price goes up more ???

and what will happen then after selltrade opened   if price goes down ???

in that case why not close buy ???  and takeprofit ...... 


As soon as the sell-trade opens your maximum profit is equal to the distance between them minus the spread.

If the price goes down after the sell-trade opened nothing happens, you still get the profit from the gap. 

 
monsterer:


As soon as the sell-trade opens your maximum profit is equal to the distance between them minus the spread.

If the price goes down after the sell-trade opened nothing happens, you still get the profit from the gap. 


and so you have if you just closed the buy trade instead of having two opposite trades open on your account
 
deVries:

and so you have if you just closed the buy trade instead of having two opposite trades open on your account

Of course. But the idea with this method is that is suits ranging markets, rather than trending.
Reason: