nicholishen / pymt5adapter---DEPRECATED

A drop-in pythonic adapter for the MetaTrader5 package to enhance usability.
BSD 2-Clause "Simplified" License
86 stars 31 forks source link

symbol_info_tick does not verify that a valid symbol was returned from Metatrader5 #9

Open metaperl opened 3 years ago

metaperl commented 3 years ago

symbol_info_tick does not ensure that a valid value was obtained. If one has not shown the symbol in the Market Watch window then 'None' is returned for the symbol instead of an exception.

nicholishen commented 3 years ago

That is the default behavior programmed by MetaQuotes. In order to modify that behavior using pymt5adapter you have to use the context manager and set the raise_on_errors flag.

import pymt5adapter as mta
with mta.connected(raise_on_errors=True):
    s = mta.symbol_info_tick('Not a symbol')