[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Oscillator and Trend Following Indicator Integration?



PureBytes Links

Trading Reference Links

In an attempt to distinguish trends from trading-ranges I am trying to
build a formula to show what percentage of a lookback period has had
bars with highs greater than the current high.

The idea is to hold the current high (TdH) as a fixed value, and compare
each high in the lookback period against it, incrementing a counter
(HiCnt) for every higher high.  The following DOES NOT WORK since the
TdH reverts to the high of the lookback bar examined.  Will appreciate
any suggestions.  Thanks.

Bars:=Input("Lookback Bars =",1,500,200);
TdH:=H;
HiCnt:=Sum(If(H>TdH,1,0),Bars);
(HiCnt/Bars)*100

Harvey Pearce, Victoria, B.C. Canada