分享

Free download of the 'mt4R for new MQL4' library by 'micclly' for MetaTrader 4 in the MQL5 Code Base

 昵称14567126 2016-05-13
           2014.02.06 14:31
EN
mt4R for new MQL4

mt4R for new MQL4 - library for MetaTrader 4

| English

Views:
10332
Rating:
votes: 17
You've rated:

Description:

mt4R, originally developed by Bernd Kreuss and distributed here, does not work correctly with new MQL4.

I modiifed the dll and the include file to support new MQL4.

Trouble or Bug Report:

If you are in trouble with this, please report it to GitHub Issue.

Because MQL4.com notification is broken, I cannot notice someone reported here.

Latest version:

You can get the latest version from GitHub releases. (Due to update time lag by moderation, the attached binary may be older than the latest release at GitHub)

Changelog is also at CHANGES.md and GitHub commits.

Update history:

Feburary 10, 2014: v1.4.0-b7: Added sample experts: Arb-O-Mat and Trend-O-Mat(GitHub#5).

Feburary 9, 2014: v1.4.0-b6: Fixed the bug of RGetBool/RGetInteger(Github#4).

Feburary 9, 2014: v1.4.0-b5: Fixed the bug of RAssignString(Github#3).

Feburary 9, 2014: v1.4.0-b4: Fixed the bug of RAssignStringVector(GitHub#1), and updated the minor version number in DLL hardcoded.

Feburary 7, 2014: v1.4.0-b1: Changed MQL file encoding to UTF-16

Feburary 6, 2014: v1.4.0-b0: Initial snpashot

Source:

Source codes are distributed at a branch of my GitHub repository.

Note:

  • Testing is not enough
  • I had only confirmed that it seems work good with R-3.0.2 on Windows 2012 R2.
  • Performance may be slightly worse, because wide string in arguments is always converted to ansi string.
Last comments | Go to discussion (40)
emeric de Monteville
emeric de Monteville | 18 Apr 2015 at 11:07 CN
Hello,

I am currently testing this system? Does it burn your account in long term or does it work?

I would like to know if someone has the same problem as me

The R graphics popup and close 1 sec later, how can i fix this problem?

Thanks for helping

Have a good day
statisfied
statisfied | 20 Jun 2015 at 13:09 CN

Hey all,  I am just starting, total noob with mql4, a bit more familiar with R. I have a few questions:


1. After downloading the right files for the new mt4 new version (here: https://github.com/micclly/mt4R), I can now compile mt4R.mqh, mt4Test.mq4 and the two indicators without problem. But when I try to attach the script mt4rTest.mq4 to a chart, this is what DebugView messages. (Maybe because we are saturday?) I am worried about the line
Quote
[2204] Invalid parameter passed to C runtime function.
. Can you please check if this output is normal?
Quote
[1576] installed exception handler for C:\Users\ASUS UX32L\AppData\Roaming\MetaQuotes\Te rminal\50CA3DFB510CC5A8F28B48D1BF2A 5702\MQL4\Libraries\mt4R.dll
[1576] <2> Create: trying to start R: C:/Program Files/R/R-3.2.1/bin/x64/Rterm.exe --no-save
[2204] Invalid parameter passed to C runtime function.
[1576] <2> ExecuteCode: in >>> options(digits=15)
[1576] <2> ExecuteCode: out <<<
[1576] <2> Create: R successfully started
[1576] RInit: RHandle = 6EDF95C (116259164)
[1576] <2> ExecuteCode: in >>> foo <- c(0, 1.25, 2.5, 3.75, 5)
[1576] <2> ExecuteCode: out <<<
[1576] <2> ExecuteCode: in >>> baz <- foo * 42
[1576] <2> ExecuteCode: out <<<
[1576] <2> ExecuteCode: in >>> as.vector(baz)
[1576] <2> ExecuteCode: out <<< [1] 0.0 52.5 105.0 157.5 210.0
[1576] RDeinit: RHandle = 6EDF95C (116259164)
[1576] <2> Stop: Stopping R
[1576] <2> Stop: sending quit()
[1576] <-1> TPlotEventLoop: terminating
[1576] <-1> TRConsole: destroying
[1576] removed exception handler for C:\Users\ASUS UX32L\AppData\Roaming\MetaQuotes\Te rminal\50CA3DFB510CC5A8F28B48D1BF2A 5702\MQL4\Libraries\mt4R.dll
[5356] SHIMVIEW: ShimInfo(Complete)

2. It would be a huge help if you could provide me with the simplest possible mt4R program that can show me how exactly mt4R and R communicate. For example:
  1. Every 3 seconds let's say:
  2. Send OHLC data to R (closing prices, for example, reversed(?))
  3. Use R to do a simple operation with the timeseries, say, multiply the last record by 2
  4. Plot this data in a R window for a second
  5. get these data back from R into mt4R
  6. Alert the last record (multiplied by 2)

3. In your opinion, what is the best documentation out there for me?

My aim is to design the simplest EA that could communicate with R, so that I would make all my changes in R, not in the EA, as was told earlier in this thread too). I realize that I ask a lot so the first answer gets 1000+ awesomeness points !!!!!!!

(this post is also posted on http://www./showthread.php?t=260422&page=9, will post the answers of this forum here if I get any). MANY thanks in advance.

statisfied
statisfied | 24 Jun 2015 at 14:28 CN

Hi again,

I am now running arbomat and trendomat without problem. Would still be useful to have a working example of software sending information to and receiving from R.


Thanks !

wilsonts
wilsonts | 5 Nov 2015 at 12:07 CN

I have just installed MT4R-1.4.0 snapshot b7 with MT4 Build 902 (23 Oct 2015) running under MS Windows XP SP3   R version  3.2.2

The installation was straight forward and only took about 10 minutes including a quick read of the documentation.

I tested the installation using the mt4RTest.mq4 script stepping through it with the debugger. It worked fine "out of the box".

I was very pleased to find that this very useful piece of software had been updated from the original  MT4R -1.3... version which is now obsolete since MT4 build 600.  Looking at the 2010 vintage of  MT4R 1.3 my first thought was  "damn" - I am going to be up for many hours of work converting this. Then I found micclly's contribution.

Thank you micclly  very much for your efforts.

Regards

Tim Wilson

FXDub
FXDub | 27 Apr 2016 at 08:08 CN

Hi there! Different instances of my EA are attributing the same integer as a handle for R, which trigger a mess when further executing commands with that handle, as they are calling for the same R session instead of calling for independent sessions... 

How the handle attributed? is that some kind of random generated number depending on the internal clock, in which case simultaneous calls of Rinit  increase the chance to get the same handle? 

Is there a way to avoid that? I was thinking of setting the handle as global variables that could be checked and de-initialize/ re-initialize R until I get different Handle but this solution is rather cumbersome. Any idea?

Thanks  

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

iCrosshair iCrosshair

Handy crosshair for MetaTrader 4.

QEMA percentage QEMA percentage

QEMA is the Quadruple Exponential Moving Average. With this small change you can modify the percentage of the quadruple correction respect to the normal EMA.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多