mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-14 19:28:09 +00:00
PyMtApi5: implemented function ChartId
This commit is contained in:
@@ -57,6 +57,7 @@ class Mt5ApiApp:
|
|||||||
"CopyRealVolume": self.process_copy_real_volume,
|
"CopyRealVolume": self.process_copy_real_volume,
|
||||||
"CopySpread": self.process_copy_spread,
|
"CopySpread": self.process_copy_spread,
|
||||||
"CopyTicks": self.process_copy_ticks,
|
"CopyTicks": self.process_copy_ticks,
|
||||||
|
"ChartId": self.process_chart_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
def on_disconnect(self, error_msg=None):
|
def on_disconnect(self, error_msg=None):
|
||||||
@@ -422,6 +423,10 @@ class Mt5ApiApp:
|
|||||||
result = mtapi.copy_ticks(symbol_name, timeframe, from_date, count)
|
result = mtapi.copy_ticks(symbol_name, timeframe, from_date, count)
|
||||||
print(f"> CopyTicks: response = {result}")
|
print(f"> CopyTicks: response = {result}")
|
||||||
|
|
||||||
|
def process_chart_id(self, mtapi, parameters):
|
||||||
|
result = mtapi.chart_id(int(parameters))
|
||||||
|
print(f"> ChatId: response = {result}")
|
||||||
|
|
||||||
def mtapi_command_thread(self, mtapi):
|
def mtapi_command_thread(self, mtapi):
|
||||||
while mtapi.is_connected():
|
while mtapi.is_connected():
|
||||||
filename = "client.cmd"
|
filename = "client.cmd"
|
||||||
|
|||||||
@@ -452,6 +452,12 @@ class Mt5ApiClient:
|
|||||||
cmd_params = {"Symbol": symbol}
|
cmd_params = {"Symbol": symbol}
|
||||||
return self.__send_command(self.__get_default_expert(), Mt5CommandType.MarketBookGet, cmd_params)
|
return self.__send_command(self.__get_default_expert(), Mt5CommandType.MarketBookGet, cmd_params)
|
||||||
|
|
||||||
|
def chart_id(self, expert_handle = 0):
|
||||||
|
if expert_handle == 0:
|
||||||
|
return self.__send_command(self.__get_default_expert(), Mt5CommandType.ChartId)
|
||||||
|
else:
|
||||||
|
return self.__send_command(expert_handle, Mt5CommandType.ChartId)
|
||||||
|
|
||||||
# Private methods
|
# Private methods
|
||||||
|
|
||||||
def __event_thread_func(self):
|
def __event_thread_func(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user