mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-21 14:48:25 +00:00
PyMtApi5: implemented function SymbolInfoInteger
This commit is contained in:
@@ -83,6 +83,8 @@ class Mt5ApiApp:
|
|||||||
self.process_symbol_is_synchronized(mtapi, params)
|
self.process_symbol_is_synchronized(mtapi, params)
|
||||||
elif pieces[0] == "SymbolInfoDouble":
|
elif pieces[0] == "SymbolInfoDouble":
|
||||||
self.process_symbol_info_double(mtapi, params)
|
self.process_symbol_info_double(mtapi, params)
|
||||||
|
elif pieces[0] == "SymbolInfoInteger":
|
||||||
|
self.process_symbol_info_integer(mtapi, params)
|
||||||
else:
|
else:
|
||||||
print(f"! Unknown command: {pieces[0]}")
|
print(f"! Unknown command: {pieces[0]}")
|
||||||
|
|
||||||
@@ -202,6 +204,16 @@ class Mt5ApiApp:
|
|||||||
result = mtapi.symbol_info_double(symbol, prop_id)
|
result = mtapi.symbol_info_double(symbol, prop_id)
|
||||||
print(f"> SymbolInfoDouble: response = {result}")
|
print(f"> SymbolInfoDouble: response = {result}")
|
||||||
|
|
||||||
|
def process_symbol_info_integer(self, mtapi, parameters):
|
||||||
|
pieces = parameters.split(' ', 1)
|
||||||
|
if len(pieces) != 2 or not pieces[0] or not pieces[1]:
|
||||||
|
print(f"! Invalid parameters for command SymbolInfoInteger: {parameters}")
|
||||||
|
return
|
||||||
|
symbol = pieces[0]
|
||||||
|
prop_id = mt5enums.ENUM_SYMBOL_INFO_INTEGER(int(pieces[1]))
|
||||||
|
result = mtapi.symbol_info_integer(symbol, prop_id)
|
||||||
|
print(f"> SymbolInfoInteger: response = {result}")
|
||||||
|
|
||||||
def mtapi_command_thread(self, mtapi):
|
def mtapi_command_thread(self, mtapi):
|
||||||
while mtapi.is_connected():
|
while mtapi.is_connected():
|
||||||
filename = "client.cmd"
|
filename = "client.cmd"
|
||||||
|
|||||||
@@ -328,6 +328,12 @@ class Mt5ApiClient:
|
|||||||
return self.__send_command(
|
return self.__send_command(
|
||||||
self.__get_default_expert(), Mt5CommandType.SymbolInfoDouble, cmd_params)
|
self.__get_default_expert(), Mt5CommandType.SymbolInfoDouble, cmd_params)
|
||||||
|
|
||||||
|
# SymbolInfoInteger
|
||||||
|
def symbol_info_integer(self, symbol_name: str, prop_id: ENUM_SYMBOL_INFO_INTEGER):
|
||||||
|
cmd_params = {"Symbol": symbol_name, "PropId": prop_id}
|
||||||
|
return self.__send_command(
|
||||||
|
self.__get_default_expert(), Mt5CommandType.SymbolInfoInteger, cmd_params)
|
||||||
|
|
||||||
# Private methods
|
# Private methods
|
||||||
|
|
||||||
def __event_thread_func(self):
|
def __event_thread_func(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user