I've got this line of code in a strategy, it seems to work fine:
LO_CONSTRAINT = MRO(delegate {return VarStoch(3, 5, 3, 3).VarStoK[0] >= 97;}, 1, NEW_RISE);
The next line uses this value in the following command:
HI_CONSTRAINT = MRO(delegate {return VarStoch(3, 5, 3, 3).VarStoK[0] < 97;}, 1, NEW_RISE - (LO_CONSTRAINT + 1));
This returns a value of "0", which it should not. I simply want to "go back" to the "LO_CONSTRAINT" value (+1 bar) FROM the "NEW_RISE" value and calculate the last time the VarStoK value was < 97...where is the logic error here?
Thus for example if "NEW_RISE" is bar #500 and "LO_CONSTRAINT" is 15 bars before that (#485) I want to get the "HI_CONSTRAINT" value to be the last true conditional measured back from bar #484...hope that makes sense...thanks in advance for any advice.
Comment