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

Re: Indicator code



PureBytes Links

Trading Reference Links

Bob

Just tried it - works perfectly. Thanks.

VT

----- Original Message ----- 
From: "Bob Fulks" <bfulks@xxxxxxxxxxxx>
To: "Virgin Trader" <virgin_trader@xxxxxxxxxxx>
Cc: "omega list" <omega-list@xxxxxxxxxx>
Sent: Sunday, July 08, 2001 4:20 PM
Subject: Re: Indicator code


> Sorry. I misunderstood what you were looking for. Since you seem to
> want to know what percentage of the past prices are within a band
> around the current price, there is no easy way except by searching
> back. Something like this should work (untested):
> 
>     {Find band values for this bar}
>     level = close;
>     topband = level + band / 2;
>     bottomband = level - band / 2;
>     Count = 0;
> 
>     {Count number of occurrences during past Length bars)
>     for j = 1 to Length begin
>        Condition1 = Close[j] < topband and Close[j] > bottomband;
>        if Condition1 then Count = Count + 1;
>     end;
>     {Figure percentage}
>     significance = 100 * Count / Length;
> 
> Bob Fulks
> 
> --
> 
> 
>