PyMtApi5: implemented function SymbolInfoSessionQuote

This commit is contained in:
Vyacheslav Demidyuk
2025-01-23 22:38:19 +02:00
parent fdb9ebb5de
commit fdd09f2170
2 changed files with 23 additions and 1 deletions
+12
View File
@@ -40,6 +40,7 @@ class Mt5ApiApp:
"SymbolInfoInteger": self.process_symbol_info_integer,
"SymbolInfoString": self.process_symbol_info_string,
"SymbolInfoTick": self.process_symbol_info_tick,
"SymbolInfoSessionQuote": self.process_symbol_info_session_quote,
}
def on_disconnect(self, error_msg=None):
@@ -224,6 +225,17 @@ class Mt5ApiApp:
result = mtapi.symbol_info_tick(symbol)
print(f"> SymbolInfoTick: response = {result}")
def process_symbol_info_session_quote(self, mtapi, parameters):
pieces = parameters.split(" ", 2)
if len(pieces) != 3 or not pieces[0] or not pieces[1] or not pieces[2]:
print(f"! Invalid parameters for command SymbolInfoSessionQuote: {parameters}")
return
symbol = pieces[0]
day_of_week = mt5enums.ENUM_DAY_OF_WEEK(int(pieces[1]))
session_index = int(pieces[2])
result = mtapi.symbol_info_session_quote(symbol, day_of_week, session_index)
print(f"> SymbolInfoSessionQuote: response = {result}")
def mtapi_command_thread(self, mtapi):
while mtapi.is_connected():
filename = "client.cmd"