MQL4 -gt R-Project - Interface Library - Page 4
Page 4 of 6118 FirstFirst ... 2345614 ... LastLast
Results 31 to 40 of 175

Thread: MQL4 -gt R-Project - Interface Library

  1. #31
    Hello,

    7-bit I have 2 questions:

    1) Any plans for MQL5?

    2) Can I somehow use mt4Rdll to use under Linux? MT4 is conducted under wine and I am using Linux native R.

  2. #32
    Quote Originally Posted by ;
    Hi,

    7-bit I have Two questions:

    1) Any plans for MQL5?

    2) Could I somehow use mt4Rdll to use under Linux? MT4 is run under wine and I am using Linux native R.
    I have a concept for my queries, but anyway your library convince me to think. My queries are obsolete.

  3. #33
    Can I Maximize mt4r.dll on windows 7 x64?

  4. #34
    As soon as I attempted to complied the mt4r.mqh document I had the subsequent erroes:

    Start function not found and cannot be run.
    Function RInit is not referenced and will be removed from exp-file
    Function StartR is not referenced and will be removed from exp-file
    Function StopR is not referenced and will be removed from exp-file
    Function Rx is not referenced and will be removed from exp-file
    Function Rs is not referenced and will be removed from exp-file
    Function Ri is not referenced and will be removed from exp-file
    Function Rd is not referenced and will be removed from exp-file
    Function Rv is not referenced and will be removed from exp-file
    Function Rm is not referenced and will be removed from exp-file
    Function Rgi is not referenced and will be removed from exp-file
    Function Rgd is not referenced and will be removed from exp-file
    Function Rgv is not referenced and will be removed from exp-file
    Function Rp is not referenced and will be removed from exp-file
    0 error(s), 14 warning(s)

    anyone know what was the cause for it?
    i am running it under windows 7 32bit and R 2.13.1.
    thanks.

  5. #35
    7Bit, fantastic job on producing mt4R.dll. I have cobbled a wrapper for VB6 up for my private use. Maybe I will make it available if anyone is interested, if I get some time. I'm beginning to find the options of R but've encountered a few problems in making a full working translation of mt4R.mqh.

    The two matrix routines RAssignMatrix and RAppendMatrixRow are giving me problems. It may be that Pascal and VB6 matrix constructions are incompatible for multi-dimensional arrays, or more probable that my infantile understanding of R / Pascal and they manage arrays/matrices is your issue. Case in point: I do not even know how to test matrix / vector boundaries within R.

    I guessed a workaround with RAssignVector, and then mixing a temporary vector in an already dimensioned matrix in R one column at a point: Inserted Code Rx(multiA#91;,1#93; lt;- tempA) reproduces tempA to column 1 of multiA. Repeated in a loop, this approximates the functionality of RAssignMatrix.

    It seems that RRowBindVector(), that is mentioned in the RAssignMatrix remarks of mt4R.mqh is not found in the mt4R.dll source code. Is this just an allusion to utilizing the Inserted Code * factor lt;- rbind(variable, vector) command within R or a function which didn't yet make it to the DLL?

  6. #36
    7bitI see you've made this way to use R. I made an R program that forecasts the price later on, and comes with the proper amount to exchange. It trades 7 currency pairs at once. It runs after an hour. It makes a table with all the trades I need to do I manually input them.

    I Would like to automate it onto a broker. It looks like OANDA would work, they've a Metatrader platform, and I have used a clinic account for awhile today.

    My problem isI have zero experience with MQL4, or any other programming languages. I don't know where to get started. I can't do that all of the time, although I had been testing it out on OANDA manually. Would you be willing to help me out to get my program automated?

    Being a new memberI don't know if I can respond to personal messages, but should you need my email, I will provide it to you. Thanks.

  7. #37
    Quote Originally Posted by ;
    7Bit, great job on producing mt4R.dll. I have cobbled up a wrapper for VB6
    That is an interesting idea. The method by which in which the dll was created (a simple horizontal C-like interface) it should be simple to use it with a lot of different languages which can interface with native DLLs.

    Quote Originally Posted by ;
    The two matrix patterns RAssignMatrix and RAppendMatrixRow are giving me problems. It can be that VB6 and Pascal matrix constructions are more likely, or incompatible for arrays they manage arrays/matrices is your issue and my infantile comprehension of R / Pascal. Case in point: I don't even know how to test matrix / vector bounds within R.
    The arrangement that is used is the one which is dictated by the way the 2-dimensional mql4 array resembles, there's not anything special about Pascal types, they're just like C types on the lowest machine degree and therefore are laid out the same.

    In C it could be a double * foo and you might dereference it with foo[x], in Pascal you essentially do the same with a fooDual, the syntax is different (simpler for humans, more natural, simpler ( less ambiguous) the representation about the machine degree is precisely the same as the equal in C.

    The matrix (or 2-dimensional variety ) for example:

    1 2 3
    4 5 6
    7 8 9

    will be reflected in memory just like a horizontal 1-d range:

    1 2 3 4 5 6 7 8 9 (at this point without looking into the code now from the top of my head I'm not 100% sure it might also be transposed):
    1 4 7 2 5 8 3 6 9 (but that can easily be discovered )

    and actually in my dll I'm passing 2d arrays because 1d arrays and 2 variables defining the row and column count.

    Passing a range (no matter how many dimensions) to the dll from mql4 means passing the pointer to a memory block comprising such a horizontal row of numbers, each number as 8 byte double, no header, no separators, only the numbers. 9 elements' above mentioned example matrix could be passed as a pointer. An 1D range would seem the exact same, its row and column count that tells my code how to read it.

    I'm not sure how in VB a 2D array is coordinated, if it functions the same way it should be possible there too. If the 2D arrays are somehow structures than described above then you might attempt to create the matrix a one dimensional array and move that to RAssignMatrix along with the row and column count.

    Quote Originally Posted by ;
    I figured a workaround with RAssignVector, and then combining a temporary vector into an already dimensioned matrix in R 1 column at a time: Inserted Code Rx(multiA#91;,1Number 93; lt;- tempA) reproduces tempA to pillar 1 of multiA. This approximates RAssignMatrix's functionality.
    That is perfectly ok if it doesn't produce a performance bottleneck, RAssignMatrix() needs to be faster but this is dependent upon how big the structure is (it'd be *much* faster with very big matrices) and just how slow or fast the rest of the code is to make this a significant bottleneck.

    Quote Originally Posted by ;
    It seems that RRowBindVector(), that is mentioned in the RAssignMatrix comments of mt4R.mqh is not found in the mt4R.dll origin code.
    I have changed the API several times and removed and replaced a few functions, most likely I forgot to alter this remark and it is still referring to a older version where this function still existed.

    ___
    [edit:] double has just 8 bytes of course, I confused it with something different. An individual can certainly forget (and also safely ignore) this when using a language with strong typing and typed pointers rather than being forced to mess up with void pointers all afternoon long.

  8. #38
    Quote Originally Posted by ;
    phwoar that is a hack that is wicked. Have not used it but can see the potential.

    Query 1: can this be used to'create' a fake symbol and then flow information to it? An program can be installed as the'server' sending data internally?

    Or, you might flow fake data to an unused exotic symbol you would not actually need to trade but may load to mt4... that way you are not breaking any info on your own real-traded charts.

    Question two: can this be used to specify a custom spread? (or was that the stage and I'm too tired to realise?)
    q1: yes. Write to the .hst file and send a tick to the chart window to update it. Should work.

    Q2: the spread has been managed somehow differently. To decide on a diffferent spread for backtesting you have to disconnect MT4 from the net so it cannot call home and ask for the current spread then modify a file in the history folder, there should be a few threads about this here and on mql4.com.

  9. #39
    Quote Originally Posted by ;
    Looks like something simple failed:

    Inserted Code #91;2988#93; installed exception handler for C:Program FilesMetaTrader Admiral Markets ASexpertslibrariesmt4R.dll #91;2988#93; lt;2gt; Produce: trying to start R: C:ProgrammeRR-2.11.0binRterm.exe --no-save #91;2988#93; lt;-1gt; TRConsole: ruining #91;2988#93; eliminated exception handler for C:Program FilesMetaTrader Admiral Markets ASexpertslibrariesmt4R.dll
    It cannot start the RTerm.exe, be sure the route in
    extern string R_command is right (the model number changes from time to time), check it very closely and when R is installed and the path is right it should function.

  10. #40
    Quote Originally Posted by ;
    Can I Maximize mt4r.dll on windows 7 x64?
    You need to use the 32 bit compiler (download the 32 bit IDE, it includes the 32 bit compiler), MT4 itself is a 32 bit appliion and can only load 32 bit dlls. In case you used the 64 bit version of Lazarus/FPC binaries would be produced by it by default and this wouldn't work with MT4.

    You can even setup cross compiling from within precisely the exact same setup (if you plan on using Laz/FPC for other projects also, but the setup is more complied, I have not done this). And for MT4R it isn't feasible, it's strictly intended to be windows.

    The fantastic news is that 32 bit appliions run just fine on 64 bit windows.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.