Skip to content

EAScript/EAMT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

from EAMetatrader import MT4Client
from EAMetatrader.Enums import *
from EAMetatrader.Using import Color
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
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())

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