MT5Shutdown

Close the previously established connection to the MetaTrader 5 terminal.

MT5Shutdown()

Return Value

None.

Example:

from datetime import datetime
from MetaTrader5 import * 
 
# connect to MetaTrader 5
MT5Initialize()
# wait till MetaTrader 5 connects to the trade server
MT5WaitForTerminal()
# display data on connection status, server name and trading account
print(MT5TerminalInfo())
# display data on MetaTrader 5 version
print(MT5Version())
# shut down connection to the MetaTrader 5 terminal
MT5Shutdown()

See also

MT5Initialize, MT5WaitForTerminal, MT5TerminalInfo, MT5Version