Skip to main content

Metatrader library for python

Project description

EAMetatrader

Python Version
OS Support
GitHub

Metatrader library for python powered by MtApi

This library currently only supports MetaTrader 4

Installation

  • Install the library with the pip install EAMetatrader command
  • Copy and run the MtApi.ex4 file in MetaTrader software
  • Set up a port in Expert and Application for network connection
  • and over

Required libraries

from EAMetatrader import MT4Client,Color
from EAMetatrader.Enums import *
import datetime

Connection

client = MT4Client(True)
client.Connect(8222)

Copy Rates

start = datetime.datetime(2021,3,16)
end = datetime.datetime(2021,3,1)

mqlrate = client.CopyRates("EURUSD",ENUM_TIMEFRAMES.PERIOD_H1,start,end)
print(mqlrate.Time(2))

Indicators

Symbol = "EURUSD"
Timeframe = 60
Period = 14
Appliedprice = 0  #Close
Shift = 0

RSI = client.iRSI(Symbol,Timeframe,Period,Appliedprice,Shift)

Send Order

Lot = 0.01
Price = 1.18
SL = 1.17800
TP = 1.18400
Slippage = 5
Comment = "EAMT"
Magic = 2222
Expiration = datetime.datetime(2021,3,25)
color = Color()

Order = client.OrderSend("EURUSD",TradeOperation.OP_BUY,Lot,Price,Slippage,SL,TP,Comment,Magic,Expiration,color.Green())

TODO

  • Debug some functions
  • Write MT5Client class
  • Development of functions for working with artificial intelligence

Issues

If you have a question or want to report a bug, send it in this section

My social medias

LinkedIn

Instagram

YouTube

Github

Donating

PyPal

Bitcoin: 1LsuAxGGdfH43YpgSjY8CSZdX45r4BE4jx

QRCode

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EAMetatrader-1.0.4.tar.gz (867.9 kB view details)

Uploaded Source

File details

Details for the file EAMetatrader-1.0.4.tar.gz.

File metadata

  • Download URL: EAMetatrader-1.0.4.tar.gz
  • Upload date:
  • Size: 867.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.5.0.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for EAMetatrader-1.0.4.tar.gz
Algorithm Hash digest
SHA256 4b48f48990d88cc38264c526df060c840cd5c596cfbce2274afa301aec1617f3
MD5 429103d198b49e2fc77b066026c33d7f
BLAKE2b-256 79bb8395262543ad868881113587c020d0c70ba0661805bd250c83465b0f5ced

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page