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

[amibroker] Re: How can AddToComposite generate Null values?



PureBytes Links

Trading Reference Links

Thanks for weighing in Tomasz. Meanwhile I described in more detail 
why your suggestion would not work in this case:

http://finance.groups.yahoo.com/group/amibroker/message/92677  

While I work on other workarounds, may I suggest enhancing 
AddToComposite just a bit by letting the very specific formula 

AddToComposite( Null, .....

or

AddToComposite( IIf(condition, ..., Null), .....

indeed generate an empty value.  

As you write, then one Null on one symbol would invalidate entire 
addition, but ONLY if we explicitly use the "Null" command in the 
ATC Formula.

That would create a simple solution to the, admittedly unusual, 
challenge I described. 

If possible, thanks in advance for considering.

-treliff

--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
>
> Hello,
> 
> In short you can't. 
> 
> This is so because AddToComposite by design
> is ADDING values. Null values on the other hand are 'special'
> and adding null to any non-null value should give null anyway.
> This is against composite nature of addtocomposite 
> (one null on one symbol would invalidate entire addition).
> 
> If you need "fixup" candidates, why don't you make fixup by 
yourself:
> 
> value = ...something
> 
> AddToComposite( ValueWhen( DayOfWeek() != 5, 
value ) , "fixuptest" , "X");
> 
> This will give an array that is filled with values defined by you 
except
> of fridays which will held the value from thursday.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "treliff" <treliff@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, January 23, 2006 1:32 AM
> Subject: [amibroker] Re: How can AddToComposite generate Null 
values?
> 
> 
> > Thanks Graham, but that doesn't work. When I use 0 (zero) then 
ATC 
> > creates zero value as expected, but I need it to create empty 
(Null) 
> > value.  
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> 
wrote:
> >>
> >> use 0 instead of null
> >> 
> >> 
> >> --
> >> Cheers
> >> Graham
> >> AB-Write >< Professional AFL Writing Service
> >> Yes, I write AFL code to your requirements
> >> http://e-wire.net.au/~eb_kavan/ab_write.htm
> >> 
> >> 
> >> On 1/23/06, treliff <treliff@xxxx> wrote:
> >> > When I run a dummy-scan like
> >> >
> >> > AddToComposite( IIf( DayOfWeek() == 5, Null, 
> > 1) , "~nulltest" , "X");
> >> >
> >> > this results in Friday's values zero (instead of Null or 
> > {empty} ).
> >> >
> >> > Point is I need my ATC to generate values that will be 
recognized 
> > by
> >> > Foreign function as "fixup candidates".
> >> >
> >> > I have tried instead
> >> >
> >> > AddToComposite( IIf( DayOfWeek() == 5, 1/0, 
> > 1) , "~nulltest" , "X");
> >> >
> >> > and this generates Infiniti values:
> >> >
> >> > 1.#INF
> >> >
> >> > however it seems these are not considered for Foreign fixup.
> >> >
> >> > Any advice will be gratefully received. TIA.
> >> >
> >> > -treliff
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > Please note that this group is for discussion between users 
only.
> >> >
> >> > To get support from AmiBroker please send an e-mail directly to
> >> > SUPPORT {at} amibroker.com
> >> >
> >> > For other support material please check also:
> >> > http://www.amibroker.com/support.html
> >> >
> >> >
> >> > Yahoo! Groups Links
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Please note that this group is for discussion between users only.
> > 
> > To get support from AmiBroker please send an e-mail directly to 
> > SUPPORT {at} amibroker.com
> > 
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> > 
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

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

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