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

 

Andrey Dik:
Very easy. The charts have to be scaled to the same range.

 код

mytarmailS probably needs R function, why does he need your mql tricks

 
Zhenya:

mytarmailS probably needs R function, why does he need your mql tricks

"You fool, Vasya!" (c) Love and pigeons.

I gave you an idea how to do what the questioner wants. The function is simple and straightforward, he can rewrite it on his unforgettable R, if he feels like it.
 
Zhenya:

mytarmailS probably needs R function, he doesn't need your mql tricks.

scale(x, center = TRUE, scale = TRUE)

x is a matrix. Centering and scaling is done for each column of matrix separately

Depending on the values of center and scale, different centering and scaling methods are performed.

See scale {base} for help.

 
SanSanych Fomenko:

scale(x, center = TRUE, scale = TRUE)

x is the matrix. Centering and scaling is done for each column of the matrix separately

Depending on the values of center and scale, different centering and scaling methods are performed.

See scale {base} for help.

scale() is not suitable it with its tricky normalization constantly makes different ranges...

x <- cumsum(rnorm(20))+100
#диапазон.нормированого "X"
RX <- range(    scale(x,T,T)    )

RX
-2.140863  1.424344
-1.932520  1.450485
-1.617709  2.390062
......
.... итп.


RX2 <- range(    scale(x,F,T)    )

RX2
0.9477774 0.9935281
0.9587916 0.9902856
0.9342381 1.0031507
......
.... итп.


RX3 <- range(    scale(x,T,F)    )

RX3
-2.079683  1.381148
-2.575139  1.668604
-1.554297  2.048058
......
.... итп.


RX4 <- range(    scale(x,F,F)    )

RX4
95.29704 99.80211
97.59647 100.89154
94.67793 99.78135
......
.... итп.


The fact that the ranges are always different in my task is not acceptable, because then each vector will be given a different weight, you won't be able to summarize it correctly

I just made a function that sets each vector range from 0 to 1

x <- cumsum(rnorm(20))+100
range01 <- function(x){(x-min(x))/(max(x)-min(x))}

#диапазон.нормированого "X"
r01 <- range(    range01(x)    )

r01

01
01
01

Thank you all who tried to help

 
Andrey Dik:
"You fool, Vasya!" (c) Love and pigeons.

I gave an idea how to do what the questioner wants. The function is simple and clear, he can rewrite it on the unforgettable R, if he is too eager.
The point is that 90% of functions are faster to write yourself than to look for a "package" with some function with God knows what contents, but as they say, "master of none...".
 
mytarmailS:

scale() is not suitable it with its tricky normalization constantly makes different ranges...




The fact that the ranges are constantly different in my problem is not acceptable, because then each vector will be assigned a different weight, and the correct summation will not work

I just made a function that gives each vector a range of 0 to 1

x <- cumsum(rnorm(20))+100
range01 <- function(x){(x-min(x))/(max(x)-min(x))}

#диапазон.нормированого "X"
r01 <- range(    range01(x)    )

r01

01
01
01

Thanks to everyone who tried to help

===========================================

The scale() function is very versatile. What you've come up with corresponds to

range01 <- scale(x, center = min(x), scale = max(x) - min(x))

Good luck

 
Gianni:
The thing is, it's faster to write 90% of functions by yourself than to look for some "package" and in it a function with "who knows what contents", but as they say, "master of the gun...".

Why "with who knows what content"? You can see any function in any package. Just write its name without (), and its contents will be shown to you. You didn't know it?

Good luck

 

Forum on trading, automated trading systems and trading strategies testing

Machine learning: theory and practice (trading and not only)

Combinator, 2017.02.09 17:57



What's interesting, at round levels they mostly put limits, and they put stops based on the price levels of the chart.
In crypto it is the same (in terms of limits, stops are not visible there).
I would not place them at all.
It's a good demonstration, thank you!
 
Vladimir Perervenko:

Why "with who knows what content"? You can see any function in any package. Just write its name without (), and its contents will be shown to you. You didn't know it?

Good luck

The point is that I don't want to know about all sorts of "magic" tricks, different frameworks, of which there are 100500, different secret key combinations and what does one of >10 000 "universal functions" parameters mean? I have a different brain. I myself wrote many hundreds of functions, maybe more than a thousand, and sometimes rewrote some of them many times because I forgot I had already written them, I do not remember the names and signatures of the functions I wrote myself half a year ago and rarely used, how can I remember 10,000 of the left framework? But I remember well or make up anew the essence of algorithms, for example on Fit01 even if I forgot it, I'd have it ready in a minute and it doesn't depend on OS, PHP, framework and packages.

 
Vladimir Perervenko:

Thanks

Reason: