Metatrader Command Line app? Or Metatrader public API?

 

Hello,

I'm building a solution that doesn't have any room for user interface application like MetaTrader Terminal (GUI). Customers should be able to remotely onboard on my platform, link their brokerage account and have the trading automation set up for then. I'm trying to find, but with no success, the following:


1. Is there a 100% command line application for MetaTrader?

metatrader -port 10000 -server SaxoBank-Live -login abc -password qwerty

If successful application is running in the background. It consumes very little resources (compared to the GUI app rendering charts, menus etc). I can send some messages to port 10000 to query data on demand or ask to open/cancel orders etc. I can also listen to be notified about price changes, changes to orders/positions etc.

If unsuccessful - exists with some code which indicates invalid login, invalid password or some Unknown error.

If I need to run another instance on the same machine - no problem at all, just use different port:

metatrader -port 10001 -server SaxoBank-Live -login def -password asdfgh
metatrader -port 10002 -server Binance-Live -login ghi -password qweasdzxc


2. Can I skip any MetaTrader app (GUI/CLI) and communicate with MetaTrader servers directly?

REST/Websockets API. First user authenticates - either I provide server+login+password or perhaps OAuth2 and the tokens are provided. Once authenticated I expect the Metatrader to keep the session alive and send requests e.g.

Receive open orders:
GET https://api.mt.com/orders

Receive positions:
GET https://api.mt.com/orders

Create order:
POST https://api.mt.com/orders {"symbol": "EURUSD", "price": 1.2, amount: 1000...}

set up subscriptions and receive updates by websockets etc