PyMtApi5: implemented function ChartGetDouble

This commit is contained in:
Vyacheslav Demidyuk
2025-03-13 12:32:54 +02:00
parent 5f55fa68f1
commit 74a64b6fbd
2 changed files with 17 additions and 0 deletions
+10
View File
@@ -73,6 +73,7 @@ class Mt5ApiApp:
"ChartSetDouble": self.process_chart_set_double,
"ChartSetInteger": self.process_chart_set_integer,
"ChartSetString": self.process_chart_set_string,
"ChartGetDouble": self.process_chart_get_double,
}
def on_disconnect(self, error_msg=None):
@@ -545,6 +546,15 @@ class Mt5ApiApp:
result = mtapi.chart_set_string(int(pieces[0]), prop_id, pieces[2])
print(f"> ChartSetString: response = {result}")
def process_chart_get_double(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 ChartGetDouble: {parameters}")
return
prop_id = mt5enums.ENUM_CHART_PROPERTY_DOUBLE(int(pieces[1]))
result = mtapi.chart_get_double(int(pieces[0]), prop_id, int(pieces[2]))
print(f"> ChartGetDouble: response = {result}")
def mtapi_command_thread(self, mtapi):
while mtapi.is_connected():
filename = "client.cmd"