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

Re: [amibroker] Re: TD Lines ---- ERROR



PureBytes Links

Trading Reference Links

I think without holes the extract method reproduces the addcomp 
function
but an other problem comes with foreign function and the fixup ( 1 
default fills holes and zero not)

take 3 tickers , delete some data in one ticker and try to compare
SumCount= 
IIf(Foreign("AAPL", "c",0),1,0) +
IIf(Foreign("ADBE", "c",0),1,0) +
IIf(Foreign("ADCT", "c",0),1,0) ;


with 
//AddToComposite( 1, "~Count", "x");
Plot(Foreign( "~Count", "x"), "Count", colorRed );

stephane




> Stephane,
> since the extract method is inaccurate when holes exist, I wonder 
how 
> the method is accurate without holes. Is it coincidental ? I really 
> donīt know...
> I think Tomasz should give an explanation.
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Stephane Carrasset" 
> <nenapacwanfr@xxxx> wrote:
> > Dimitri,
> > 
> > There is a real problem with StrExtract function and everyone 
must 
> > take care of building composite with this function
> > I have created a WL with 3 tickers, on 1 ticker I removed 5 bars 
on 
> > recent data
> > and compared differents composite with the ex. below
> > only addtocomp is accurate...
> > sum of foreign (even with fixup=0) and strextract are inaccurate.
> > 
> > try it and cry !!!
> > 
> > 
> > SumCount= 
> > IIf(Foreign("12062", "c",0),1,0) +
> > IIf(Foreign("12101", "c",0),1,0) +
> > IIf(Foreign("13330", "c",0),1,0) ;
> > 
> > function Composite( listnum )
> > {
> > list = GetCategorySymbols( categoryWatchlist, listnum );
> > Average = 0;f=0;
> > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> > {
> > f = 1;
> > Average = Average + f;
> > }
> > return Average ;
> > }
> > 
> > Plot( Composite(2), "sum", colorPink );
> > //AddToComposite( 1, "~Count", "x");
> > Plot(Foreign( "~Count", "x"), "str", colorRed ); 
> > Plot(SumCount,"",colorWhite,1);
> > 
> > GraphXSpace=2;
> > 
> > 
> > wrote:
> > > Stephane,
> > > here is the ref on the subject.
> > > for any reply to
> > > http://groups.yahoo.com/group/amibroker/message/55943
> > > http://groups.yahoo.com/group/amibroker/message/55882
> > > http://groups.yahoo.com/group/amibroker/messages/56227
> > > Dimitris Tsokakis
> > > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> > <TSOKAKIS@xxxx> 
> > > wrote:
> > > > Stephane,
> > > > I have sent a message some time ago related to this behavior 
[I 
> > am 
> > > > far from the office now and I miss the reference]
> > > > The example you use does not work properly when the WL has 
some 
> > > holes.
> > > > I didn't know the reason and thats why I asked.
> > > > Dimitris Tsokakis
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "Stephane Carrasset" 
> > > > <nenapacwanfr@xxxx> wrote:
> > > > > Thanks my amibroker's friends.
> > > > > 
> > > > > Good to know that addto composite doe not filled data holes.
> > > > > I 'll begin to compare my composite.dll with 
> > > > > AddToComposite(1,"~count","X");
> > > > > that's a good starting point to know why there are 
sometimes 
> > > these 
> > > > > differences.
> > > > > 
> > > > > As we have written in the past messages the Afl functions 
> > > > > (GetCategorySymbols and  StrExtract ex. below) can return 
a  
> RT 
> > > > (real 
> > > > > time ) composite but the lenght of this RT composite is 
> reduced 
> > > to 
> > > > > the ticker with the smallest data history.
> > > > > 
> > > > > For an UNKNOWN reason if I call these functions ( 
> > > > GetCategorySymbols 
> > > > > and StrExtract ) in a plugin I can built a composite in RT 
> that 
> > > is 
> > > > > not reduced to  the smallest data history.
> > > > > 
> > > > > 
> > > > > function CompositeForWatchList( listnum ) 
> > > > > { 
> > > > > list = GetCategorySymbols( categoryWatchlist, listnum ); 
> > > > > Average = 0; 
> > > > > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ ) 
> > > > > {
> > > > > f = Foreign( sym, "C" ); 
> > > > > if( i == 0 ) Average = f; 
> > > > > else Average = Average + f; 
> > > > > } 
> > > > > return Average ; 
> > > > > } 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > > Stephane,
> > > > > > AddToComposite does not fill the holes. This is the 
reason 
> > why 
> > > we 
> > > > > see 
> > > > > > undesirable troughs in a "normal" composite graph.
> > > > > > Try the simplest
> > > > > > AddToComposite(1,"~count","v");
> > > > > > Buy=0;
> > > > > > in a small database [a WL with 2-3 stocks] with holes.
> > > > > > If the database has 3 stocks, the Foreign("~count","v") 
> will 
> > > not 
> > > > be 
> > > > > > equal to 3 for any bar.
> > > > > > Of course you will see the holes if you select a ticker 
> with 
> > > full 
> > > > > > data.
> > > > > > If you select the bad stock, then you will not see the 
> holes, 
> > > > since 
> > > > > > they just occur in the place of missing data !!
> > > > > > The addition of AddToComposite() is executed for all 
dates. 
> > If 
> > > > > Feb18 
> > > > > > is not a data day for stock XX, then it will not 
contribute 
> > to 
> > > > the 
> > > > > > final sum for this date.
> > > > > > A similar problem will occur if extra data are included 
by 
> > some 
> > > > > > mistake. Feb15, 2004 was not a trading bar but, if your 
> ASCII 
> > > > > series 
> > > > > > is XX,20040215,30,31,29,30,1000 it will be imported 
without 
> > > > problem 
> > > > > > and stay there until the delete operation.
> > > > > > Dimitris Tsokakis
> > > > > > --- In amibroker@xxxxxxxxxxxxxxx, "Stephane Carrasset" 
> > > > > > <nenapacwanfr@xxxx> wrote:
> > > > > > > Hello, Dimitri or Hermann or anyone
> > > > > > > 
> > > > > > > do you remember if the addto comp function fills the 
> holes 
> > in 
> > > > > case 
> > > > > > > of missing quotes?
> > > > > > > because i have some minors differences between my built 
> in 
> > > > > > composite 
> > > > > > > function in a dll and the addtocomp function?
> > > > > > > 
> > > > > > > Thanks in advance 
> > > > > > > 
> > > > > > > Stephane



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/