This library currently only supports MetaTrader 4
- 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
from EAMetatrader import MT4Client
from EAMetatrader.Enums import *
from EAMetatrader.Using import Color
import datetime
client = MT4Client(True)
client.Connect(8222)
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))
Symbol = "EURUSD"
Timeframe = 60
Period = 14
Appliedprice = 0 #Close
Shift = 0
RSI = client.iRSI(Symbol,Timeframe,Period,Appliedprice,Shift)
Lot = 0.01
Ask = client.MarketInfo("EURUSD",MarketInfoModeType.MODE_ASK)
SL = Ask - 0.002
TP = Ask + 0.004
Slippage = 5
Comment = "EAMetatrader"
Magic = 2222
Expiration = datetime.datetime(2021,3,25)
color = Color()
Order = client.OrderSend("EURUSD",TradeOperation.OP_BUY,Lot,Ask,Slippage,SL,TP,Comment,Magic,Expiration,color.Green())
- Debug some functions
- Write MT5Client class
- Development of functions for working with artificial intelligence
If you have a question or want to report a bug, send it in this section
Bitcoin: 13fWKBESm6pqtCQzp3WgBarcmxFNv5aCXf