PureBytes Links
Trading Reference Links
|
Gordon,
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 Links
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
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/
|