简体   繁体   English

外汇发送订单使用 Python 没有 Metatrader5

[英]Forex send orders using Python without Metatrader5

Need solutions to Forex order_send in Python. using Metatrader5 its so easy:需要 Python 中外汇 order_send 的解决方案。使用 Metatrader5 非常简单:

import MetaTrader5 as mt5

            request = {
                "action": mt5.TRADE_ACTION_DEAL,
                "symbol": symbol,
                "volume": lot,
                "type": trade_type,
                "price": price,
                "tp": tp,
                "sl": sl,
            }

            result = mt5.order_send(request)

But for some reason I only have one Linux server now.但出于某种原因,我现在只有一台 Linux 服务器。 My attempts to install MetaTrader 5 were completely unsuccessful (even after trying the Windows emulator).我安装 MetaTrader 5 的尝试完全失败(即使在尝试 Windows 模拟器之后)。

在此处输入图像描述

Is there a way to Send my forex orders without using Metatrader5?有没有办法在不使用 Metatrader5 的情况下发送我的外汇订单?

Thank you all谢谢你们

Metatrader5 Python package is only for Windows and cannot be installed on Linux. Metatrader5 Python package 仅适用于 Windows,不能安装在 ZEDC9F0A5A37D57797BF3618E 上。 See https://www.mql5.com/en/forum/354796https://www.mql5.com/en/forum/354796

So the only way to run MT on Linux is a Windows emulator.所以在 Linux 上运行 MT 的唯一方法是 Windows 模拟器。 I run MT4 and MT5 in Ubuntu and macOS using Wine.我使用 Wine 在 Ubuntu 和 macOS 中运行 MT4 和 MT5。

Probably the good way is to ask about your problems with installing MT5 using Wine at https://superuser.com/ .可能的好方法是在https://superuser.com/询问您使用 Wine 安装 MT5 的问题。

Installing Python under Windows emulator is a separate problem.在 Windows 模拟器下安装 Python 是一个单独的问题。

You can try MetaApi https://metaapi.cloud cloud service which provides REST API and WebSocket API access to both MetaTrader 4 and MetaTrader 5 accounts. You can try MetaApi https://metaapi.cloud cloud service which provides REST API and WebSocket API access to both MetaTrader 4 and MetaTrader 5 accounts.

Official REST API documentation: https://metaapi.cloud/docs/client官方 REST API 文档: https://metaapi.cloud/docs/client

SDKs: https://metaapi.cloud/sdks (javascript, python and Java SDKs are provided as per Dec 2021) SDK: https://metaapi.cloud/sdks (javascript、python 和 Java SDK 于 2021 年 12 月提供)

It supports reading account information, positions, orders, trade history, receiving quotes, and accessing market data.它支持读取账户信息、仓位、订单、交易历史、接收报价和访问市场数据。

The service also provides copy trading API https://metaapi.cloud/docs/copyfactory and API to calculate forex trading metrics on a MetaTrader account https://metaapi.cloud/docs/metastats . The service also provides copy trading API https://metaapi.cloud/docs/copyfactory and API to calculate forex trading metrics on a MetaTrader account https://metaapi.cloud/docs/metastats .

You can try MetaApi https://metaapi.cloud cloud service which provides REST API and WebSocket API access to both MetaTrader 4 and MetaTrader 5 accounts. You can try MetaApi https://metaapi.cloud cloud service which provides REST API and WebSocket API access to both MetaTrader 4 and MetaTrader 5 accounts.

Official REST API documentation: https://metaapi.cloud/docs/client官方 REST API 文档: https://metaapi.cloud/docs/client

SDKs: https://metaapi.cloud/sdks (javascript, python and Java SDKs are provided as per Dec 2021) SDK: https://metaapi.cloud/sdks (javascript、python 和 Java SDK 于 2021 年 12 月提供)

The service supports reading account information, positions, orders, trade history, receiving quotes, and accessing market data.该服务支持读取账户信息、仓位、订单、交易历史、接收报价和访问市场数据。

In order to place a trade from Python code you can use trade REST API or trade API from Python SDK . In order to place a trade from Python code you can use trade REST API or trade API from Python SDK .

you can use mt5linux package, it's a package that work in the same manner on linux.你可以使用 mt5linux package,它是一个 package,在 linux 上以相同的方式工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM