› Forums › Development › Use R in trading
Tagged: programming, R, Script, Statistics, trading
- This topic has 33 replies, 5 voices, and was last updated 10 years, 1 month ago by
simplex.
- AuthorPosts
- December 14, 2015 at 8:40 pm #10363
Hope tomorrow I’ve time to write next chapters (until “Graphical representation of FX/stock data”).
December 14, 2015 at 8:44 pm #10364When accessing the table in the same way as the matrix and the dataframe, I expected an error message. But instead the same cell was accessed, obviously the table was implicitly pivoted.
Could you pleas post the code as well as the error message here?! Do you mean indexing using
x[m,n]?December 14, 2015 at 11:29 pm #10369There was no error message! I just wanted to check some limits, expected an error message, and got a correct result.
I converted matrix M into data frame MD and table MT. I expected the syntax x[i,j] to work on a matrix and a data frame, but not on the table, because this is organized in a database like manner and not a typical matrix or pivot layout.
But it worked – see screenshot.
Attachments:
You must be logged in to view attached files.A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
December 23, 2015 at 7:41 am #10781Thanks a lot @anti for your step by step tutorial .
I have downloaded the R + Rstudio and installed it long time ago, but i was too busy with ideas of great traders @FF about the exit point (levels) and some other good stuffs (including Eurusdd, GG, and some other great ones), so have no enough time to play with this. I have downloaded the MT4 R bridge also from FF (7bit) & github (micclly) last week, will try it too in my free time (have so many plan to do, but have limited time
, especially after i got eyes problem
).
I think getting the probability / statistics of our “weapon” is very very important. Some of indicators are repaint and it is not a good idea to get the statistic based on MT4 strategy tester. Statistic inside indicator itself (like kprsa did with his RS indicator) is nice, but i think, it would very nice if we can get it in other way. A friend use Python + Panda + R + Ninja for analysis. May i know do you use Ninja or MT4 for your analysis ? So far i know, Ninja using C# (with its powerful OOP and other features), MT4 using MQL (new one has OOP ability). I think Python is a simple programming language like PHP and MQL, but powerful, so learning Python will spend not so long time compare to C# or Java. I am not a good coder, have just very little experiences with C# long time ago just for plyaing around. From your experiences, is it better to learn C# and use Ninja+Python+Panda+R , or for temporary it is enough to use MQL + R to calculate probabilities (then jump to Ninja + its friends in the future) ?
Any idea is welcome … Thanks in advance.December 23, 2015 at 8:05 am #10782Hi smallcat,
nice to have you here. I use MT4 and usually import saved MT4 data into R. I think using the R bridge can simplify analysis precedure especially when you’re going to analyze big data sets (e.g. M1 data of many years). Python seems to be quite powerful and there are not that much differences between R and Python commands/syntax. I learned some Python basics during summer school but I came back to R due to my habits. Nevertheless, I assume you can do analyses in Python, too.
During these days I have unfortunately not as much time as I wish to have. Thus, next chapters will be posted next year …
Best, merry christmas and a happy new year
Anti
December 23, 2015 at 10:11 am #10794Thank you again @Anti for the efforts you’re expending to get us started in R:
During these days I have unfortunately not as much time as I wish to have. Thus, next chapters will be posted next year …
Take your time, will wait patiently! During the holiday season, most of us will have several activities outside the forum and outside MT4!
Best,
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
December 23, 2015 at 10:17 am #10795Hi @Anti
I am idiot in ‘R’ ..

Don’t ‘accidentally’ deleted this thread until I finish all the material..
(learning a new language is hard for me..)
looking forward your next chapter..
thanks for your contribution..
tankhang
December 23, 2015 at 10:17 am #10796Hi smallcat, nice to have you here. I use MT4 and usually import saved MT4 data into R. I think using the R bridge can simplify analysis precedure especially when you’re going to analyze big data sets (e.g. M1 data of many years). Python seems to be quite powerful and there are not that much differences between R and Python commands/syntax. I learned some Python basics during summer school but I came back to R due to my habits. Nevertheless, I assume you can do analyses in Python, too. During these days I have unfortunately not as much time as I wish to have. Thus, next chapters will be posted next year … Best, merry christmas and a happy new year Anti
Have a wonderful merry Christmas and a happy and successful new year bro Anti ….
Do you mean, we can do statistical analysis just using MQL + R , without other programming language or tools (python or panda as example) ? This is nice … Have a nice holidays too …Edit: you imported “saved MT4 data” into R, does this mean that R has a simple “database” ability ?
-
This reply was modified 10 years, 4 months ago by
smallcat.
March 10, 2016 at 2:50 pm #12001Just found this resource and thought it may be of interest for readers of this thread: title is Quantitative Trading with R
http://manual.zorro-project.com/Lecture4.htm
see also under:
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
-
This reply was modified 10 years, 4 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.