Why is this simple Python code not working?

 
if mt5.initialize(path=path, login=login, password=password, server=server, timeout=timeout, portable=portable):
    

print ("Initialization successful")



request = {
    
"action": mt5.TRADE_ACTION_DEAL,
    
"symbol": "6S_M",
    
"volume": 3,
    
"type":mt5.ORDER_TYPE_SELL,
    
"sl": 1.15105,
    
"comment": "python donbk trade entry",

}


print(request)

result = mt5.order_send(request)


# Print the result for debugging


print("Order execution result:", result)


if result is None:
    
        print(f"Order execution failed for symbol.")



# Deinitialize the MetaTrader 5 terminal connection

mt5.shutdown()

Any ideas? It does initialize successfully but I end up with 

Initialization successful

{'action': 1, 'symbol': '6S_M', 'volume': 3, 'type': 1, 'sl': 1.15105, 'comment': 'python donbk trade entry'}

Order execution result: None

Order execution failed for symbol.


Process finished with exit code 0

 
Ricardo Dacosta:

Any ideas? It does initialize successfully but I end up with 

Initialization successful

{'action': 1, 'symbol': '6S_M', 'volume': 3, 'type': 1, 'sl': 1.15105, 'comment': 'python donbk trade entry'}

Order execution result: None

Order execution failed for symbol.


Process finished with exit code 0


Nevermind. Just realized the volume must be in float type and not integer. All good now.