Hello Eugene,
Your solution successfully enables alternating through the OHLC data series that is the reference for the CrossUnder test.
Can you propose an additional solution that will enable a similar (but independent) variation of the OHLC series to be used for the EMA.series used in the DataSeriesCrossBelow data series?
In other words, during an optimization run I would like to be able to test each of the O H L C time series as the basis for the EMA calculation (the version of the code in the previous post can consider only the "Close" series). Additionally, it's important that the possible choices of OHLC series for the CrossUnder test are not required to be the same as the OHLC choices for the EMA.series used in the DataSeriesCrossBelow data series. For example, in any given run of an optimization it would be possible to have the CrossUnder test reference "H" and the EMA.series used in the DataSeriesCrossBelow data series reference "C".
See following unsuccessful attempt at coding this:
CODE:
Please log in to see this code.