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

Data for Canadian & Aust. Dollar



PureBytes Links

Trading Reference Links

Harvey,

The following 'if' statement will never be true. You need to use two
different variables for the High.
Here you are comparing H to H because you have previously set (TdH equal to
H).

David Radtke


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



                                                                  
 (Embedded                                                        
 image moved   metastock-list @ metastock.com                     
 to file:      11/22/97 03:23 PM                                  
 PIC09597.PCX)                                                    
                                                                  



To:   metastock-list @ metastock.com
cc:    (bcc: David Radtke)
Subject:  Formula Problem




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





Attachment Converted: "c:\eudora\attach\PIC09597.PCX"