It is possible to get history and real-time feed (+ trade) directly from R. History: OHLC (down to seconds) + ticks + Level2.
Manual. I think it may be relevant at least as an updated online DB for custom feeds in MT5.
But I want to master not only MQL, but also mathematical packages. For example, look how quickly and easily calculate the average spread of the last seven days:
Result:
Just two lines! There's no need to think about downloading fresh tick history, looping and so on. Everything is done by itself!Unfortunately, I know practically nothing in R. I would like examples of visualization of the same price. To see the spread distribution and other simple "on the fly" actions, which in R take one/two lines.
And I'm not even speaking about testers variants (with possibility to choose optimization model (not only GA)) in R.
The same applies to Matlab with Mathematics. If anyone is friendly, please share simple and illustrative examples.
I've been working with Matlab for a long time, a week ago I installed R, I'm slowly learning it. I don't know about R, but Matlab has a handy feature - if you write a program as a function, you can easily put it in a DLL, which you can then call in the usual way from MQL.
For MQL4, you need to have a 32-bit version of Matlab. By the way, the latest version 2015b wrote that there will be no more support for 32-bit systems, this is the last version that supports it.
Incidentally, Microsoft is also interested in R, with the official announcement of Microsoft R Open in January 2016
https://habrahabr.ru/post/275113/
- habrahabr.ru
Write to a tick historyfile for yesterday's day (similarly done for any interval):
ticks<-ttFeed.TickBestHistory("EURUSD", Sys.Date()-1, Sys.Date()) write.table(ticks, file='ticks.csv', row.names=F)The result is in attached file.
Someone searches for tick history, collects it in different places, tortures CopyTicks, etc. And someone writes just two lines.
Write to a tick historyfile for yesterday's day (similarly done for any interval):
The result is in attached file.Where does the story come from?
It is possible to get history and real-time feed (+ trade) directly from R. History: OHLC (up to seconds) + ticks + Level2.
Manual. I think it's useful at least as an updated online DB for custom feeds in MT5.
But I want to master not only MQL, but also mathematical packages. For example, look how quickly and easily calculate the average spread of the last seven days:
Result:
Just two lines! There's no need to think about downloading fresh tick history, looping and so on. Everything is done by itself!Unfortunately, I know practically nothing in R. I'd like examples of visualization of the same price. To see the spread distribution and other simple "on the fly" actions, which in R take one/two lines.
And I'm not even speaking about testers variants (with possibility to choose optimization model (not only GA)) in R.
The same applies to Matlab with Mathematics. If anyone is friendly, please share simple and illustrative examples.
Tomorrow I'll post a couple of useful codes on the subject.
By the way, if there are any people who know R, a beginner's question. I see that there are several R distributions, R-server, some "A web application framework for R" http://shiny.rstudio.com/ , monster packages from Microsoft... What to choose?
A web application framework for R
.By the way, if there are any people who know R, a beginner's question. I see that there are several R distributions, R-server, some "A web application framework for R" http://shiny.rstudio.com/ , monster packages from Microsoft... What to choose?
A web application framework for R
.Hello. First install R: https://cran.r-project.org/bin/windows/base/
Optionally you can install R Studio: https://www.rstudio.com/products/rstudio/download/
Studio is much more convenient to work with.
I'll post a couple of useful codes on this topic tomorrow.
Basic graphs:
# time series plot(lateral_residuals$`lateral_linear_model$residuals`, type = 'l') # histogram hist(lateral_residuals$`lateral_linear_model$residuals`) #scatterplot plot(x$V1, x$V2)
#two or more semitransparent histograms of distribution a=rnorm(1000, 3, 1) b=rnorm(1000, 6, 1) hist(a, xlim=c(0,10), col="red") hist(b, add=T, col=rgb(0, 1, 0, 0.5) )
# histogram with density library(ggplot2) ggplot(combined_residuals, aes(x = combined_residuals$'value', fill = combined_residuals$'group')) + geom_histogram(alpha = .5, binwidth = 0.05) + geom_density(alpha = .3, col = 'blue') + xlim(-3, 3)
# boxplots library(ggplot2) ggplot(a_sample, aes(x = x$V1))+ geom_boxplot()
ggplot examples: http://www.mitchr.me/SS/exampleR/rcode/ggplot.html
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Manual. I think it may be relevant at least as an updated online DB for custom feeds in MT5.
But I want to master not only MQL, but also mathematical packages. For example, look how quickly and easily calculate the average spread of the last seven days:
Result:
Just two lines! There's no need to think about downloading fresh tick history, looping and so on. Everything is done by itself!Unfortunately, I know practically nothing in R. I would like examples of visualization of the same price. To see the spread distribution and other simple "on the fly" actions, which in R take one/two lines.
And I'm not even speaking about testers variants (with possibility to choose optimization model (not only GA)) in R.
The same applies to Matlab with Mathematics. If anyone is friendly, please share simple and illustrative examples.