MetaTrader 5 Python用户组 - 如何在Metatrader中使用Python - 页 62 1...555657585960616263646566676869...88 新评论 Vladimir Perervenko 2020.04.11 08:56 #611 nicholi shen: 谢谢你的提示。我已经阅读了你链接上的材料。这有点复杂。 nicholish en 2020.04.11 09:15 #612 9805244: 下午好!我如何使用TRADE_ACTION_CLOSE_BY ????或谁以及如何关闭所有未结头寸? https://www.mql5.com/en/forum/306742/page10#comment_15577952 MetaTrader 5 Python User Group - the summary 2020.03.11www.mql5.com The Main Study MetaTrader Python online documentation Python Releases for Windows - website MetaTrader5 : Python Package - website... Vladimir Perervenko 2020.04.11 09:51 #613 nicholi shen: https://www.mql5.com/en/forum/306742/page10#comment_15577952 谢谢你的例子。 我在MKL中有一个类似的脚本,先关闭所有盈利的头寸。 我们可以在你的脚本中也这样做吗? 祝好运 PS:你已经这么做了。锯。 而这个脚本是用于净值化账户的? nicholish en 2020.04.11 16:12 #614 Vladimir Perervenko:谢谢你的例子。 在我的MKL中,一个类似的脚本首先关闭了所有盈利的头寸。 你能在你的脚本中也这样做吗?祝好运PS:你已经这么做了。曾见过。 而这个用于净空账户的脚本? 我通常会根据风险(头寸大小)来优先平仓,但如果你想根据整体利润来平仓,那么你只需修改你的符号 排序方式。 def open_position_symbols(): positions = {} for p in mt5.positions_get(): positions.setdefault(p.symbol, []).append(p.profit) symbols = sorted( positions, key=lambda s: sum(positions[s]), reverse=True ) return symbols Vladimir Perervenko 2020.04.11 17:35 #615 nicholi shen: 我通常根据风险(头寸大小)来优先平仓,但如果你想根据整体利润来平仓,那么你只需修改你的符号排序方式。 谢谢你 Dmitri Custurov 2020.04.28 13:22 #616 Python脚本能否用于终端的回测? nicholish en 2020.04.28 14:52 #617 Dmitri Custurov : Python脚本可以用来在终端进行回测吗? BackTrader:https://github.com/backtrader/backtrader PyAlgoTradehttps://github.com/gbeced/pyalgotrade Ziplinehttps://github.com/quantopian/zipline Ultra-Financehttps://code.google.com/p/ultra-finance/ ProfitPyhttps://code.google.com/p/profitpy/ pybacktesthttps://github.com/ematvey/pybacktest 预言家 https://github.com/Emsu/prophet 量 https://github.com/maihde/quant AlephNullhttps://github.com/CarterBain/AlephNull 用Python进行交易http://www.tradingwithpython.com/ 可视化财富 https://github.com/benjaminmgross/visualize-wealth 用于整合和分析的TIA工具包https://github.com/bpsmith/tia QuantSoftware Toolkithttp://wiki.quantsoftware.org/index.php?title=QuantSoftware_ToolKit 粉红鱼 http://fja05680.github.io/pinkfish/ bthttp://pmorissette.github.io/bt/index.html PyThalesianshttps://github.com/thalesians/pythalesians QSTraderhttps://github.com/mhallsmoore/qstrader/ QSForexhttps://github.com/mhallsmoore/qsforex pysystemtradehttps://github.com/robcarver17/pysystemtrade QTPyLibhttps://github.com/ranaroussi/qtpylib RQalphahttps://github.com/ricequant/rqalpha MetaQuotes 2020.04.28 14:55 #618 Dmitri Custurov: Python脚本能否用于终端的回测? 不,它们只在单独的线程中作为图表上的脚本工作。 nicholish en 2020.04.28 15:08 #619 MetaQuotes: 不,它们只在单独的线程中作为图表上的脚本工作。 你能不能增加一个功能,使终端在调用Python脚本时,将图表符号和时间段作为命令行参数传给图表上的人?例如,你在欧元兑美元的M15 图表上投放python脚本,唤起该脚本的命令是 python mt5_script.py EURUSD 15 这样,我们就可以从python脚本中知道符号和时间框架 import sys if len(sys.argv) == 3: chart_symbol, chart_tf = sys.argv[1:3] MetaQuotes 2020.04.28 17:54 #620 nicholi shen: 你能不能增加一个功能,使终端在调用Python脚本时,将图表符号和时间段作为命令行参数传给图表上的人?例如,你在欧元兑美元的M15图表上投放python脚本,唤起该脚本的命令是 这样,我们就可以从python脚本中知道符号和时间框架 今晚将提供下一个测试版本。 import sys chart_symbol='unknown' chart_tf=1 if len(sys.argv) == 3: chart_symbol, chart_tf = sys.argv[1:3]; print("Hello world from", chart_symbol, chart_tf) >> Hello world from T.NYSE 15 1...555657585960616263646566676869...88 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
谢谢你的提示。我已经阅读了你链接上的材料。这有点复杂。
下午好!我如何使用TRADE_ACTION_CLOSE_BY ????或谁以及如何关闭所有未结头寸?
https://www.mql5.com/en/forum/306742/page10#comment_15577952
https://www.mql5.com/en/forum/306742/page10#comment_15577952
谢谢你的例子。
我在MKL中有一个类似的脚本,先关闭所有盈利的头寸。
我们可以在你的脚本中也这样做吗?
祝好运
PS:你已经这么做了。锯。
而这个脚本是用于净值化账户的?谢谢你的例子。
在我的MKL中,一个类似的脚本首先关闭了所有盈利的头寸。
你能在你的脚本中也这样做吗?
祝好运
PS:你已经这么做了。曾见过。
而这个用于净空账户的脚本?我通常会根据风险(头寸大小)来优先平仓,但如果你想根据整体利润来平仓,那么你只需修改你的符号 排序方式。
我通常根据风险(头寸大小)来优先平仓,但如果你想根据整体利润来平仓,那么你只需修改你的符号排序方式。
谢谢你
BackTrader:https://github.com/backtrader/backtrader
PyAlgoTradehttps://github.com/gbeced/pyalgotrade
Ziplinehttps://github.com/quantopian/zipline
Ultra-Financehttps://code.google.com/p/ultra-finance/
ProfitPyhttps://code.google.com/p/profitpy/
pybacktesthttps://github.com/ematvey/pybacktest
预言家 https://github.com/Emsu/prophet
量 https://github.com/maihde/quant
AlephNullhttps://github.com/CarterBain/AlephNull
用Python进行交易http://www.tradingwithpython.com/
可视化财富 https://github.com/benjaminmgross/visualize-wealth
用于整合和分析的TIA工具包https://github.com/bpsmith/tia
QuantSoftware Toolkithttp://wiki.quantsoftware.org/index.php?title=QuantSoftware_ToolKit
粉红鱼 http://fja05680.github.io/pinkfish/
bthttp://pmorissette.github.io/bt/index.html
PyThalesianshttps://github.com/thalesians/pythalesians
QSTraderhttps://github.com/mhallsmoore/qstrader/
QSForexhttps://github.com/mhallsmoore/qsforex
pysystemtradehttps://github.com/robcarver17/pysystemtrade
QTPyLibhttps://github.com/ranaroussi/qtpylib
RQalphahttps://github.com/ricequant/rqalpha
Python脚本能否用于终端的回测?
不,它们只在单独的线程中作为图表上的脚本工作。
你能不能增加一个功能,使终端在调用Python脚本时,将图表符号和时间段作为命令行参数传给图表上的人?例如,你在欧元兑美元的M15 图表上投放python脚本,唤起该脚本的命令是
python mt5_script.py EURUSD 15
这样,我们就可以从python脚本中知道符号和时间框架
你能不能增加一个功能,使终端在调用Python脚本时,将图表符号和时间段作为命令行参数传给图表上的人?例如,你在欧元兑美元的M15图表上投放python脚本,唤起该脚本的命令是
这样,我们就可以从python脚本中知道符号和时间框架
今晚将提供下一个测试版本。
import sys chart_symbol='unknown' chart_tf=1 if len(sys.argv) == 3: chart_symbol, chart_tf = sys.argv[1:3]; print("Hello world from", chart_symbol, chart_tf) >> Hello world from T.NYSE 15