PureBytes Links
Trading Reference Links
|
Thanks Michael, its late in the evening in
my part of the World so I will work on your code in the morning. If it saves me
the chore of manually setting up all the Sectors this will be great.
<span
>Regards,
<span
>
Gordon Sutherland
<span
>-----Original Message-----
From: Michael.S.G.
[mailto:OzFalcon@xxxxxxxxxx]
Sent: Tuesday, 22 June 2004 10:09
p.m.
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re:
StyleCandle with AddToComposite Indices Builder
<font size=3
face="Times New Roman">
<font size=2
face="Courier New">Gordon,<font
size=2 face="Courier New">
If you have the BaseIndex setup properly
for each stock, You may use this
code to create multiple sector indexes. (Composites).
// Create Sector Index Composites
//
// Setup:
//
Filter = Market/ASX
(Exclude Indexes)
//
Range
= n last quotes 1
//
Mode
= Scan
//
// Notes: Will
also create "All Ords" composite -
// eg. "~XAO~Index" composite.
//
procedure CI (IndexName)
{
vs = V / 1000; // Ensure V field
doesn't Overflow.
AddToComposite( O, IndexName,
"O",3);
AddToComposite( H, IndexName,
"H",3);
AddToComposite( L, IndexName,
"L",3);
AddToComposite( C, IndexName,
"C",3);
AddToComposite( vs, IndexName,
"V",3);
AddToComposite( 1, IndexName,
"IO",3 ); //Total counter
}
// Scan:
Buy = 1; // To Satisfy scan (Create Composite)
TickName = "~"+GetBaseIndex()+"~Index";
CI( TickName );
if (GetBaseIndex() != "XAO") {CI(
"~XAO~Index" );}
At 12:34 PM 22/06/2004, you wrote:
>Hi All,
>
>I am trying to create Group/Industry Indices,
having got to the stage where
>I have built my Sector Pyramid of Groups/Industries/Stocks
(big thanks to
>Graham for sending me his Australian GICS
breakout). Using AB Help, I have
>used the example code to create an Index of
the Aussie Energy Sector - this
>seems to work when plotted. However, I would
like to have my Indices
>plotting in Candlestick format using OHLC
(this may be possible but may not
>add much in due course but.). Is this possible
with AB? I have been used to
>this format in AIQ.
>
>This is what I have used so far and I am not
sure how to proceed to the
>Candlestick level:
>
>// Create Composite Indices
>// SYNTAX AddToComposite( array,
"ticker", "field", flags = atcFlagDefaults
>)
>
>/* AddToComposite statements are for Automatic
Analysis -> Scan */
>/* add Close price to our index OHLC fields */
>AddToComposite(O+H+L+C, "~S_Energy",
"X" );
>
>/* add one to open interest field (we use this
field as a counter) */
>AddToComposite( 1, "~S_Energy",
"I" );
>
>Buy = 0; // required by scan mode
>
>/* this part is for Indicator Builder */
>Graph0 = Foreign( "~S_Energy",
"C" )/Foreign( "~S_Energy", "I" );
>
>Regards,
>
>Gordon Sutherland
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|