在 MetaTrader 4 中创建新账户时,我可以通过编程方式控制帐号吗?
我有一个适用于 MetaTrader 4 的 C++ 插件,它允许我在其中创建新帐户以用于交易目的。我希望能够在创建新帐户时向 MT4 指示帐号。有人知道这是否可能以及如何完成吗?
I have a C++ plug-in for MetaTrader 4 that allows me to create new accounts in it for trading purposes. I would like to be able to dictate to MT4 the account number when creating the new account. Might any one know whether this is possible and how it might be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
帐号是由经纪商在创建账户时生成的 - 所以简单的答案是否定的;你无法控制它。唯一的方法是生成一个帐号,并根据它预测下一个帐号是什么。仅当帐号算法是特定于经纪商的时,这才可能实现。但这会让我感到惊讶。我敢打赌,帐号是由具有单向功能的 MetaQuotes 服务器生成的。
The account number is generated by the broker upon account creation - So the simple answer is No; you cannot control it. The only way would be to generate an account number, and based on it anticipate what the next account number will be. This is only possible if the account number algorithm is broker-specific. This would surprise me though. I am willing to bet that account numbers are generated by MetaQuotes server with a one-way-function.
您可以在调用 UserRecordNew 方法时使用的 UserRecord 结构的登录字段中指定帐号。如果帐户已经退出,您将从该方法中收到与 RET_Ok 相对应的错误。
You can specify the account number in the login field of the UserRecord struct your are using in the call to UserRecordNew method. If the account already exits you will get an error from the method as apposed to RET_Ok.
如果您使用任何API,您可以手动输入帐号。如果指定的账号存在,系统将拒绝您的请求。您想在开户时输入自定义号码有什么特殊原因吗?
If you use any API, you can manually enter the account number. If the specified account number exists, the system will reject your request. Is there any particular reason you want to enter custom numbers while opening the account?
无法控制帐号。这样做的理由是,帐号是由经纪商在开设账户时开发的。实现这一点的唯一方法是生成一个帐号并使用该号码来预测下一步会发生什么。帐号将是。然而,如果帐号算法是特定于经纪商的,则这种方法是可能的。
It is not possible to control the account number. The justification of this is the fact that the account number is developed by the broker upon the opening of an account.The only way that this would be possible would be if one was to generate an account number and use this number to anticipate what the next account number will be. This approach is however, possible if the account number algorithm is broker-specific.