PureBytes Links
Trading Reference Links
|
This makes more sense.
For a single stock, the commulative product Z will be
Y=C/Ref(C,-1);
for(I=1;I<BarCount;I++)
{
Z[0]=100;
Z[I]=Z[I-1]*Y[I];
}
Plot(Z,"Z",1,1);
You may replace now Y with your composite array and see the
respective Z.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "nb9trade" <clyde@xxxx> wrote:
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS"
> <TSOKAKIS@xxxx> wrote:
> > Clyde,
> >
> > What did you do in EXCEL ?
> > The result you ask will be huge in a few bars.
> The following is an example of what I do in EXCEl.
>
> Column A
>
> is the price
>
> Column B
>
> The first value 100 is typed in. The rest of the secnd column is
> A2/A1 (filled down so the the calculation is repeated.
>
> Column C
>
> is (B2*B1) filled down so that column C.
> Actually Column C is a rate of change line in which the time frame
> gets extended 1 day upon each closing.
>
> I already have a column B, made with addtocomposite. I just need a
> way to make Column C.
>
> A B C
> 48.785 100
> 48.875 1.001844829 100.1844829
> 49.795 1.018823529 102.0703085
> 49.375 0.991565418 101.2093881
> 49.505 1.002632911 101.4758635
> 49.405 0.997980002 101.2708824
> 49.21 0.996053031 100.8711694
> 49.03 0.996342207 100.5022035
> 48.605 0.991331838 99.63103413
> 48.34 0.994547886 99.08783438
> 48.435 1.001965246 99.28256636
> 48.405 0.999380613 99.22107205
> 47.865 0.988844128 98.11417444
> 47.405 0.990389638 97.17126166
> 47.7 1.006222972 97.77595572
> 48.34 1.013417191 99.08783438
> 48.26 0.998345056 98.92384954
> 47.625 0.986842105 97.62221994
> 48.185 1.01175853 98.77011376
>
> Thanks
>
> Clyde
>
> > For CSCO with starting date the Jan3, 2000, in 50 bars will be
> > 6,102,672,859,987,968 , or 6*10^15
> > and, in 80 bars it will be 291*10^27.
> > What was the upper limit for EXCEL calculations?
> > For amibroker it should not be higher than 10^40 [or something
> like
> > that]
> > Anyway, the calculation for a single stock is
> >
> > Y=ROC(C,1);
> > for(I=1;I<BarCount;I++)
> > {
> > Z[0]=100;
> > Z[I]=Z[I-1]*Y[I];
> > }
> > Plot(Z,"Z",1,1);
> >
> > For a group of stocks the average ROC may easily calculated via
> > AddToComposite() function, but...
> >
> > Dimitris Tsokakis
> > --- In amibroker@xxxxxxxxxxxxxxx, "nb9trade" <clyde@xxxx> wrote:
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx>
> wrote:
> > >
> > > What I want to do is multiply a sequence of numbers.
> > > like A1*a2*a3*a4..........
> > >
> > > What I am trying to do is
> > >
> > > 1. Find average % change for a group of stocks for each day. (I
> > have
> > > done that).
> > > 2. Start with a value like 100 and then multiply the first %
> change
> > > value by 100, then multiply that number by the next % change
> value
> > > in sequence and so on.
> > >
> > > I used to do this when I did everything with EXCEL. It makes a
> > > valuable indicator because it makes an unweighted index on a
> group
> > > of stocks which can be plotted against the weighted index. e.g.
> S&P
> > > 500.
> > >
> > > Clyde
> > >
> > >
> > >
> > > > Clyde,
> > > > you can Cum() anything...
> > > >
> > > > you can also sum() anything over a set period of bars
> > > >
> > > > Regards,
> > > > Jayson
> > > > -----Original Message-----
> > > > From: nb9trade [mailto:clyde@x...]
> > > > Sent: Tuesday, March 30, 2004 11:49 AM
> > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > Subject: [amibroker] AFL Code Question
> > > >
> > > >
> > > > Is there a built in function for finding a cumulative product,
> > > > similar to the CUM() functionsthat is used for cumulative
sums?
> > > >
> > > > I didn't see one.
> > > >
> > > > If not is there a way to do it?
> > > >
> > > > Clyde
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Send BUG REPORTS to bugs@xxxx
> > > > Send SUGGESTIONS to suggest@xxxx
> > > > -----------------------------------------
> > > > 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
> > > >
> > > > a.. To visit your group on the web, go to:
> > > > http://groups.yahoo.com/group/amibroker/
> > > >
> > > > b.. To unsubscribe from this group, send an email to:
> > > > amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > > >
> > > > c.. Your use of Yahoo! Groups is subject to the Yahoo!
Terms
> of
> > > Service.
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/
|