PyMtApi5: implemented function SymbolInfoString; formatted code.

This commit is contained in:
Vyacheslav Demidyuk
2025-01-18 00:32:44 +02:00
parent 150995baea
commit 33bff44b39
4 changed files with 563 additions and 526 deletions
+11
View File
@@ -38,6 +38,7 @@ class Mt5ApiApp:
"SymbolIsSynchronized": self.process_symbol_is_synchronized,
"SymbolInfoDouble": self.process_symbol_info_double,
"SymbolInfoInteger": self.process_symbol_info_integer,
"SymbolInfoString": self.process_symbol_info_string,
}
def on_disconnect(self, error_msg=None):
@@ -204,6 +205,16 @@ class Mt5ApiApp:
result = mtapi.symbol_info_integer(symbol, prop_id)
print(f"> SymbolInfoInteger: response = {result}")
def process_symbol_info_string(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 SymbolInfoString: {parameters}")
return
symbol = pieces[0]
prop_id = mt5enums.ENUM_SYMBOL_INFO_STRING(int(pieces[1]))
result = mtapi.symbol_info_string(symbol, prop_id)
print(f"> SymbolInfoString: response = {result}")
def mtapi_command_thread(self, mtapi):
while mtapi.is_connected():
filename = "client.cmd"