MetaTrader 5 Python用户组 - 如何在Metatrader中使用Python - 页 61 1...545556575859606162636465666768...88 新评论 nicholish en 2020.04.09 12:31 #601 Vladimir Perervenko : 安装失败 Win10,Py3.6.10和WinPy3.7.7。 再试一次吧。我不得不对其进行重构,以便在Python < 3.8下工作。 Vladimir Perervenko 2020.04.10 10:27 #602 nicholi shen: 再试一次吧。我不得不对其进行重构,以便在Python < 3.8下工作。 好的 Successfully built pymt5adapter Installing collected packages: pymt5adapter Successfully installed pymt5adapter-0.2.1 ----- Установка "pymt5adapter" выполнена. - 该版本有什么新内容? 祝好运 nicholish en 2020.04.10 10:45 #603 Vladimir Perervenko: 好的 该版本有什么新内容? 祝好运 calendar_eventshttps://github.com/nicholishen/pymt5adapter/blob/master/pymt5adapter/calendar.py from datetime import datetime from datetime import timedelta import pymt5adapter as mt5 from pymt5adapter.calendar import calendar_events from pymt5adapter.calendar import Currency from pymt5adapter.calendar import Importance def forex_symbol(s): modes = [mt5.SYMBOL_CALC_MODE_FOREX, mt5.SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE] return s.trade_calc_mode in modes def main(): symbol = mt5.symbols_get(function=forex_symbol)[0] one_week = timedelta(weeks=1) now = datetime.now() default_one_week_ahead_all_events = calendar_events() filtered_by_callback = calendar_events(function=lambda e: 'fed' in e['event_name'].lower()) filtered_by_flags = calendar_events(importance=Importance.MEDIUM | Importance.HIGH, currencies=Currency.USD | Currency.JPY) filtered_by_strings = calendar_events(importance='medium high', currencies='usdjpy') filtered_by_iterables = calendar_events(importance=('medium', ' high'), currencies=('usd', 'jpy')) filtered_by_specific_times = calendar_events(time_from=now, time_to=now + one_week) filtered_by_timedeltas = calendar_events(time_from=(-one_week), time_to=one_week) filtered_by_timedelta_lookback = calendar_events(-one_week) calendar_events_in_russian = calendar_events(language='ru') employment_events_next_month = calendar_events( currencies=Currency.USD, importance=Importance.HIGH function=lambda e: 'employment' in (name:=e['event_name'].lower()) or 'payroll' in name ) next_event = employment_events_next_month[0] for k, v in next_event.items(): print(k, v) if __name__ == '__main__': with mt5.connected(): main() nicholishen/pymt5adapter nicholishengithub.com A drop-in pythonic adapter for the MetaTrader5 package to enhance usability. - nicholishen/pymt5adapter 9805244 2020.04.10 13:15 #604 下午好!我如何使用TRADE_ACTION_CLOSE_BY ????或谁以及如何关闭所有未结头寸? Vladimir Perervenko 2020.04.10 15:21 #605 9805244: 下午好!如何使用TRADE_ACTION_CLOSE_BY?或谁和如何关闭所有未结头寸? 使用Python? Vladimir Perervenko 2020.04.10 15:53 #606 nicholi shen: calendar_eventshttps://github.com/nicholishen/pymt5adapter/blob/master/pymt5adapter/calendar.py 这一行是VS2019(WinPy3.7.7)所规定的(下划线)。 "意外的标记'函数'" 意外的标记":" 意外的令牌'='。无效的语法 employment_events_next_month = calendar_events( currencies=Currency.USD, importance=Importance.HIGH function=lambda e: 'employment' in (name :=e['event_name'].lower()) or 'payroll' in name ) nicholish en 2020.04.10 16:04 #607 Vladimir Perervenko: 这一行是VS2019(WinPy3.7.7)所规定的(下划线)。 "意外的标记'函数'" 意外的标记":" 意外的令牌'='。无效的语法 这就是python >=3.8的新赋值表达式,它们非常棒。我不得不从库中删除所有这些东西,以使它与你的版本一起工作,但我认为你可以重构那个示例脚本,使它发挥作用。你应该考虑将你的Python解释器升级到最新版本。 :) https://www.python.org/dev/peps/pep-0572/ PEP 572 -- Assignment Expressions www.python.org PEP: Title: Author: Status: Type: Created: Python-Version: Post-History: Resolution: Vladimir Perervenko 2020.04.10 17:42 #608 nicholi shen: 这就是python >=3.8的新赋值表达式,它们非常棒。我不得不从库中删除所有这些东西,以使它与你的版本一起工作,但我认为你可以重构那个示例脚本,使它发挥作用。你应该考虑将你的Python解释器升级到最新版本。 :) https://www.python.org/dev/peps/pep-0572/ 不能。太多的软件包被捆绑在3.7.7和3.6.10中。 如果可能的话,就建议用什么或怎样的方式来替换它。如果没有,也没问题。 我不是Python的专家。我的语言是R/。 好运。 nicholish en 2020.04.10 21:53 #609 Vladimir Perervenko: 我不能。 太多的软件包被捆绑在3.7.7和3.6.10上。 如果可能的话,请告诉我什么或如何替换。 如果没有,也没问题。 我不是Python专家。 我的语言是R / 好运。 def employment_event(e): event_name = e['event_name'].lower() return 'payroll' in event_name or 'employment' in event_name employment_events_next_month = calendar_events( currencies=Currency.USD, importance=Importance.HIGH, function=employment_event ) 9805244 2020.04.11 07:18 #610 Vladimir Perervenko: 使用Python? 是 1...545556575859606162636465666768...88 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
安装失败
Win10,Py3.6.10和WinPy3.7.7。
再试一次吧。我不得不对其进行重构,以便在Python < 3.8下工作。
再试一次吧。我不得不对其进行重构,以便在Python < 3.8下工作。
好的
该版本有什么新内容?
祝好运
好的
该版本有什么新内容?
祝好运
calendar_eventshttps://github.com/nicholishen/pymt5adapter/blob/master/pymt5adapter/calendar.py
下午好!我如何使用TRADE_ACTION_CLOSE_BY ????或谁以及如何关闭所有未结头寸?
下午好!如何使用TRADE_ACTION_CLOSE_BY?或谁和如何关闭所有未结头寸?
使用Python?
calendar_eventshttps://github.com/nicholishen/pymt5adapter/blob/master/pymt5adapter/calendar.py
这一行是VS2019(WinPy3.7.7)所规定的(下划线)。
"意外的标记'函数'"
意外的标记":"
意外的令牌'='。
无效的语法
employment_events_next_month = calendar_events( currencies=Currency.USD, importance=Importance.HIGH function=lambda e: 'employment' in (name :=e['event_name'].lower()) or 'payroll' in name )
这一行是VS2019(WinPy3.7.7)所规定的(下划线)。
"意外的标记'函数'"
意外的标记":"
意外的令牌'='。
无效的语法
这就是python >=3.8的新赋值表达式,它们非常棒。我不得不从库中删除所有这些东西,以使它与你的版本一起工作,但我认为你可以重构那个示例脚本,使它发挥作用。你应该考虑将你的Python解释器升级到最新版本。 :)
https://www.python.org/dev/peps/pep-0572/
这就是python >=3.8的新赋值表达式,它们非常棒。我不得不从库中删除所有这些东西,以使它与你的版本一起工作,但我认为你可以重构那个示例脚本,使它发挥作用。你应该考虑将你的Python解释器升级到最新版本。 :)
https://www.python.org/dev/peps/pep-0572/
不能。太多的软件包被捆绑在3.7.7和3.6.10中。
如果可能的话,就建议用什么或怎样的方式来替换它。如果没有,也没问题。
我不是Python的专家。我的语言是R/。
好运。
我不能。 太多的软件包被捆绑在3.7.7和3.6.10上。
如果可能的话,请告诉我什么或如何替换。 如果没有,也没问题。
我不是Python专家。 我的语言是R /
好运。
使用Python?