I need to somehow check if the current WFO Cycle is ending.

The only directly useful parameter I could find is WFOPeriod, but if it isn't explicitly set, it holds the value zero.

Any idea how I could calculate the number of bars of a given WFO Cycle?

If you are curious, why I need it: I'm building a blazing fast Machine Learning Framework (that I plan to share with the community). I already benchmarked and the speedup is approximately a factor of 40...! Instead of sending the signals for each bar separately to the R session and waiting for the return, I'm using the signal.csv files that are exported during the RULCYCLE to train the machine learning algo, batch predict all the signals at once with the model of the preceding WFO Cycle, save the predictions to a file and read them with the

Code
dataFromCSV()


function like an indicator. I found out, that sometimes, the predicted value differs slightly from the cached prediction, probably because of minor deviations due to rounding. But hey, if the live prediction is 0.402 and the cached prediction is 0.413, who cares? Deviations are very rare (like only 2-5 within a whole WFO Cycle with thousands of bars!) and if they occur, they are very small. However, I want to make a reliable and fail-safe system. The most fragile part of this solution seems to me the beginning and the end of a WFO Cycle. I therefore want to check for errors within the first and the last couple of bars during each WFO Cycle to get an error message, when unusual big deviations or an unusual number of small deviations should occur.

Last edited by Smon; 05/21/20 14:58.