Download MetaTrader 5
To add comments, please log in or register
Looking for like-minded people? You will find lots of them on the Forum!
Bukosabino
12
Bukosabino 2014.07.16 13:21 

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.

Alain Verleyen
Moderator
30299
Alain Verleyen 2014.07.16 14:15  
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.

/
To add comments, please log in or register