Initialization

class metatrader5EasyT.initialization.Initialize[source]

This class ensure that the platform are working properly. If it is connected on the internet, and if the symbol that you are trying to use exists or was not mistyped.

__init__()[source]

Initialize the constructor and set the _log.

initialize_platform() bool[source]

This function is responsible to initialize the platform that will be used to trade.

Raises

PlatformNotInitialized – Raise this error when the Metatrader5 is not installed or not possible to load it for some reason.

Returns

It returns true if initialized else return false.

Examples

>>> # All the code you need to execute the function:
>>> from metatrader5EasyT.initialization import Initialize
>>> initialize = Initialize()
>>> # The function and the function return:
>>> initialize.initialize_platform()
True
initialize_symbol(*symbols: str) bool[source]

This function is responsible to initialize as many symbols as you want.

Parameters

symbols – It receives strings as parameters containing the symbol names to be initialized.

Raises

SymbolNotFound – If not possible to initialize the symbol raises this error.

Returns

When the symbol is successfully initialized it returns True and, it updates the list self.symbol_initialized if you want to work with the symbols correctly initialized.

Examples

>>> # All the code you need to execute the function:
>>> from metatrader5EasyT.initialization import Initialize
>>> initialize = Initialize()
>>> initialize.initialize_platform()
>>> # The function and the function return:
>>> initialize.initialize_symbol('EURUSD')
True
>>> # Check initialize.symbol_initialized to see the list of initialized symbols
['EURUSD']
exception metatrader5EasyT.initialization.PlatformNotInitialized[source]

Raise this error when the Metatrader5 is not installed or not possible to load it for some reason.

exception metatrader5EasyT.initialization.SymbolNotFound[source]

Raise this error when the symbol is not found.