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

[amibroker] Re: Data Padding Question?



PureBytes Links

Trading Reference Links

Hi Tomasz - then there must be a problem that I cannot seem to 
identify somewhere else in my code. I am using the dow jones 30 as 
my reference symbol. I us QP data and have verified the symbol is 
correct (!DJ30) and I have checked the enable box. 

To state my problem again, I am using the code below (copied below) -
and when the stocks in the watchlist all have the same number of 
bars, everything works and my composite index is as expected...BUT 
if all symbols in the watchlist do not have equal number of bars, my 
composite calculation results in zero.
 
I have tried to debug my code using _TRACE feature but still cannot 
find the issue. This is when I thought to pursue the pre-padding 
concept, so as to make all symbols equal length. 

I am probably missing something obvious but have been staring at 
this for over a month and am stumped...

Your help is much appreciated.

Thanks,
Tom

-------------------Here is my code-------------------------------
    global j; // this is the number of stocks in the list
    global average_change;
    average_change = 0; // just in case tno watch list members

function Plot_Index(Listnum)
{    
	 list = CategoryGetSymbols( categoryWatchlist, Listnum ); 
//list = CategoryGetSymbols( categoryIndustry, Listnum );

    for( j = 0; ( sym = StrExtract( list, j ) ) != ""; j++ )
    {
       f = Foreign( sym, "C");
		av_perc_ch_temp = ((f-Ref(f,-1))/Ref(f,-1));
		average_change = average_change + av_perc_ch_temp;
    }

    average_change = average_change / j; // divide by # of stocks
    
    return average_change;  
 }

average_change = Plot_Index(0);

      for( i = 0;  i <= (BarCount -1); i++)
      {    
       if(i == 0) index[i] = 100;
       else index[i] = index[i-1] + (index[i-1] * average_change[i]);
      }

AddToComposite(index/j, "~My_composite_index" ,"C");

Buy = 0;

--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxx> 
wrote:
>
> Hello,
> 
> It works perfectly if only you use it as instructed (enabled check 
box and entered correct reference symbol
> that has all data you want to have in the padded series).
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "trb0428" <trbrowne@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Friday, March 10, 2006 5:38 PM
> Subject: [amibroker] Re: Data Padding Question?
> 
> 
> > Hi Tomasz - and not exactly. My original problem is stated in 
this 
> > post: 
> > 
> > http://finance.groups.yahoo.com/group/amibroker/message/94766
> > 
> > I am running a scan to calculate a composite index using ATC but 
> > turning padding on has not solved the problem which I state in 
my 
> > original post. 
> > 
> > I would appreciate your advice.
> > 
> > Thanks,
> > Tom
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@> 
> > wrote:
> >>
> >> Hello,
> >> 
> >> Are you asking for AA (scan/exploration/backtest). If so, then 
> > answer is yes,
> >> this feature is built-in: "Pad & align to reference symbol" in 
AA 
> > Settings.
> >> 
> >> Best regards,
> >> Tomasz Janeczko
> >> amibroker.com
> >> ----- Original Message ----- 
> >> From: "trb0428" <trbrowne@>
> >> To: <amibroker@xxxxxxxxxxxxxxx>
> >> Sent: Friday, March 10, 2006 3:35 PM
> >> Subject: [amibroker] Data Padding Question?
> >> 
> >> 
> >> > HI - Can AFL pre-pad a data array? For example, my 
understanding 
> > of 
> >> > padding is that it fills holes in any missing data by filling 
it 
> > in 
> >> > with the previous days value. In my application, I would like 
to 
> > be 
> >> > able to fill in data for days prior to the first day the 
stock 
> > traded 
> >> > back to a certain date. For example, if stock xyz began 
trading 
> > on 
> >> > 3/1/06 at $6, I would like to be able to show its close value 
as 
> > $6 
> >> > all the way back to some previous date, say 1/1/2002. Does 
> > anyone know 
> >> > if this is possible?
> >> > 
> >> > Thanks in advance,
> >> > Tom
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 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/