Skip to content

Repository files navigation

EAMT

PyPIPyPI - Downloads
Python Version
OS Support
GitHub
GitHub followersGitHub User's stars

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

fromEAMetatraderimportMT4ClientfromEAMetatrader.Enumsimport*fromEAMetatrader.UsingimportColorimportdatetime

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=60Period=14Appliedprice=0#CloseShift=0RSI=client.iRSI(Symbol,Timeframe,Period,Appliedprice,Shift)

Send Order

Lot=0.01Ask=client.MarketInfo("EURUSD",MarketInfoModeType.MODE_ASK)
SL=Ask-0.002TP=Ask+0.004Slippage=5Comment="EAMetatrader"Magic=2222Expiration=datetime.datetime(2021,3,25)
color=Color()
Order=client.OrderSend("EURUSD",TradeOperation.OP_BUY,Lot,Ask,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

Bitcoin: 13fWKBESm6pqtCQzp3WgBarcmxFNv5aCXf

Releases

Packages

Used by

Contributors

Languages