Order expiration time

 

Hi,

this is my code:

order_exp = datetime.datetime.now().replace(microsecond = 0) + timedelta(minutes = 5)
        order_exp = int(order_exp.timestamp())

order = {
            'action': mt5.TRADE_ACTION_PENDING,
            'symbol': symbol,
            'volume': quantity,
            'type': mt5.ORDER_TYPE_BUY_LIMIT,
            'price': bp,
            'sl': 0.0,
            'tp': 0.0,
            'deviation': 12,
            "magic": 101101101101101101,
            "comment": "python script open",
            "type_time": mt5.ORDER_TIME_SPECIFIED,
            "expiration": order_exp,
            "type_filling": mt5.ORDER_FILLING_FOK,
            }

            result = mt5.order_send(order)
The problem is I get invalid expiration time. Any idea? Thank you
 
I solved the problem by myself again. Just for those interested the server or MT5 time is or it was because now is reversed GMT+4. Now it might be GMT 
 
Time is server time, always.
Reason: