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

 
Aleksey Vyazmikin:

Thanks for trying.

Which ZZ did you use? Can you send me a couple of marked ZZs with different ranges?


Right now I want to group the splits, that way there will be fewer combinations.

Please...

200 or 300 in absolute values.

ZZ by balance? tell me which ranges you are interested in


Or maybe study R a little? ;)


5 lines of code, and you got what you wanted.

#  читаем файл
dat <- read.csv(file = "D:\\R2\\forum\\models\\Balans_OHLCV.csv",sep = ";")
#  установка библы с индикаторами в том числе зигзаг
install.packages("TTR")
#  считаем зигзаг по баласну
my_ZZ <- TTR::ZigZag( dat$Balans ,change = 200,percent = F)
#  зигзаг в бинарный вид
zz <- c(0,diff(my_ZZ)) ; zz[zz>=0] <- 1 ; zz[zz<0] <-  0
zz
#  добавляем зз как колонку к данным
dat_and_zz <- cbind(dat, zz)
#  пишем данные в новый файл  csv
write.csv(dat_and_zz, file = "D:\\R2\\forum\\models\\Balans_OHLCV_ZZ.csv",sep = ";")
 
#  установка библы с индикаторами в том числе зигзаг
install.packages("TTR")
#  читаем файл
dat <- read.csv(file = "D:\\R2\\forum\\models\\Balans_OHLCV.csv",sep = ";")->.;
#  считаем зигзаг по баласну
TTR::ZigZag(., change = 200, percent = F)->.;
#  зигзаг в бинарный вид
c(0, diff(.)) ->.;
sign(.)->.;
#  добавляем зз как колонку к данным
cbind(dat, zz = .) -> dat_and_zz 
#  пишем данные в новый файл  csv
write.csv(dat_and_zz, file = "D:\\R2\\forum\\models\\Balans_OHLCV_ZZ.csv",sep = ";")

It's better this way. There's less in-between unnecessary garbage.

Good luck

 
Vladimir Perervenko:

It's better this way. There's less in-between unnecessary garbage.

Good luck

Thank you Vladimir, I didn't even know you could do that )) !!! I love R, always a pleasant surprise!

When will you show me how to discretize data and how to transfer it to new data?)

 

Well, I thought I gave you a link to an article. Here it is.

The package "discretization" is used.

"Discretization is the process of transforming a continuous variable into a discrete one by dividing its value into ranges using various methods of determining the limits.

We can distinguish two groups of discretization methods: quantitative, with no relation to the target, and considering the correspondence of the ranges to the target.

The first group of methods is almost entirely covered by cut2()::Hmisc. You can divide the sample into a predetermined number of sections, with specific boundaries, by quartiles, specifying the minimum number of samples in each section, by equal-frequency sections.

The second group of methods is more interesting, because it divides the variable into sections associated with levels of the target. Let's take a look at several packages that implement these methods.

Discretization. This package is a set of discretization algorithms with a teacher. It can also be grouped in terms of "top-down" or "bottom-up" implementing discretization algorithms. Let's look at some of them using ourdataSet as an example."

We use thediscretization::mdlp() function, which describes discretization using the minimum description length principle. This function discretizes continuous attributes of the data matrix using the entropy criterion with minimum description length as the stopping rule. It splits perfectly, but it takes a long time. We use base::findinterval() to discretize the test set. There are functions and examples in the article. This is not the only sampling package. In fact: glmdisc, smbinning, cutpointr (for binary target), woeBinning and others. These are the packages in CRAN. There is a nice MOB package which you can install from Github. I've checked these and they work. It depends what you want to sample (woe, bin, raw...).

Try it out.

Good luck

Глубокие нейросети (Часть II). Разработка и выбор предикторов
Глубокие нейросети (Часть II). Разработка и выбор предикторов
  • www.mql5.com
В предыдущей части статьи мы рассмотрели различные аспекты получения и подготовки входных данных и целевой переменной. Для воспроизведения скриптов этой статьи вам необходимо либо выполнить все скрипты первой части, либо загрузить результат вычислений первой части статьи из приложения в RStudio. 1. Разработка признаков Разработка признаков —...
 
Vladimir Perervenko:

Depends on what form you want the sampling result in (woe, bin, raw...)


Like what you want)))) But that doesn't mean it's right) Gruuuus...........

 
Vladimir Perervenko:

Well, I thought I gave you a link to an article. Here it is.

The "discretization" package is used.

No, you didn't :)

I've seen different packages and read articles but I haven't found how to work with new data when discretizing.

 
Vladimir Perervenko:

Well, I thought I gave you a link to an article. Here it is.


There are a lot ofarticles, the research is interesting, but is there any sammari about the practical results?
I mean, how well does it work in the real market?

Vladimir Perervenko
Vladimir Perervenko
  • www.mql5.com
Мы продолжаем строить ансамбли. Теперь к bagging-ансамблю, созданному ранее, добавим обучаемый объединитель — глубокую нейросеть. Одна нейросеть объединяет 7 лучших выходов ансамбля после обрезки. Вторая принимает на вход все 500 выходов ансамбля, обрезает и объединяет их. Нейросети будем строить с Глубокие нейросети (Часть VI). Ансамбль...
 
Evgeny Dyuka:

There are a lot ofarticles, the research is interesting, but is there any sammari about the practical results?
I mean, how well does this work in the real market?

It works. Will you take my word for it?

All the codes are laid out. Create it and try it out.

The most important thing is not the models, even though they are important. What matters are the predictors and their preparation (preprocessing). The better the data are prepared, the easier the models will be used.

Good luck

 
Vladimir Perervenko:

It works. Can you take my word for it?

All the codes are laid out. Go ahead and try it.

The most important thing is not the models, even though they are important. What matters are the predictors and their preparation (preprocessing). The better the data are prepared, the easier the models will be used.

Good luck

Of course I will believe it, I will read everything carefully and analyze the code, especially now I have nothing to do, I have a lot of time.
But before I spend a week on it, can you give me a link to a fragment of the article, which begins with a phrase like"The method described above gives these results in the real market... " and then a couple of charts or a table.
 
Evgeny Dyuka:
Of course I believe, I will carefully read everything and analyze the code, especially now there is nothing to do, there is plenty of time.
But before I spend a week on it, can you give me a link to a piece of article which begins with a phrase like"The method described above gives such results in the real market... " and then a couple of charts or a table.

Well there almost every other article ends with a test on new data

there it is here
Vladimir Perervenko
Vladimir Perervenko
  • www.mql5.com
Мы продолжаем строить ансамбли. Теперь к bagging-ансамблю, созданному ранее, добавим обучаемый объединитель — глубокую нейросеть. Одна нейросеть объединяет 7 лучших выходов ансамбля после обрезки. Вторая принимает на вход все 500 выходов ансамбля, обрезает и объединяет их. Нейросети будем строить с Глубокие нейросети (Часть VI). Ансамбль...
Reason: