pymt5adapter---DEPRECATED icon indicating copy to clipboard operation
pymt5adapter---DEPRECATED copied to clipboard

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

Open metaperl opened this issue 5 years ago • 1 comments

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.

metaperl avatar Sep 27 '20 21:09 metaperl

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')

nicholishen avatar Sep 28 '20 14:09 nicholishen