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

What to do if data is insufficient for a particular function



PureBytes Links

Trading Reference Links

2nd post (no reply to first one). Hmmm...any thoughts, anyone?

============================================================================
==================================
I have various highlight functions that highlight a bar whenever it
satisfies a particular condition (e.g. 1 yr High, 2 yr High, etc.) However,
I have many stocks in my database that have less than the required amount of
data (recent IPOs) for which I get an error. I have tried using the
IsDefined and Cum(1) functions to resolve this, but have not been able to
create the correct formula that avoids the error.

Consider the following simple example of a Highlight function for a 1 year
High:

1yrHi:= If(H > Ref(HHV(H,252),-1),1,0);
If(1yrHi =1,1,0);

You will not get an error when you apply it to stocks that have > 1 yr of
data (e.g. IBM, CSCO, AMAT, etc.) Now apply this to the charts of 3 new
IPOs - WEG, SLMC and ULAB - and you will get an error ("Invalid time period
passed to the HHV function"). (NOTE: Any mention of stock symbols is
strictly for illustration purposes and is NOT a recommendation to buy or
sell!!!)

I tried these 2 workarounds but I still get the error:

1) 1yrHi:= If(H > Ref(HHV(H,252),-1),1,0);
If(IsDefined(1yrHi =1) =1,1,0);

2) 1yrHi:= If(H > Ref(HHV(H,252),-1),1,0);
If(Cum(1) > 252 AND 1yrHi =1,1,0);

This problem applies not just to Expert\Highlights but also to
Expert\Symbols and Explorations that have the 'offending' formula.

I had written to Equis but they were unable to help (their reply was: "There
is not a way for a formula to ignore lack of data.") Does anyone have a
workaround for this situation where the data is less than that required for
calculation of a particular function? Please test it out before posting to
the forum! Thanks.

Shashi
============================================================================
==================================