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

Re: What to do if data is insufficient for a particular function



PureBytes Links

Trading Reference Links

hi from australia shasi
this is from stock central -
http://www.stockcentral.com.au/cgi-bin/forum/scf.cgi?action=intro&BypassCookie=true

{©Copyright 2001 Jose Silva}
{cola-A+%NEW}(C/LastValue(Ref(C,-(LastValue(Cum(1))-1)))-1)*100

{colB-$ t/over}Int(WC()*V)

{colC-months}Int(LastValue(Cum(1)/21))

{colD-days}Int(LastValue(Cum(1)))-Int(LastValue(Cum(1)/21))*21

hi from australia shasi
this is from stock central -
http://www.stockcentral.com.au/cgi-bin/forum/scf.cgi?action=intro&BypassCookie=true

{©Copyright 2001 Jose Silva}

{colE-1STValue}x:=C; {or any other valid data array}

FirstValue:=LastValue(Ref(x,-(LastValue(Cum(1))-1)));
FirstValue

{FilterFormula}Cum(1) < 252
AND colA > 0
AND colB > 10000

another good site for meta formulae is-

http://www.guppytraders.com/index.html
rgdzjimt.

Shashi Aggarwal wrote:

> 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
> ============================================================================
> ==================================