PureBytes Links
Trading Reference Links
|
Hi Bill
I had the same problem and used the following approach:
AB=CreateObject ("Broker.Application");
Fn1=ParamStr( "Fund1", "VIGRX");
Fn2=ParamStr( "Fund2", "VIVAX");
Fn3=ParamStr( "Fund3", "VISGX");
Fn4=ParamStr( "Fund4", "VISVX");
Fn5=ParamStr( "Fund5", "VGHCX");
Fa1=Foreign(Fn1,"C");
Fa2=Foreign(Fn2,"C");
Fa3=Foreign(Fn3,"C");
Fa4=Foreign(Fn4,"C");
Fa5=Foreign(Fn5,"C");
stk = AB.Stocks(fN1); ft1 = stk.fullname;
stk = AB.Stocks(fN2); ft2 = stk.fullname;
stk = AB.Stocks(fN3); ft3 = stk.fullname;
stk = AB.Stocks(fN4); ft4 = stk.fullname;
stk = AB.Stocks(fN5); ft5 = stk.fullname;
then use fn1 and ft1 in your title.
Caution: Make sure Fn1, etc points to a valid security
otherwise the AB.Stocks(fN1) will produce an error. I
simply checked fa1 > 0 so the name lookup line was
if (LastValue(Foreign(fn1,"C"))>0. ) stk = AB.Stocks(fN1); ft1 =
stk.fullname;
Bob Krishfield
--- In amibroker@xxxxxxxxxxxxxxx, "billbarack" <wbarack@xxx> wrote:
>
> Gordon and Bill,
>
> Thanks for the input, but it doesn't quite get me to where I want to
> be. The issue is that I have to type in the XAO in your example
> Gordon. Instead, I want to use a variable in my code, say Fn2, that
> defines the Foreign symbol.
>
> Fn2=Foreign("TWM","C");
>
> Then, I want to pick up on the Fn2 somehow and use its symbol and
> name in the title.
>
> This leads to being able to also do Fn3, Fn4, etc. in the same title.
>
> This will let me do my Foreign definitions once in the code
> (avoiding possible mistakes from having to put the symbols in
> twice), do my calculations and have the Title statement
> automatically pick up the various Foreign information.
>
> Any further ideas???
>
> Thanks,
>
> Bill
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Gordon Sutherland" <gosuth@>
> wrote:
> >
> > Hello Bill,
> >
> > The following example works for me:
> >
> > SetForeign("XAO");
> > Sym = Name();
> > FName = FullName();
> > RestorePriceArrays();
> > Plot(C,"",-1,64);
> > Title = Sym + " " + FName;
> >
> > Regards,
> >
> > Gordon Sutherland
> >
> > -----Original Message-----
> > From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
> On Behalf
> > Of billbarack
> > Sent: Sunday, 29 July 2007 9:16 a.m.
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Foreign Symbol and Foreign "FullName"
> >
> > I would like to include the Symbol and its FullName for a Foreign
> > defined security in a custom Title statement. Having failed to
> find a
> > way to do this via the Help files and some trial and error, does
> > anyone know of a way to accomplish this?
> >
> > To be more specific, consider the following:
> >
> > Fn2=Foreign("TWM","C");
> >
> > I would like the title to include the symbol "TWM" and its
> > name "UltraShort Russell2000".
> >
> > I don't want to hard code it in but have the title change when I
> > change the Fn2 statement above.
> >
> > Thanks,
> >
> > Bill
> >
> >
> >
> > 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> > Yahoo! Groups Links
> >
>
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|