Download MetaTrader 5

EA for Binary Options : How to pass the expiration time in the ordersend() ?

To add comments, please log in or register
Develop applications to order. Make profit using Freelance service!
Nyk Icedryver
27
Nyk Icedryver 2014.10.13 17:22 

Hello,

I try to develop en EA for Binary Options (On MetaTrader 4 with Tradetools FX plug-in for Binary Options).

I have already developped all my indicators and all the structure of the EA.

 

On the Forex, i know how to use the ordersend(), but with binary options, i don't found any information about how to pass the expiry of the binary option.

Of course, i don't speak about the expiration time  of a pending classic orders. But that relates to the expiry of the binary option (60 seconds, 5 minutes, 30 minutes, 1 hour for examples).

I already seen that this BO Expiry doesn't take place in the "expiration time" of the ordersend(). So i don't know where i can give this parameter to the broker when i send an order for a Binary Option.

 

Please, could somebody give me the way of properly placing a binary option order with MQL4 ?


Thanks by advance.

 Regards,

Nyk. 

Jaime Garcia
148
Jaime Garcia 2014.12.27 12:20  

Hello NykIcedryver,

I am looking for the same, please, contact me if you get the solution.

On the other hand, I have create some indicators to trade Binary Options 60 seconds in FX Lite module. Maybe we can share some info.

jglrmm@yahoo.es

BR, jgl. 

younes sami
3521
younes sami 2014.12.29 19:44  

you can't add expiration times in OrderSend() but you can in OrderModify() ,  following this link :

https://docs.mql4.com/trading/ordermodify

Jaime Garcia
148
Jaime Garcia 2014.12.29 21:18  
samimaps:

I have found the solution to open automatically BO in FX Lite. Contact me if you want.

 

jglrmm@yahoo.es 

 

BR. 

Yves Walgraeve
104
Yves Walgraeve 2014.12.30 23:28  
jglrmm:

I have found the solution to open automatically BO in FX Lite. Contact me if you want.

 

jglrmm@yahoo.es 

 

BR. 

Hi Guys


i was looking into the same thing making a EA for binary, i have some very good ideas, now about mql5 but honeltly i lack the programming skills..:)


could we get in touch and exchange some info pls?


eiviss@icloud.com


Thx

Yves

Marcos Maia
159
Marcos Maia 2015.02.28 23:20  

Hey Guys,

 

I usually use the following (for a buy option, for exemple):

 

OrderSend(Symbol(), OP_BUY, Investiment, Close[0], 0, 0, 0, "BO exp:60", magic, 0, clrGreen);

 

where 60 is the 60 seconds position. If you want to open a position of 5min, for exemple, you must use 300 instead of 60. And of course, you must give expirations which match with the ones in your MT4 BO broker.

juantrade
12
juantrade 2015.06.20 02:39  
Marcos Maia:

Hey Guys,

 

I usually use the following (for a buy option, for exemple):

 

 

where 60 is the 60 seconds position. If you want to open a position of 5min, for exemple, you must use 300 instead of 60. And of course, you must give expirations which match with the ones in your MT4 BO broker.

thank you Marcos, it worked for me!
broncoman
571
broncoman 2015.09.22 09:16  

Hi All

I am also trying to get this working with no luck.  I have tried the command advised by Marcos but it rejects it.  I can use a command like this with a OP_BUY OR OP_SELL - however, I need to use an OP_SELLSTOP or OP_BUYSTOP command to issue a BO order with a strike price. 

Here is the command I am using:

OrderSend,AUDUSDbo,OP_SELLSTOP,0.01,.71,5,0,0,"BO exp:60",12345678,0,Orange

I can issue manual trades on this demo platform successfully but need to import trades from a CSV file, using this command.    If anyone can shed some light on why this is not work, I would be eternally grateful if you could PM me or answer via this message.


Thanks.

alexshephard
10
alexshephard 2016.02.11 05:36  

Hi All,

 I tried to open a binary options order by using the following statements, but it returns me error 3

ret = OrderSend(Symbol(),OP_SELL,20.0,Bid,0,0,0,"BO exp:300",0,0,clrGreen);

  Anyone knows how to get rid of this error?

Vasyl Nosal
18547
Vasyl Nosal 2016.02.11 12:39  
broncoman:

Hi All

I am also trying to get this working with no luck.  I have tried the command advised by Marcos but it rejects it.  I can use a command like this with a OP_BUY OR OP_SELL - however, I need to use an OP_SELLSTOP or OP_BUYSTOP command to issue a BO order with a strike price. 

Here is the command I am using:

OrderSend,AUDUSDbo,OP_SELLSTOP,0.01,.71,5,0,0,"BO exp:60",12345678,0,Orange

I can issue manual trades on this demo platform successfully but need to import trades from a CSV file, using this command.    If anyone can shed some light on why this is not work, I would be eternally grateful if you could PM me or answer via this message.


Thanks.

Maybe there is no 1min expiration on that pair?
alexshephard
10
alexshephard 2016.02.11 15:01  

Hi Vasyl, 

 Thank you for you reply. But the expiration is not the problem. Because the EA from my broker works well at the same expiration. 

12
To add comments, please log in or register