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.
- 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']