PyMtApi5: implemented function ChartSymbol

This commit is contained in:
Vyacheslav Demidyuk
2025-03-07 23:36:02 +02:00
parent 1fc6ab77ed
commit 6763dcdc26
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -68,6 +68,7 @@ class Mt5ApiApp:
"ChartFirst": self.process_chart_first,
"ChartNext": self.process_chart_next,
"ChartClose": self.process_chart_close,
"ChartSymbol": self.process_chart_symbol,
}
def on_disconnect(self, error_msg=None):
@@ -505,6 +506,10 @@ class Mt5ApiApp:
result = mtapi.chart_close(int(parameters))
print(f"> ChartClose: response = {result}")
def process_chart_symbol(self, mtapi, parameters):
result = mtapi.chart_symbol(int(parameters))
print(f"> ChartSymbol: response = {result}")
def mtapi_command_thread(self, mtapi):
while mtapi.is_connected():
filename = "client.cmd"
+4
View File
@@ -512,6 +512,10 @@ class Mt5ApiClient:
cmd_params = {"ChartId": chart_id}
return self.__send_command(self.__get_default_expert(), Mt5CommandType.ChartClose, cmd_params)
def chart_symbol(self, chart_id):
cmd_params = {"ChartId": chart_id}
return self.__send_command(self.__get_default_expert(), Mt5CommandType.ChartSymbol, cmd_params)
# Private methods
def __event_thread_func(self):