OCO - one cancel another script

To add comments, please log in or register
newt
173
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

prasxz
1259
prasxz  

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

Leo
9
Leo  

Oco

Here you go...

Regards

Files:
oco.mq4 6 kb
newt
173
newt  

thanks

newt
173
newt  

gee how to use it...

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

Leo
9
Leo  

Newt,

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

Regards

Leo
9
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

newt
173
newt  
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..........

Ricx
129
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 Rakic
183289
Mladen Rakic  

...

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 ?
Ricx
129
Ricx  
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

12
To add comments, please log in or register