OrderSend() for binary options

 

I want a EA for binary options.

I would like the MqlTraderRequest expirate every period. I don't need takeprofit or stoploss for trigger the order.

 My proposal:

mrequest.action = TRADE_ACTION_PENDING;
mrequest.price = NormalizeDouble(latest_price.bid,_Digits);
mrequest.sl = NormalizeDouble(latest_price.bid + STP*_Point,_Digits);
mrequest.stoplimit = NormalizeDouble(latest_price.bid + STP*_Point,_Digits);
mrequest.tp = NormalizeDouble(latest_price.bid - TKP*_Point,_Digits);
mrequest.symbol = _Symbol;
mrequest.volume = Lot;
mrequest.magic = EA_Magic;
mrequest.type= ORDER_TYPE_SELL;
mrequest.type_filling = ORDER_FILLING_FOK;
mrequest.type_time = ORDER_TIME_SPECIFIED;
mrequest.expiration = TimeTradeServer()+PeriodSeconds(PERIOD_M1);

This struct give errors always. I have tried different combinations for action, type_time, expiration... but no way.

Thanks you.

 
Bukosabino:

I want a EA for binary options.

I would like the MqlTraderRequest expirate every period. I don't need takeprofit or stoploss for trigger the order.

 My proposal:

This struct give errors always. I have tried different combinations for action, type_time, expiration... but no way.

Thanks you.

Which MT5 broker provides you binary options ? I thought it was not available for MT5.

Anyway, you can't certainly not use a pending order for binary option.

Reason: