1

Need solutions to Forex order_send in Python. using Metatrader5 its so easy:

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. My attempts to install MetaTrader 5 were completely unsuccessful (even after trying the Windows emulator).

enter image description here

Is there a way to Send my forex orders without using Metatrader5?

Thank you all

M.a.RS
  • 137
  • 2
  • 12
  • How did you install `Metatrader5` package for linux? – Yuri Ginsburg Dec 17 '21 at 22:26
  • I said it in question, it's unsuccessful. I need a way to send orders without Metatrader – M.a.RS Dec 17 '21 at 22:58
  • Sorry I meant python package. – Yuri Ginsburg Dec 17 '21 at 23:19
  • Thank you for your attention .You made me doubt by asking. Did I make a mistake and is there a way to install it? After searching, I came to the conclusion that NO! (there is a suggestion to use wine, which I can not trust for online trading and scalp. Although the wine itself is not installed) – M.a.RS Dec 17 '21 at 23:43

3 Answers3

3

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

SDKs: https://metaapi.cloud/sdks (javascript, python and Java SDKs are provided as per Dec 2021)

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.

roman
  • 892
  • 9
  • 26
  • is it free to use? For all the required items, such as receiving data and sending and closing orders, etc. – M.a.RS Dec 22 '21 at 14:22
  • It have free access, but free version has some limitations. The MT terminal is stopped each two hours on a free version. – roman Dec 22 '21 at 17:23
1

Metatrader5 Python package is only for Windows and cannot be installed on Linux. See https://www.mql5.com/en/forum/354796

So the only way to run MT on Linux is a Windows emulator. I run MT4 and MT5 in Ubuntu and macOS using Wine.

Probably the good way is to ask about your problems with installing MT5 using Wine at https://superuser.com/.

Installing Python under Windows emulator is a separate problem.

Yuri Ginsburg
  • 2,302
  • 2
  • 13
  • 16
0

you can use mt5linux package, it's a package that work in the same manner on linux.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 14 '22 at 11:57