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

[amibroker] Re: How to display "ALIAS" in ewxploration



PureBytes Links

Trading Reference Links

Ok, here is the working code. It would be appreciated if someone with  more OLE experience could look at it to check if everything is correct.

According to Broker.chm Help File (Change Log) from ver. 4.67.0 "AFL supports setting/getting properties in usual (brace-less) way". That's why in the code I used:

fn_ = Stock.FullName;
al_ = Stock.Alias;

instead of:

fn_ = Stock.FullName();
al_ = Stock.Alias();

Is this correct?

Here is the complete code:

/************************************/
// Show FullName & Alias In AA Exploration

Filter = 1;

AB = CreateObject("Broker.Application");
Stocks = AB.Stocks(); // get collection
Stock = Stocks.Item( Name() ); // currently selected

fn_ = Stock.FullName;
al_ = Stock.Alias;

AddTextColumn(fn_, "FullName");
AddTextColumn(al_, "Alias");
/************************************/

Lesmond

--- In amibroker@xxxxxxxxxxxxxxx, "Lesmond V" <ebsn247lsm@xxx> wrote:
>
> Steve, all this looks Greek to a non-programmer. Can you provide an example of a working code that you can save in an afl file in AA window and run by clicking Explore button. Just two columns with FullName and Alias will do.
> 
> Also, can you point to the link with all this lates OLE stuff, like DISPATCH_PROPERTYGET. 
> 
> I've tried the following code but obviously it doesn't work:
> 
> /***************************************/
> Filter = 1;
> 
> AB = CreateObject("Broker.Application");
> Stocks = AB.Stocks(); // get collection
> Stock = Stocks.Item( Name() ); // currently selected
> 
> "FullName : " + Stock.FullName();
> "Alias : " + Stock.Alias();
> 
> AddTextColumn(FullName(), "FullName");
> AddTextColumn(Alias(), "Alias");
> /***************************************/
> 
> Thanks,
> Lesmond
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@> wrote:
> >
> > From the help file:
> > 
> > + OLE properties can be retrieved (DISPATCH_PROPERTYGET) directly from AFL 
> > now using parameterless function syntax. This allows reading values exposed 
> > by OLE automation directly from AFL code. Example:
> > 
> > AB = CreateObject("Broker.Application");
> > Stocks = AB.Stocks(); // get collection
> > Stock = Stocks.Item( Name() ); // currently selected
> > 
> > "FullName : " + Stock.FullName();
> > "Alias : " + Stock.Alias();
> > "Address : " + Stock.Address();
> > "Shares: " + Stock.Issue();
> > "Book value: " + Stock.BookValue();
> > "Market : " + Stock.MarketID();
> > "WebID : " + Stock.WebID();
> > 
> > You can check if OLE object is valid by calling IsNull() function, example:
> > 
> > AB = CreateObject("Broker.Application");
> > Stocks = AB.Stocks(); // get collection
> > Stock = Stocks.Item( "INTC" );
> > 
> > if( IsNull( Stock ) )
> > {
> >   printf("COM object invalid (Null) - symbol does not exist\n");
> > }
> > else
> > {
> >   printf("COM object valid - you can access its methods\n");
> > }
> > 
> > ----- Original Message ----- 
> > From: "mrmurty" <mrmurty@>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Wednesday, February 22, 2006 7:56 PM
> > Subject: [amibroker] How to display "ALIAS" in ewxploration
> > 
> > 
> > > Hi
> > >
> > > I want to  display alias in my exploration, columns.
> > > I tried as follows:
> > >
> > > AddTextColumn(name(),"alias",1);
> > >
> > > but it is showing ticker only.
> > >
> > > Can any one tellme ?
> > >
> > > rgds
> > > murty






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/