MT4 API

Mar 31, 2014 at 14:27
2,530 개의 뷰
3 Replies
Oct 28, 2009 부터 멤버   게시물1409
Mar 31, 2014 at 14:27
Hi Folks,
I'm looking to start using an MT4 API. Does anyone have experiences, good or bad with any of the API solutions out there? Ideally I'd like it to work with pre and post version 600.
Best regards Steve
11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
Mar 28, 2011 부터 멤버   게시물84
Mar 31, 2014 at 19:13
I have used http://www.mt4api.net/ (http://www.tradingapi.net/mt4-net-api) and it is quite good. Internally it uses WCF and the developer answered promptly to all of my questions. Works at least pre build 600.
I run one robot in a headless VPS server and booted it once a month to be on the safe side.
Did not use it for history testing because pre 600 MT4 is so slow.

On hindsight I might choose http://www.nj4x.com/ now. It is not targeted specifically for algo trading but I think could do that and it is cheaper. Might take more time on planning how to setup properly? Build 600 status unknown to me.

I think that the next time I will roll out my own API and replace MT4API with it.
Did a prototype for MT5 using VB and Java server side using plain sockets and it is relatively easy.
Now as MT4 has same data types as MT5 it is possible to write socket or pipe based protocol that is optimized for your specific needs without writing a C/C++ DLL.
The problem with MT4API or NJ4X is that they implement MT4 API 1:1 that is not efficient for algo trading if you need heavy optimizations for speed. If your robot trades just few times an hour or day MT4API or NJ4X can do it.
Being Bearish or Bullish Makes No Difference
Oct 28, 2009 부터 멤버   게시물1409
Apr 01, 2014 at 08:32
Thanks Petays,
I emailed MT4API.net a few days ago and haven't had a response yet - maybe he's on holiday.

If I'm understanding you correctly you are saying that the two API's on the market can only process single threaded commands rather than multi threaded? Is that what 1:1 means?

Best regards Steve
11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
Mar 28, 2011 부터 멤버   게시물84
Apr 01, 2014 at 09:13
1:1 API means that almost all MT4 MQL4 functions are implemented in MT4API product using same method names and parameters.
See http://tradingapi.net/mt4-api-doc/ MT4 Class -> MT4 Methods then you get the idea!

Threading is a different story because everything is driven by MT4 Terminal event loop, that is inside OnTick() method.
But the concept is similar as in pure MQL4 EAs that are using classical "Hollywood principle".

MT4 Terminal -> OnTick() -> MT4API -> your C# code here can call back any MT4API method only inside OnTick

If you need multi-threading then you have to internally queue your commands and dispatch them inside OnTick, nowhere else.
Being Bearish or Bullish Makes No Difference
로그인 / 가입하기 to comment
You must be connected to Myfxbook in order to leave a comment
*상업적 사용 및 스팸은 허용되지 않으며 계정이 해지될 수 있습니다.
팁: 이미지/유튜브 URL을 게시하면 게시물에 자동으로 삽입됩니다!
팁: @기호를 입력하여 이 토론에 참여하는 사용자 이름을 자동으로 완성합니다.