PyMtApi5: implemented function ChartXYToTimePrice

This commit is contained in:
Vyacheslav Demidyuk
2025-02-14 23:26:46 +02:00
parent ad9589e444
commit a3ded61946
2 changed files with 18 additions and 1 deletions
+9 -1
View File
@@ -476,7 +476,7 @@ class Mt5ApiClient:
# ChartWindowFind
def chart_window_find(self, chart_id, indicator_short_name: str):
cmd_params = {"ChartId": chart_id, "IndicatorShortname": indicator_short_name};
cmd_params = {"ChartId": chart_id, "IndicatorShortname": indicator_short_name}
return self.__send_command(self.__get_default_expert(), Mt5CommandType.ChartWindowFind, cmd_params)
# ChartTimePriceToXY
@@ -487,6 +487,14 @@ class Mt5ApiClient:
return (res["Result"]["X"], res["Result"]["Y"])
return None
# ChartXYToTimePrice
def chart_xy_to_time_price(self, chart_id, x, y):
cmd_params = {"ChartId": chart_id, "X": x, "Y": y}
res = self.__send_command(self.__get_default_expert(), Mt5CommandType.ChartXYToTimePrice, cmd_params)
if res is not None and res["RetVal"] == True:
return (res["Result"]["SubWindow"], res["Result"]["Time"], res["Result"]["Price"])
return None
# Private methods
def __event_thread_func(self):