I don't understand how the "model" parameter is incremented within the function. Where should I specify the models that I want to use? And how is that related to the "model" parameter? Let me explain my confusion through my current approach:

At the moment, I'm doing the following to train a knn model and a random forest model on the same signals for each asset in a loop (although its not relevant, the 'train' function is from the caret package in R):

Code:
if(mode == NEURAL_TRAIN) {
file_write("Data\\signals.csv",Data,0); // export batch training data to R
Rx(strf("Data <- read.csv('%sData/signals.csv',header=F)",slash(ZorroFolder)));

if(!Rx(strf("knn_%s <- train(Data[, c(1,2)], Data[, 3], method = 'knn')",  strx(Asset,"/","")))) return 0; 
if(!Rx(strf("rf1_%s <- train(Data[, c(1,2)], Data[, 3], method = 'rf')",  strx(Asset,"/","")))) return 0;



which seems to work as expected. However, saving and loading the correct models quickly becomes difficult since using this method, I need to specify each model expclicitly:

Code:
if(mode == NEURAL_SAVE) {// save the trained model in the Zorro Data folder
return Rx(strf("save(knn_AUDUSD, knn_EURUSD, rf_AUDUSD, rf_AUDUSD, file='%s')", slash(Data)),2);



With many machine learning algorithm types and many assets, this approach would quickly lead to disarray.

So my question is, how exactly would I specify the above training and saving cycles using the list approach you suggested? Maybe if you could describe how I interact with the "model" parameter, I would understand better. At the moment, its not clear to me how that parameter is used or specified - I have an inkling that I need to specify it in the adviseLong() call?

Thanks for your help, jcl.

Last edited by boatman; 01/13/16 23:45.