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

[amibroker] Re: Variable Inputs [again...]



PureBytes Links

Trading Reference Links

Tomasz,
Now you may see the question :
at the end of the code 
http://groups.yahoo.com/group/amibroker/message/49749
I have the D [the ordinal #] array for the whole test period.
It would be convenient to have the respective stock Name in the 
title, for easier reference.
My attempt to use StrExtract(list,D) failed.
Is there any solution ?
TIA
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Tomasz,
> I didn't speak for variable period but for variable item in the 
> function StrExtract( list, item ) .
> In
> 
> y=StrExtract( "AAPL,INTC,MSFT", 2);
> Title=y;
> 
> the title of the IB window is MSFT.
> In
> 
> n=IIf(Cum(1)<200,1,2); 
> y=StrExtract( "AAPL,INTC,MSFT", n);
> Title=y;
> 
> where n is variable, I was expecting a title INTC for the first 200 
> bars and MSFT for the rest.
> In this sense StrExtract() does not accept variable n [although n 
is 
> an integer 0<=n<=2].
> 
> The problem appears when, at the end of the code, I know the 
function 
> of D, the ordinal # of a stock in a Group and I want to see the 
name 
> of the stock . In my Group254 I have 101 stocks and the respective 
> ordinal # 0 to 100.
> I know, for example,  that D=47 till 1/1/2001, D=56 till 1/1/2002 
and 
> D=93 for the rest of the available data.
> In other words D is an array with every D[i] in the 0,100 range.
> At this point, I tried [unsucessfully] to use StrExtract( list, D) 
to 
> see the name of the stock written on the title of the pane.[A title 
> like "The Highest Equity stock from...to...was ORCL." What I can 
have 
> now is  "The Highest Equity stock from...to...was # 47." ]
> I hope it is more clear now...
> [In AA there is a solution through 
> Status("STOCKNUM")==D 
> condition, since all stocks are selected. It can not be applied in 
> IB, because Status("STOCKNUM") is always 0, as it should be when we 
> select one, single, ticker from the symbol tree]
> Dimitris Tsokakis
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" 
<amibroker@xxxx> 
> wrote:
> > Dimitris,
> > 
> > Sorry but I don't understand your question.
> > 
> > StrExtract is a function that operates on single STRING
> > not on arrays/numbers. 
> > 
> > StrExtract( fullstring, nth)
> > 
> > nth substring (comma separated) from fullstring.
> > 
> > There is no 'variable period' because no periods are ever 
> considered.
> > 
> > fullstring looks like this:
> > 
> > "AAPL,INTC,MSFT"
> > 
> > and when you call
> > StrExtract( "AAPL,INTC,MSFT", 1 )
> > 
> > it will return "INTC"
> > 
> > the nth is an index (single number) to comma-separated substring.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Tuesday, October 14, 2003 3:01 PM
> > Subject: [amibroker] Variable Inputs [again...]
> > 
> > 
> > > Tomasz,
> > > I have almost created the Inspection Points Equity check for 
the 
> > > whole database.
> > > At the end of the IB code I have a difficulty because
> > > StrExtract( list, item ) 
> > > does not accept variable item.
> > > The most profitable item is #72 for 6 months, #4 for the next 4 
> > > months etc.
> > > I know [out of the loop] the function
> > > item=D
> > > and D is integer, but StrExtract( list, item ) stops the code.
> > > Any tip to overcome this ?
> > > [In AA there is no problem, Status("STOCKNUM") varies from 0 to 
> 100 
> > > and can do the job]
> > > TIA
> > > Dimitris Tsokakis
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > 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/mOAaAA/3exGAA/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/