I hope this helps somebody. I still have questions and I hope, somebody will help me:

I'm also trying to speed up my main script. It's really slow with custom Indicators that make heavy usage of the R-Bridge. I want to do hyperparameter optimization in addition to parameter optimization. So I really need a way to bypass frequent signal file generation unless I'm willing to wait for ages for a result. This is my plan:

1) calculate a hash from the very first signal and use this as part of my filenames. By doing so, I can make sure to never unnecessarily recreate an existing signal file.
2) if the signal file exist, just skip the whole main script during RULCYCLE

The idea for 2) was this:

Code
if(!is(EXITRUN) && is(RULCYCLE) && file_length(filename(SIGNALFILE)) > 0)
{
	adviseLong(NEURAL, 0, 0);  
        //the real adviseLong() call comes later. But if I'm skipping here, I need to make sure that no series calls come later
        //I tried if it's working without this arbitrary adviseLong() call, but it's not.
	return;
}	


My problem is that NEURAL_TRAIN isn't triggered and I don't know why. My flagprint() function shows me this in Trainmode:

Quote
Bar 74520 | mode = MAIN_FUNCTION LOOKBACK TRAINMODE RULCYCLE WFOCycle = 1
Bar 93719 | mode = MAIN_FUNCTION TRAINMODE RULCYCLE WFOCycle = 1
Bar 184558 | mode = MAIN_FUNCTION TRAINMODE EXITRUN RULCYCLE WFOCycle = 1
Train USDCAD_L -Sep 2013-
Bar 184558 | mode = NEURAL_TRAIN TRAINMODE EXITRUN RULCYCLE WFOCycle = 1
Bar 184558 | mode = NEURAL_SAVE TRAINMODE EXITRUN RULCYCLE WFOCycle = 1
Store MyStrategy_USDCAD_1.ml
Bar 0 | mode = MAIN_FUNCTION INITRUN LOOKBACK TRAINMODE RULCYCLE WFOCycle = 2
Bar 90549 | mode = MAIN_FUNCTION FIRSTRUN LOOKBACK TRAINMODE RULCYCLE WFOCycle = 2
Bar 90550 | mode = MAIN_FUNCTION LOOKBACK TRAINMODE RULCYCLE WFOCycle = 2
Bar 109749 | mode = MAIN_FUNCTION TRAINMODE RULCYCLE WFOCycle = 2


So to me it looks like NEURAL_TRAIN is fired from the adviseLong() or adviseShort() function when

TRAINMODE
EXITRUN
RULCYCLE

are true. That's why I'm not skipping, if EXITRUN is true. However, if I'm using this bypass, only NEURAL_SAVE is triggered, resulting in empty *.ml files. (only 1kb size). What am I missing?

One more question: I still didn't really get how the default naming of the *.ml files works when it comes to retraining the strategy. The last model isn't enumerated by default. I understood it's used for predictions during live training.

Last edited by Smon; 05/22/20 14:38.