Machine learning in trading: theory, models, practice and algo-trading - page 282

 
mytarmailS:
Thanks but not familiar with MT at all, maybe there is a way to just get the history in some file?
History is a set of binary files of a certain format. The whole system is grounded exactly for MT, it will be difficult to do without it.

All of the history I do not have, downloading all the data on the ratios and Marketbook, I think it will take at least a day. There seems to be a few gig. Ratio is not that interesting and it can be approximately obtained from the marketbook.

For mt there is an infrastructure for working with historical data exactly so that it is linear and convenient.

If you want to analyze the data, most likely the most convenient will be to write a script for mt which will distill the data in a convenient format for you, if you want to use this data in the trade, there are no alternatives, you have to write a trading engine on the MT, because the format of the API to the server is closed and will not be open.
 
Combinator:
Thank you for your clear and concise answer
 
mytarmailS:

Do you predict the price or do you work on the movement? Does the MO predict where the price will be in the future or is the algorithm trend-following?

Returns on a range of horizons {1,2,5,10,30,60,120,300,600,3600} seconds ahead, spreads, reversals on different horizons, volatilityat 10 min and one hour ahead, meta-market states (trending/flying/fluctuating etc.), dozens of different technical meta-features and so on.

 
toxic:

... several types of volatility

What is that?
 
SanSanych Fomenko:

This is exactly what I wrote and as I understand it we are talking about the same thing

Taking the reversals to short (selling). The teacher for selling is NOT what is after the reversal, but BEFORE and AFTER the reversal, which is cut off by the orange line. Similarly with longs.

Let's take a long - purple line. It cuts off everything below the price line that predicts a future reversal, which is at a certain fixed value - the potential profit. That is, we do not predict the trend, but the profit.

R What part of the trade will be on your screenshot if you take a window on the zigzag?
 
SanSanych Fomenko:
What is this?
10 minutes and an hour ahead
 
Mihail Marchukajtes:
R What part of the trade will be on your screenshot if you take a window on the zigzag?

There will be a large lag of the teacher from the predicted bars: the last link of ZZ, which is redrawn, the penultimate link, which can potentially continue, and another link, as the cut-off line is drawn on the previous link.

We have tried to build models by this idea but the result was zero, we were not able to choose predictors.

 
The following is a list of the most popular ways to move forward:
10 minutes and an hour ahead
I was interested in the meaning of the word "volatility". What exactly do you take as a measure of volatility?
 

Shit... you guys are really dumb...

You have to shift when you use for example Sign(Rt+1) as a target, in the trivial case there are N past returns as fiches, {Rt-n,...,Rt} and future Sign(Rt+1) as a target, then you shift to the left. But ZZ is ALREADY moving! HE'S PEEKING!

You don't need to shift the peeking indexes, you then teach the classifier to be ahead of the already future, you can do that, but that's WAY worse.

I did not think that such commonplace truths would have to be explained.

1. There is a "Zig-Zag" and "Zig-Zag. You have to look at what the indicator gives on the output. "As a rule, the output of ZigZag of MT4 (and of many other reincarnations) consists of three buffers, one with the values of the tops and bottoms, according to which the indicator is drawn by segments, the second only the tops, the third only the bottoms. In other words, we obtain the numbers of bars (tops) where the sign should be changed. And there is no need to shift them when using this data as a target. By the way, between the tops the indicator is not defined (or equal to zero).

In our case (I mean in R) "ZigZag" gives the value of a broken curve defined on all bars. We calculate the first difference diff(zz) and want to predict the sign of this difference sign(diff(zz)). Where do we need to shift the series?

Quote: "You have to shift when using for example sign(Rt+1) as a target, in the trivial case there are N past returns as fics, {Rt-n,...,Rt} and the future Sign(Rt+1) as a target, then you shift to the left"

Right, to the left by one bar.

Indicators, called by the common name "ZigZag", do not peek or move anywhere. They calculate, according to certain algorithms, the peaks(geometric or orthodox) on the time series chart (not only OHLC, but any other), i.e. the moments of signal changes or, as in our case, determine a broken curve that connects these peaks and troughs. In the picture below there are some examples of indicators that can be used as signal generators.

https://www.mql5.com/ru/charts/6616591/eurusd-m15-alpari-international-limited

2. When testing prediction results of trained model(s) we define some metrics to estimate the model.

  • Prediction accuracy (Accuracy, F1, etc.). We compare the target from the test set and the predict from the model. This index is an evaluation value, secondary.
  • The quality of the prediction.
    • For example quality coefficient = Total returnee on n bars/n bars. I.e. average number of points of profit per bar in the history interval of n bars.
    • Maximum drawdown of this part of the history
    • the average lifetime of the position
It is important to remember that when calculating the qualitative indicators , the predictor must be shifted one bar to the right. Otherwise you will get a result that is far from reality.

Good luck

График EURUSD, M15, 2017.02.20 12:15 UTC, Alpari International Limited, MetaTrader 4, Demo
График EURUSD, M15, 2017.02.20 12:15 UTC, Alpari International Limited, MetaTrader 4, Demo
  • www.mql5.com
Символ: EURUSD. Период графика: M15. Брокер: Alpari International Limited. Торговая платформа: MetaTrader 4. Режим торговли: Demo. Дата: 2017.02.20 12:15 UTC.
 

As for which ZigZag values to use in training, there are three options :

  1. all
  2. all with increased example weights around the peak (if the model allows using a vector of example weights)
  3. only a few values around the peak
Depending on the model(s) used, you can use one, or if the model allows for pre-learning, two or all three in sequence.

Good luck

Reason: