|
Kiran
2015-07-02 09:27:53
|
|
In the code below, I'm having trouble coding a dynamic crossOver point that's 8 ticks below the current close
- i.e. I'm looking for a bullish pattern where close crossed over 8 ticks below the current close at "some bar in the past" and stayed didn't dip 6 ticks below that crossover point since then.
//strategy code
dynCross= close-8*TickSize();
rule0 = cross(close,dynCross); //i think the code fails here, as it's always comparing current close to dyncross, not the close at "some bar in the past"
rule1 = hhvllv(1, close, BarsSince(rule0))> brickLow-6*TickSize(); // Close stayed above 6 ticks below the last dynamic crossover point.
PlotArrow(rule0, "dynCross", AboveHigh, colorGreen);
buy = rule1;
How do i specify "close at some bar in the past" in rule0? I can't use ref(close,N) expects a specific number, not "some bar in the past"
|
|