PureBytes Links
Trading Reference Links
|
It looks like you are trying to create a normalized composite (sarts at 1),
try this code (ignore the N100 reference):
Ch = ROC(C,1); // Your ROC to use in the composite
AddToComposite(Ch,"~Change","C"); // some the ROCs
AddToComposite(1,"~Change","V"); // Count the number of stock you are
averaging
N100Change = Foreign("~Change","C")/Foreign("~Change","V");
SecondBar = Ref(Status("FirstBarInTest"),-1);
N100Close=AMA2(1,(SecondBar==1),(SecondBar==0)*(1 + 0.01*N100Change));
Plot(N100Close,"N100CloseRec",2,1);
GraphXSpace = 5;
Buy=Sell=Short=Cover=0;
Good luck,
Herman.
-----Original Message-----
From: Graham [mailto:gkavanagh@xxxxxxxxxxxxx]
Sent: Sunday, August 24, 2003 9:32 AM
To: AB yahoo group
Subject: [amibroker] Create composite from average change
I am wanting to create a composite of a group of tickers by adding the
change of the price day to day
I have tried it the simple way of just
Addtocomposite(c-ref(c,-1), "~index", "C");
etc for OHLC
Addtocomposite(1, "~index", "I");
Then to create the chart by just using Foreign function then Cum(C)
But I found the resulting chart changed too much when I viewed it from each
stock on the list due to, I guess, the starting point varying according to
the base ticker I am viewing from
What I think I need to do is create a composite, then read in the values
from this composite to create a second composite which has definite arrays
that require no further modification to plot
But I am not certain how to do this in a single scan
A simplified procedure below, but I am not sure how to get it to work
Addtocomposite(c-ref(c,-1), "~base", "C");
-? - what can I do here ?
newC = Foreign("~base","c")
myC = cum(newC)
Addtocomposite(myC,"~index","C") etc
Any suggestions appreciated, or reference to another post made, as I cannot
find what I am looking for
I have simplified the formulae above as too lazy to fully type out
everything in the brackets or check if correct, it is the procedure I am
needing.
Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia
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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
------------------------ 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/l.m7sD/LIdGAA/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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|