Research in matrix packages - page 9

 

Finding 'holes' in the story:

a<-ttFeed.BarHistory("LTCBTC", "Bid", "M1", Sys.Date()-50, Sys.Date())
a[ a[2:nrow(a),from] - a[1:nrow(a)-1, from]>40]
These two lines will immediately show 'holes' > 40 minutes on history in the last 50 days.
 

Spread over the past 24 hours in the form of a chart:

library(ggplot2)
ticks<-ttFeed.TickBestHistory("EURCHF", Sys.Date()-1, Sys.Date())
ticks[,spread:=(ask-bid) * 10^ttConf.Symbol()[name=="EURCHF", precision]]
ggplot(ticks, aes(spread)) + geom_histogram(color="black", fill="lightblue")

Four lines.

This is the EURCHF. You can clearly see that there is no negative spread. The same cannot be said about EURUSD.

I used the visualization examples from here.

ggplot2 histogram plot : Quick start guide - R software and data visualization
ggplot2 histogram plot : Quick start guide - R software and data visualization
  • www.sthda.com
This R tutorial describes how to create a histogram plot using R software and ggplot2 package. The function geom_histogram() is used. You can also add a line for the mean using the function geom_vline. Add mean line and density plot on the histogram The histogram is plotted with density instead of count on y-axis Overlay with transparent...
 
zaskok3:

Spread over the past 24 hours in the form of a chart:

Four lines.

This is the EURCHF. You can clearly see that there is no negative spread. The same cannot be said about EURUSD.

I used the visualization examples from here.

Good

 
zaskok3:

Spread over the past 24 hours in the form of a chart:

Four lines.

This is the EURCHF. You can clearly see that there is no negative spread. The same cannot be said about EURUSD.

I used the visualization examples from here.

I've always wondered how the average spread has changed over time. Could I, for example, download 10 years of data and calculate a moving average of the spread value? It would be useful to refine the trading modelling.
 
Alexey Burnakov:
I've always wondered how the average spread changes over time. Could we, for example, download data for 10 years and calculate a moving average of the spread value? It would be useful to refine the trading modelling.

Honestly, I don't understand why everyone is so attached to this spread? Apparently, the MT developers, with their Bid+Spread solution, have perpetuated this notion in their heads.

I do not use spread in trading at all! Nowhere! In the tester it is the same.

But to answer your question, you can't upload ticks in 10 years - that much is not stored in that online database. And in the years that are there, of course, nothing will prevent you from doing any analysis.

Ticks are available directly from R (see first post) and real-time. Renat is not interested for nothing...

Drives like this, if you get it right, are easy to write. So it's logical to expect something similar for the same Matlab, for example. It's handy, isn't it?

 
zaskok3:

Honestly, I don't understand why everyone is so attached to this spread? Apparently, the MT developers, with their Bid+Spread solution, have perpetuated this notion in their heads.

I do not use spread in trading at all! Nowhere! In the tester it is the same.


Maybe you misunderstood me. How can you not use spread in tester? )) It's a clear overhead for your strategy.

It would be interesting to see, even in averaged form, what was the spread, for example for 2009, for 2005, etc. Then this information can be used to simulate trading on the history, so that it would be more accurate.

 
Alexey Burnakov:

Maybe you didn't quite get my point. How can a tester not use a spread? )) It's a clear overhead for your strategy.

Use Ask. The overhead is the commission and the specifics of execution. The spread does not belong to the overhead. The spread, like bars for example, is a fiction.

It would be interesting to see, albeit in an averaged form, what the spread was, e.g. for 2009, for 2005, etc.

There are two lines in the first post that calculate the average spread as an example. Tweak it a bit and you get what you want.
 
zaskok3:

The spread, like the bars for example, is fictitious.


OK, thanks.

When I write an EA, I kind of use Bid and Ask prices.

And if I say I want to see the historical difference between Bid and Ask, it is no longer a fiction?

 
Alexey Burnakov:

And if I say I want to see the historical difference between Bid and Ask, is it no longer a fiction?

The fiction about the spread is that it is supposedly an overhead and the tester needs this information.

The fiction about bars - that it is supposedly a logical quantization of price, and the same indicators must be built accordingly.

Otherwise this is an offtopic, so I suggest we don't continue. I started ranting about the spread here for nothing.

 
zaskok3:

Spread fiction - that it is supposedly an overhead and the tester needs this information.

The fiction about bars - that it is supposedly a logical quantization of price, and the same indicators should be built accordingly.

Otherwise this is an offtopic, so I suggest we don't continue. I started ranting about the spread here for nothing.

OK, I agree, let's not get off-topic.