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

RE: [amibroker] Re: Any way to use more field codes for composite indexes?



PureBytes Links

Trading Reference Links




<FONT face="Courier New" 
color=#000000 size=3>AddToComposite(<FONT 
color=#ff0000>scCMO(O,Pd)/n,<FONT 
color=#0000ff>"~MCMO"+<FONT 
color=#ff00ff>WriteVal(Pd,1.0),"X"); 
Pd=Pd+1;
<FONT face="Courier New" 
color=#000000 size=3> 
<FONT face="Courier New" 
color=#000000 size=3>The Red part is simply the 
data you want to add to the composite each time the Scan processes a new stock. 
It was just copied from some code and you will want to substitute your own data 
here. To create a simple price composite you might want to substitute Close 
here.
<FONT face="Courier New" 
color=#000000 size=3><SPAN 
class=680051013-26022003> 
<FONT face="Courier New" 
color=#000000 size=3>The Blue part is the 
"base-name" for your composite; all your composites will share this part, i.e. 
start with "~MCMO"
<FONT face="Courier New" 
color=#000000 size=3><SPAN 
class=680051013-26022003> 
<FONT face="Courier New" 
color=#000000 size=3>The purple part is your 
"dynamic naming" part; "WriteVal() will convert a number to a string so that it 
can be attached to the base name with a "+" sign. You cannot attach numbers 
directly to strings. Pd is a number that you want to append to the composite 
bas-name to create different names. Pd can simple be 1,2,3,... or any real 
optimization parameter you are using, like 1.2, 1.2, 1.3, .... The "1.0" 
argument tells the WriteVal() to only return the Integer part, so nothing from 
behind the decimal point will be attached to the name. If you used 1.2 
WriteVal() would attach number with two digits behind the decimal point. Like 
1.34.
<FONT face="Courier New" 
color=#000000 size=3><SPAN 
class=680051013-26022003> 
<FONT face="Courier New" 
color=#000000 size=3>The black 
"X" Tells the addtocomposite that all fields will contain the 
same price: O=H=L=C.
<FONT face="Courier New" 
color=#000000 size=3><SPAN 
class=680051013-26022003> 
<FONT face="Courier New" 
color=#000000 size=3>Pd=Pd+1 increments the Pd 
counter so that the next name will be 
diffierent. 
<FONT face="Courier New" 
color=#000000 size=3><SPAN 
class=680051013-26022003> 
<FONT face="Courier New" 
color=#000000 size=3>Good 
luck.
<FONT face="Courier New" 
color=#000000 size=3>h
<FONT face="Courier New" 
color=#000000 size=3><FONT 
face=Arial color=#0000ff size=2> 

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: ujr4s 
  <ujr4s@xxxxxxxxx> [mailto:ujr4s@xxxxxxxxx]Sent: Tuesday, 
  February 25, 2003 9:51 PMTo: 
  amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: Any way to use 
  more field codes for composite indexes?Way to go, 
  Hermann, but I still have to work through your idea myself before knowing 
  exactly what dynamic naming means.  Still much to learn, but I'm glad 
  I'm making progress. Cheers,KC>   
  -----Original Message----->   From: Herman van den Bergen 
  [mailto:psytek@xxxx]>   Sent: Tuesday, February 25, 2003 7:36 
  PM>   To: amibroker@xxxxxxxxxxxxxxx>   
  Subject: RE: [amibroker] Re: Any way to use more field codes for 
  composite> indexes?> > >   You also 
  use dynamic naming, i do that often when i want to test a large> 
  number of composites for different periods. Save a lot of code 
  writing...> Like so:> >   Pd = 
  2;>   
  //AddToComposite(1,"~MCMOCount","X");>   n = 
  Foreign("~MCMOCount","X");>   
  AddToComposite(scCMO(O,Pd)/n,"~MCMO"+WriteVal(Pd,1.0),"X"); 
  Pd=Pd+1;>   
  AddToComposite(scCMO(O,Pd)/n,"~MCMO"+WriteVal(Pd,1.0),"X"); 
  Pd=Pd+1;>   
  AddToComposite(scCMO(O,Pd)/n,"~MCMO"+WriteVal(Pd,1.0),"X"); 
  Pd=Pd+1;>   
  AddToComposite(scCMO(O,Pd)/n,"~MCMO"+WriteVal(Pd,1.0),"X"); 
  Pd=Pd+1;>   // .... copy-n-past as many lines as you 
  like, each line will create an> additional composite, each 
  composite-name will have an incrementing number> appended to its 
  name.> > >   Herman> 
  >   -----Original Message----->   From: 
  Graham [mailto:gkavanag@xxxx]>   Sent: Tuesday, February 25, 
  2003 4:17 PM>   To: 
  amibroker@xxxxxxxxxxxxxxx>   Subject: RE: [amibroker] Re: Any 
  way to use more field codes for composite> indexes?> 
  > >   OK some characters would not advisable, but 
  could you not use>   "COMPOSITE"+name() as an 
  example?> >   Cheers,>   
  Graham>   <A 
  href="">http://groups.msn.com/ASXShareTrading>   
  <A 
  href="">http://groups.msn.com/FMSAustralia> 
  >   -----Original Message----->   From: John 
  R [mailto:johnr@xxxx]>   Sent: Wednesday, 26 February 2003 
  7:30 AM>   To: amibroker@xxxxxxxxxxxxxxx>   
  Subject: Re: [amibroker] Re: Any way to use more field codes 
  for>   composite indexes?> >   
  Herman> >   Interesting  - underscore is usually 
  down the end of ASCII collation>   
  order.>   Do you know if there any other characters which do 
  not have the expected>   position in ASCII collating 
  sequence?> >   John> >   ----- 
  Original Message ----->   From: "Herman van den Bergen" 
  <psytek@xxxx>>   To: 
  <amibroker@xxxxxxxxxxxxxxx>>   Sent: Wednesday, 
  February 26, 2003 2:30 AM>   Subject: RE: [amibroker] Re: Any 
  way to use more field codes for>   
  composite>   indexes?> > >   
  > It is recommended that you use only "~" as the first character 
  for>   your>   > composite (see AB 
  Help), a long time ago I got into all kinds of>   
  trouble>   > using an Underscore.>   
  >>   > I quote Tomasz: "You should use tilde ~ as a 
  first character of your>   > composites. Using 
  underscore ( _ ) is not recommended. Why?>   > Symbols 
  beginning with underscore are put at the start of the 
  symbol>   list>   > this causes that 
  during first scan the first symbol is counted twice.">   
  >>   > Herman>   >   
  -----Original Message----->   >   From: Graham 
  [mailto:gkavanag@xxxx]>   >   Sent: Tuesday, 
  February 25, 2003 3:05 PM>   >   To: 
  amibroker@xxxxxxxxxxxxxxx>   >   Subject: RE: 
  [amibroker] Re: Any way to use more field codes for>   
  composite>   > indexes?>   
  >>   >>   >   The "`" is 
  purely an easy way to identify the composites in the>   
  symbol>   >   tree and so that you do not 
  overwrite an existing symbol. You can>   
  use>   >   anything, or nothing as far as I 
  know.>   >>   >   
  Cheers,>   >   Graham>   
  >   <A 
  href="">http://groups.msn.com/ASXShareTrading>   
  >   <A 
  href="">http://groups.msn.com/FMSAustralia>   
  >>   >   -----Original 
  Message----->   >   From: ujr4s 
  <ujr4s@xxxx> [mailto:ujr4s@xxxx]>   >   
  Sent: Wednesday, 26 February 2003 6:56 AM>   >   
  To: amibroker@xxxxxxxxxxxxxxx>   >   Subject: 
  [amibroker] Re: Any way to use more field codes for>   
  composite>   >   indexes?>   
  >>   >     I thought there is 
  something special about "~".  I'll try "~X" to>   
  >   see if that works.  Thanks.>   
  >>   >   KC>   
  >>   >>   >>   
  >   --- In amibroker@xxxxxxxxxxxxxxx, "Graham" 
  <gkavanag@xxxx> wrote:>   >   > 
  KC>   >   > Not certain exactly what you want 
  to create, but why not just add>   >   > 
  another letter or something to the name>   >   
  > ASectCount= "~X" + "SectorID(1);>   >   
  >>   >   >>   
  >   > Cheers,>   >   > 
  Graham>   >   > <A 
  href="">http://groups.msn.com/ASXShareTrading>   
  >   > <A 
  href="">http://groups.msn.com/FMSAustralia>   
  >   >>   >   > -----Original 
  Message----->   >   > From: ujr4s 
  <ujr4s@xxxx> [mailto:ujr4s@xxxx]>   >   
  > Sent: Wednesday, 26 February 2003 6:29 AM>   
  >   > To: amibroker@xxxxxxxxxxxxxxx>   
  >   > Subject: [amibroker] Re: Any way to use more field codes 
  for>   >   composite>   
  >   > indexes?>   >   
  >>   >   >>   
  >   > Thanks Graham, as always.  But I need further help 
  with this.>   >   > Exactly how do I 
  create a separate sector composite, since I'm>   
  >   using>   >   > SectorID(1) 
  to automatically generate composite indexes in all>   
  >   > sectors?>   >   
  >>   >   >>   
  >   > AllSectCount= "~" + "SectorID(1);>   
  >   >>   >   > 
  Ab20MA=C>MA(20, C);>   >   > Ab50MA, 
  etc.....>   >   >>   
  >   > AddtoComposite(Ab20MA, 
  AllSectCount,"O");>   >   > 
  AddtoComposite(Ab50MA, AllSectCount,"H");>   >   
  > etc.....>   >   >>   
  >   > It seems to me that whatever I do, it will automatically 
  assign to>   >   > the same sector 
  indexes.  And once I use up these six field 
  codes,>   >   > then I'm out of 
  luck.  Of course, if I create composites for each>   
  >   of>   >   > these sectors 
  and then scan individually, then I should be OK.>   
  But>   >   > you are talking about 31 sectors 
  in the TC2K database!!>   >   
  >>   >   > Cheers,>   
  >   > KC>   >   
  >>   >   >>   
  >   >>   >   
  >>   >   >>   
  >   >>   >   
  >>   >   >>   
  >   >>   >   
  >>   >   >>   
  >   > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" 
  <gkavanag@xxxx> wrote:>   >   > 
  > Create more than one composite.>   >   > 
  > You only need to move to the composite the percent number 
  and>   >   > create a>   
  >   > > line chart, so you could get 6 in one 
  composite.>   >   > >>   
  >   > > Cheers,>   >   > 
  > Graham>   >   > > <A 
  href="">http://groups.msn.com/ASXShareTrading>   
  >   > > <A 
  href="">http://groups.msn.com/FMSAustralia>   
  >   > >>   >   > > 
  -----Original Message----->   >   > > 
  From: ujr4s <ujr4s@xxxx> [mailto:ujr4s@xxxx]>   
  >   > > Sent: Wednesday, 26 February 2003 5:40 
  AM>   >   > > To: 
  amibroker@xxxxxxxxxxxxxxx>   >   > > 
  Subject: [amibroker] Any way to use more field codes for>   
  composite>   >   > > 
  indexes?>   >   > >>   
  >   > > Hi, all,>   >   > 
  >>   >   > 
  >       Besides using OHLCVI, is there any 
  other way to store>   >   > > 
  information for composite indexes?   Say, I want to look at 
  the>   >   > > percentage of stocks 
  trading above 20, 50, and 200 day MAs, and>   
  >   so>   >   > > on... for 
  all sectors.  Since it easily uses up all six of 
  these>   >   > > field codes, is there any 
  way to work around that?>   >   > 
  >>   >   > > Thanks for 
  tips.>   >   > >>   
  >   > > KC>   >   > 
  >>   >   > >>   
  >   > >>   >   > 
  >>   >   > > Send BUG REPORTS to 
  bugs@xxxx>   >   > > Send SUGGESTIONS to 
  suggest@xxxx>   >   > > 
  ----------------------------------------->   >   
  > > Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   >   > > 
  (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  >   > > 
  -------------------------------------------->   
  >   > > Check group FAQ at:>   
  >   > > <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
  >   > >>   >   > > Your 
  use of Yahoo! Groups is subject to>   >   > 
  > <A 
  href="">http://docs.yahoo.com/info/terms/>   
  >   >>   >   
  >>   >   > Send BUG REPORTS to 
  bugs@xxxx>   >   > Send SUGGESTIONS to 
  suggest@xxxx>   >   > 
  ----------------------------------------->   >   
  > Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   >   > (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  >   > 
  -------------------------------------------->   
  >   > Check group FAQ at:>   >   
  > <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
  >   >>   >   > Your use of 
  Yahoo! Groups is subject to>   >   > <A 
  href="">http://docs.yahoo.com/info/terms/>   
  >>   >>   >   Send BUG 
  REPORTS to bugs@xxxx>   >   Send SUGGESTIONS to 
  suggest@xxxx>   >   
  ----------------------------------------->   >   
  Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   >   (Web page: 
  <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  >   
  -------------------------------------------->   
  >   Check group FAQ at:>   >   <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
  >>   >   Your use of Yahoo! Groups is subject 
  to>   >   <A 
  href="">http://docs.yahoo.com/info/terms/>   
  >>   >>   >>   
  >         Yahoo! Groups 
  Sponsor>   
  >               
  ADVERTISEMENT>   >>   
  >>   >>   >>   
  >   Send BUG REPORTS to bugs@xxxx>   
  >   Send SUGGESTIONS to suggest@xxxx>   
  >   ----------------------------------------->   
  >   Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   >   (Web page: 
  <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  >   
  -------------------------------------------->   
  >   Check group FAQ at:>   > <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
  >>   >   Your use of Yahoo! Groups is subject 
  to the Yahoo! Terms of Service.>   >> > 
  >   Send BUG REPORTS to bugs@xxxx>   Send 
  SUGGESTIONS to suggest@xxxx>   
  ----------------------------------------->   Post 
  AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  -------------------------------------------->   Check group 
  FAQ at:>   <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html> 
  >   Your use of Yahoo! Groups is subject 
  to>   <A 
  href="">http://docs.yahoo.com/info/terms/> 
  > > >   Yahoo! Groups 
  Sponsor>   ADVERTISEMENT> > > > 
  >   Send BUG REPORTS to bugs@xxxx>   Send 
  SUGGESTIONS to suggest@xxxx>   
  ----------------------------------------->   Post 
  AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  -------------------------------------------->   Check group 
  FAQ at:> <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html> 
  >   Your use of Yahoo! Groups is subject to the Yahoo! Terms 
  of Service.> > 
  >         Yahoo! Groups 
  Sponsor>               
  ADVERTISEMENT> > > > >   Send BUG 
  REPORTS to bugs@xxxx>   Send SUGGESTIONS to 
  suggest@xxxx>   
  ----------------------------------------->   Post 
  AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  -------------------------------------------->   Check group 
  FAQ at:> <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html> 
  >   Your use of Yahoo! Groups is subject to the Yahoo! Terms 
  of Service.Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT  









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 the Yahoo! Terms of Service.