Where can you check wich ml file is advice function reading?

Posted By: tomaslolo

Where can you check wich ml file is advice function reading? - 05/11/20 10:35

Hello, I´ve been sometimes developing with advice function, try things, go to other things and come back.

I get strange behaviours and I have the doubt about which file does advice function read, when testing/trading, a trained strategy.

As far as I know, it reads "Deeplearn.ml" files but how can i make sure it´s reading the correct .ml file?

For example this R code, from the R script:

neural.test = function()
{
neural.init()
XY <<- read.csv('c'c:/project/Zorro/Data/DeepLearn.csv' ,header = F)
splits <- nrow(XY)*0.8
XY.tr <<- head(XY,splits)
XY.ts <<- tail(XY,-splits)
neural.train(1,XY.tr)

X <<- XY.ts[,-ncol(XY.ts)]
Y <<- XY.ts[,ncol(XY.ts)]
Y.ob <<- ifelse(Y > 0,1,0)
Y.pr <<- neural.predict(1,X)
confusionMatrix(as.factor(Y.pr),as.factor(Y.ob))
}

Is neural.test function called by zorro when testing and you have to change Deeplearn.csv path? Deeplearn.csv file should be Deeplearn.ml? Or does Zorro reads .ml file without using R?

Thank you in advanced!
Posted By: danatrader

Re: Where can you check wich ml file is advice function reading? - 05/15/20 21:59

Pretty old, but as far I see, first the neural net needs to be trained to the price curve.

Therefore this must be changed to the features file.
XY <<- read.csv('c'c:/project/Zorro/Data/DeepLearn.csv' ,header = F)

After training the neurons, the Zorro script needs to be trained and creates the .ml files.

Zorro handels which .ml files are read.

Just the scripts .r and .c need the same name.

I suggest both sources of knowledge for beginners:

https://financial-hacker.com/build-better-strategies-part-5-developing-a-machine-learning-system/
https://robotwealth.com/machine-learning-financial-prediction-david-aronson/
Posted By: tomaslolo

Re: Where can you check wich ml file is advice function reading? - 05/17/20 21:01

Thank you for your reply. I´ve red some about it, I´ll re-read them and robotwealth one.

I make sure both files (.c and .r) have the same name, but I get results I don´t understand and ask myself if I can make sure which ml file is Zorro reading.


Thanks again!
Posted By: Smon

Re: Where can you check wich ml file is advice function reading? - 05/21/20 17:44

You should use DebugViewDebugView to see what Zorro is actually sending to the R session.

Another cool trick is to put this file at the beginning of the R script:

Code
neuraldebugpath <- paste0("D:/Zorro/Strategy/neural_debug.rda")


Just edit the path according to your needs.

End then you put this

Code
save.image(neuraldebugpath)


right at the beginning of your neural.train function in the R script.

Then you can use RStudio to see what's really going on under the hood. You just need to learn about the <- and the <<- operator and global / local variables in R.
© 2024 lite-C Forums