Hi,
I'm using MT4 with Binary Options Module to developp some Expert Advisors.
I just have a question : What's the syntax of the MQL4 command ordersend() to give the 3 parameters of the Binary Option ?
In fact, for the Binary Option, we have to give the Investment, the UP or DOWN and the Expiry.
In the parameters of the ordersend(), i don't see this 3 types of parameters for Binary Options.
It seems that UP is equal to BUY and DOWN to SELL !
It seems that Investment take place in the "Number of Lots/Volume" !
But where the Expiry take place ???
At first, i think that could take place in the "Expiration Time", or perhaps in the "StopLess" ? But it seems that's not the case !!
Thanks by advance if anyone could help me.
Regards,
Nyk.
0 ·
Comments
Hit me up on skype at Brymcafee (McAllen TX)
www.tradingaxis.com
First, thanks for your reply.
I understand the fact that the EA run on each Tick Event only, except if we use the OnTimer function with a Timer Event.
And of course, my EA does its works on each tick to determine if it's the moment to send an UP or DOWN for a Binary Option.
But my problem is not that one, but to send the order properly. For a Binary Option, we have to give the Expiry to the Broker.
For example, if i want to place a Binary Option UP with an Expiry of 5 mn, where this information take place in the ordersend(...) ?
When i place an order manually in the interface, i can see the order in my history. I see the Investment take place in Volume, i see the UP equal to BUY (and DOWN to SELL), but the Expiry of the Option is not appears in the order.
So how this parameter is given to the broker ?
Signal push has one that works with a lot of brokers but they charge per trade.
It runs in MT4 and as a google chrome extension is the way I have seen it.
Hit me up on skype at Brymcafee (McAllen TX)
www.tradingaxis.com
And i have an account with a broker that use it.
All is OK from this hand.
On the other hand, the last thing that makes problem is in the developpment of an EA, the usage of the ordersend() ...
I will make somes tests with this command ordersend() ...
Hit me up on skype at Brymcafee (McAllen TX)
www.tradingaxis.com
And i already verified that Trading is Allowed for EA with BO.
For example, send an order without specifying this parameter.
With this format :
ordersend(Symbol(),OP_BUY,10.0,CurrentPrice,0.0,0.0,0.0,"UP",magic,0,clrLime);
- OP_BUY equals to UP for BO, and OP_SELL equals to DOWN dor BO
- The investment for this BO take place in the Volume (10.0 in this example)
If i place an Investment not accepted by the broker (like $5 for example) i have an error 131 (invalid trade volume). With a good value for investment, this error disappear.
But it remains an error 133 (trade not allowed) with this ordersend().
The automatised trading is activated in MetaTrader and the Broker accept trading with EA (i verified with InfoMarket() and IsTradeAllowed()).
So i think this error occured because of the lack of the Expiry in the order ...
So the question is alive ...
To conclude with this question, here is the solution.
The Expiry of the Binary Options take place in the comment with a specific format : "BO exp:60"
The Expiry is in seconds (900 for 15 minutes, 3600 for 1 hour, etc...)
So the full command for a Binary Option is :
OrderSend(Symbol(), Action, Investment, Price, 0, 0, 0, "BO exp:Expiry", magic, 0, Color);
where :
Symbol() is the Symbol to trade
Action is : OP_BUY for UP / OP_SELL for DOWN
Investment is the price to invest in this Binary Options (must correspond to an investment available at your broker) (format double)
Price is the price at the moment the order is sent (for example Close[0])
Expiry is the time of expiry of the Binary Options (in seconds) included in the text of the comment in the format "BO exp:60"
magic is the magic number if you want to use it
the last but one parameter must be 0 (it's the Expiration Time of the ordersend)
This syntax is not so easy to guess !!
i have try to put a EA program on a metatrader 4 chart for binary options trading, but the EA does not work, did you had simular problem and a solution?
Hit me up on skype at Brymcafee (McAllen TX)
www.tradingaxis.com
what exactly doesn't work ? Some errors ? Could you give more details ?
I can see this post is very old. But can someone help me on this topic please.
I wrote a simple EA just to see if this command works; but couldnt get going.
I caught the GetlastError() with "0" which suggests there is no error.
However; i cant see orders being placed in Go Markets BO Pairs (which i opened using fx lite). I can manually place the order; however; it is not working using EA ).
Can someone suggest please.
void OnTick()
{
//ordersend(Symbol(),OP_BUY,10.0,iClose(NULL,0,0),0.0,0.0,0.0,"UP",0,0,clrLime);
OrderSend(Symbol(),OP_BUY,5,iClose(Symbol(),0,0),0,0,0,"BO exp:60",0,0,clrWhite);
}
Thanks
D