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

RE: [amibroker] Create composite from average change



PureBytes Links

Trading Reference Links

So the scan to create the delta composite
//Make Index of my Watch List

xyz = "~dwatchlist"; //index 
abc = "~dwatchlistad"; //advance decline

stock=1;

Cadv = C>Ref(C,-1);
Cdec = C<Ref(C,-1);

Buy=0;
AddToComposite(H-Ref(H,-1),xyz,"H",1+2+4);
AddToComposite(L-Ref(L,-1),xyz,"L",1+2+4);
AddToComposite(O-Ref(O,-1),xyz,"O",1+2+4);
AddToComposite(C-Ref(C,-1),xyz,"C",1+2+4);
AddToComposite(V,xyz,"V",1+2+4);
AddToComposite(stock,xyz,"I",1+2+4);
AddToComposite(Cadv,abc,"H",1+2+4);
AddToComposite(Cdec,abc,"L",1+2+4);

Plotting this as straight data in candle chart gives me plot attached
DeltaOnly.gif
(I have reduced the plots to small size so that they are not large file
sizes, hope they are not too small to see.)

To make this into an index chart I have used this in IB
GraphXSpace = 2;
mycolor=IIf(C>O, colorBlue, IIf(C<O,colorRed,colorBlack));

Chart ="~dWatchList";

O = Cum( Foreign(Chart,"O",1) );
H = Cum( Foreign(Chart,"H",1) );
L = Cum( Foreign(Chart,"L",1) );
C = Cum( Foreign(Chart,"C",1) );
OI = Cum( Foreign(Chart,"I",1) );

Title =EncodeColor(LastValue(mycolor))+ Name()+ " " +Chart +" Composite
Chart  "+Date(); 

PlotOHLC(O, H, L, C, "Candle", colorBlack, styleCandle+styleNoLabel); 

The resultant chart is ok for some stocks, but not others as the foreign
plot only begins at the same date as the underlying chart date
The attachments CumPlot1 and CumPlot2 show how the same index plot varies
with different underlying stocks 

This variation occurs I think because the array values in the index data
file have to be manipulated and thus the first value at the first date will
change how the entire plot is created. I want to create the composite with
absolute array values without further manipulation in the IB window.

Hope this makes it clearer


Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia


-----Original Message-----
From: Graham [mailto:gkavanagh@xxxxxxxxxxxxx] 
Sent: Sunday, 24 August 2003 9:32 PM
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


------------------------ 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/ 

------------------------ 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/ 


Attachment:
DeltaOnly.gif
Description: GIF image
Attachment:
CumPlot2.gif
Description: GIF image

Attachment: Description: "Description: GIF image"

Attachment: Description: "CumPlot1.gif"

Attachment: Description: "Attachment:"