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

[EquisMetaStock Group] Re: Gil Raff exploration



PureBytes Links

Trading Reference Links


> What is the return value from "Cum(IsDefined(condition))=1;"

This is the initialization bar, or the first occurrence of a valid or 
"defined" Data Array.  The Init signal is very useful for removing any 
subsequent null periods introduced by BarsSince(), ValueWhen() and 
other MetaStock functions.


jose '-)
http://www.metastocktools.com



--- In equismetastock@xxxxxxxxxxxxxxx, "v" <entinv@xxxx> wrote:
> Jose,
> 
> Using code for the null bar removal that you've posted sometimes
> back I've fixed the problem.
> Thank you very much.
> 
> The code works but I don't fully understand it. Here it is:
> 
> ================
> Null bar removal
> ================
> ---8<--------------------
> { Removes Null periods from condition,
>   but not from indicator }
> 
> condition:=Cross(RSI(14),25);
> ISNA:=IsUndefined(BarsSince(condition));
> Init:=Cum(IsDefined(condition))=1;
> 
> If(ISNA,0,BarsSince(condition OR Init))
> 
> ---8<--------------------
>
> What is the return value from "Cum(IsDefined(condition))=1;"
> if condition defined? , if undefined?
> 
> 
> Vladimir
> -----Original Message-----
> From: equismetastock@xxxxxxxxxxxxxxx
> [mailto:equismetastock@xxxxxxxxxxxxxxx]On Behalf Of Jose Silva
> Sent: Tuesday, April 26, 2005 9:22 AM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: [EquisMetaStock Group] Re: Gil Raff exploration
> 
> Vladia, unfortunately once a null (N/A) period is introduced in
> MetaStock code, no amount of If() statements will make it go away.
> 
> Try removing as much of the null period as you can from the source
> of your code.  The BarsSince() is the culprit there.
> 
> 
> jose '-)
> http://www.metastocktools.com
> 
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "v" <entinv@xxxx> wrote:
>
> Last line of this exploration produces N/A rejection in those
> securities where "condition1" is undefined.  That is what I've
> expected to avoid by using "IsUndefined".
>
> I'd appreciate if anybody can point out a problem.
>
>
> {ColB}
> condition:=Cross(0.955*Ref(C,-2),C);
> ISNA:=IsUndefined(condition);
> condition1:=Ref(Cross(0.955*Ref(C,-2),C),-1);
> ISNA1:=IsUndefined(condition1);
>
> If(ISNA,10000,BarsSince(condition AND
> BarsSince(((MACD()>Mov(MACD(),9,E) AND
> C>Mov(C,5,E) AND
> C>Mov(C,15,E))=TRUE) AND
> (Ref(MACD()>Mov(MACD(),9,E) AND
> C>Mov(C,5,E)AND
> C>Mov(C,15,E),-1)=FALSE))
> <=If(ISNA1,10000,BarsSince(condition1))))
>
>
> Thanks,
>   Vladimir






------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/