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

 
gobirzharf:

As soon as the swimmer learns to swim and starts splashing around, attracting attention, he immediately gets a weight of 200 kg on his neck, and there is no way anyone will go to the bottom)

You're not making any sense.

 
mytarmailS:

You can easily ...

But what kind of error you have in creating the data, it can not be such results ...

There seems to be no error. I don't see it by eye, what I had in mind that was written to the file.

Question to Maxim, when you were predicting the + - - sign, was it training on a number of what's in the file? Or on the normalized 0 - 1 row?

 
Evgeniy Chumakov:


Is it a complicated algorithm? Can it be immediately implemented in mql4/5 or what I'm asking is nonsense?

it is possible

There is, let's say, a well-established stack of technologies. You can go straight to mt5 or you can start with python and then export it into mt5. You can start with Python, but trade on MT5. In general, you may do it anyway you want.

 
Evgeniy Chumakov:

There seems to be no errors. I do not see it by eye, what I thought it was in the file and wrote it down.

Question to Maxim, when you predicted the sign + - - training took place on the row that is in the file? Or on the normalized 0 - 1 row?

on the same row, but answers are normalized 0-1

 
Maxim Dmitrievsky:

you can

There is, let's say, a well-established technology stack. You can go straight to mt5, or you can start with python and then export to mt5. You can use just python, but trade on mt5. You can do whatever you want.


Is it not friendly with the 4?

Is it difficult to install python on win 10 x64, no tambourine?

 
Evgeniy Chumakov:


Is it not at all friendly with 4?

Is it hard to install Python on win 10 x64, no tambourine?

4 is an atavism.

Probably not if you're not a Buryat shaman.

 
Maxim Dmitrievsky:

4 is an atavism.

Probably not, unless you're a Buryat shaman.

Yes, make him a model in the form of logging rules, let him implement it in his code, why torture the man with python?

Or should I do it?

 
Evgeniy Chumakov:
 condition                                                                                                       
 [1,] "X[,10]<=-0.025 & X[,10]>-0.08201612905"                                                                        
 [2,] "X[,9]>-0.057983871 & X[,9]<=-0.01129032255 & X[,10]>0.0219354839"                                              
 [3,] "X[,9]<=-0.057983871"                                                                                           
 [4,] "X[,9]>0.0702419355"                                                                                            
 [5,] "X[,8]>0.01362903225 & X[,8]<=0.0564516129 & X[,9]>0.00153225805"                                               
 [6,] "X[,8]<=0.0564516129 & X[,8]>-0.01153225805 & X[,9]<=0.0040322581 & X[,10]<=-0.00596774195"                     
 [7,] "X[,8]>-0.03370967745 & X[,8]<=-0.00403225805 & X[,10]>0.00032258065"                                           
 [8,] "X[,8]<=-0.03370967745 & X[,10]>0.02814516125"                                                                  
 [9,] "X[,8]<=-0.03370967745 & X[,10]<=0.02443548385"                                                                 
[10,] "X[,7]>-0.025 & X[,7]<=-0.00403225805 & X[,8]>-0.03370967745"                                                   
[11,] "X[,8]>-0.0266935484 & X[,8]<=-0.025"                                                                           
[12,] "X[,9]>0.0091129032 & X[,9]<=0.0277419355 & X[,10]<=-0.00096774195"                                             
[13,] "X[,9]<=0.0564516129 & X[,9]>0.03935483875"                                                                     
[14,] "X[,8]>0.02346774195 & X[,9]>-0.057983871 & X[,9]<=-0.0212903226"                                               
[15,] "X[,8]>-0.03370967745 & X[,8]<=0.0233870968 & X[,9]<=0.0233870968 & X[,10]>0.0091129032 & X[,10]<=0.02766129035"
[16,] "X[,8]>-0.03370967745 & X[,9]<=-0.00120967745 & X[,10]>-0.00596774195 & X[,10]<=0.0229032258"                   
[17,] "X[,10]>0.0012903226"                                                                                           
[18,] "X[,1]==X[,1]"                                                                                                  
      pred
 [1,] "1" 
 [2,] "-1"
 [3,] "1" 
 [4,] "-1"
 [5,] "-1"
 [6,] "-1"
 [7,] "1" 
 [8,] "-1"
 [9,] "-1"
[10,] "1" 
[11,] "-1"
[12,] "1" 
[13,] "1" 
[14,] "-1"
[15,] "1" 
[16,] "1" 
[17,] "-1"
[18,] "1"

The data is represented as a sliding window of size 10, the rules are built on such data...

the first element X[ , 1] ....... X[ , 10] last (current candle)

pred

this is what the rule predicts

the model predicts a sign, more than zero "1", less than "-1"

model accuracy 97-99%


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

here is all code in R... so big and incomprehensible ))))

d <- read.csv(file = "C:\\..........\\EURUSD_returns.csv")
d <- d[,1]

X <- embed(d, 10)[ , 10:1]  
Y <- as.factor(sign(  c(X[-1,ncol(X)] , 1)  ))

library(inTrees)
library(RRF)
rf <- RRF(X,Y,ntree=100) 
treeList <- RF2List(rf)
ruleExec <- unique(extractRules(treeList,X,maxdepth = 10))
ruleMetric <- getRuleMetric(ruleExec,X,Y) #  measure rules
ruleMetric <- pruneRule(ruleMetric,X,Y) #  prune each rule
learner <- buildLearner(ruleMetric,X,Y)

learner
 

mytarmailS:

so big and incomprehensible ))))


Ta not even funny))) did not understand what to do with it.

 
Evgeniy Chumakov:

It's not even funny)) do not understand what to do with it.

Don't laugh, but understand it better...

You don't need a code, you need logging rules (this is a model), you take those rules and put them in your code, the amount of predictions from the rules will be the model's answer - "1" or "-1".

If you do not understand it, ask

as long as I'm good))