OCO - one cancel another script

 

hi,

anyone knows where can i get an OCO script...

onc cancel another which means like when i straddle and my long is triggered my short will automatically be cancel

thanks

 

hi

newt:
hi,

anyone knows where can i get an OCO script...

onc cancel another which means like when i straddle and my long is triggered my short will automatically be cancel

thanks

Did u mean for closing position or opening ? for closing position in MT4 if u use SL and TP they will act like OCO ..it will cancel each other

===================

Forex Indicators Collection

 

Oco

Here you go...

Regards

Files:
oco.mq4  6 kb
 

thanks

 

gee how to use it...

i tried but it say trade is not allowed on expert advisor property

 

Newt,

Sorry, I can't help you, I dont use this script. I found it the last week. Maybe someone could check it !

Regards

 

newt,

Have you put in the script in this folder below ?

It should be put in Metatrader experts/scripts folder and after compilation will be available in Navigator/Scripts.

Have a nice day

 
Leo:
newt,

Have you put in the script in this folder below ?

It should be put in Metatrader experts/scripts folder and after compilation will be available in Navigator/Scripts.

Have a nice day

yup..........

 

Any one can help me with this script?

i getting this error:

2009.05.29 16:10:42 OCO USDCHF,H1: Alert: ERROR #147: expirations are denied by broker

I was thinking its because of the expiration so i try remove these:

//extern datetime Expiration = D'15/7/2010 12:00';

bt = OrderSend(Symbol(), BuyOrderType, BuyLots, BuyOrderPrice, Slippage, bsl, btp, "Buy OCO", Magic,/* Expiration,*/ Blue);

st = OrderSend(Symbol(), SellOrderType, SellLots, SellOrderPrice, Slippage, ssl, stp, "Sell OCO", Magic,/* Expiration,*/ Red);

and still get the same error, any one ?

 

...

Try it this way :

bt = OrderSend(Symbol(), BuyOrderType, BuyLots, BuyOrderPrice, Slippage, bsl, btp, "Buy OCO", Magic,0,Blue);

st = OrderSend(Symbol(), SellOrderType, SellLots, SellOrderPrice, Slippage, ssl, stp, "Sell OCO", Magic,0,Red);

Blueand Redare non-zero values, that is why you keep getting the error

Ricx:
Any one can help me with this script?

i getting this error:

2009.05.29 16:10:42 OCO USDCHF,H1: Alert: ERROR #147: expirations are denied by broker

I was thinking its because of the expiration so i try remove these:

//extern datetime Expiration = D'15/7/2010 12:00';

bt = OrderSend(Symbol(), BuyOrderType, BuyLots, BuyOrderPrice, Slippage, bsl, btp, "Buy OCO", Magic,/* Expiration,*/ Blue);

st = OrderSend(Symbol(), SellOrderType, SellLots, SellOrderPrice, Slippage, ssl, stp, "Sell OCO", Magic,/* Expiration,*/ Red);

and still get the same error, any one ?
 
mladen:
Try it this way :

bt = OrderSend(Symbol(), BuyOrderType, BuyLots, BuyOrderPrice, Slippage, bsl, btp, "Buy OCO", Magic,0,Blue);

st = OrderSend(Symbol(), SellOrderType, SellLots, SellOrderPrice, Slippage, ssl, stp, "Sell OCO", Magic,0,Red);

Blueand Redare non-zero values, that is why you keep getting the error

Thanks man

Reason: