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

RE: [amibroker] Creating IM200 indices - JAYSON



PureBytes Links

Trading Reference Links




 
<SPAN 
class=678142113-24042003>Markus,
 
see 
answers below...
<SPAN 
class=678142113-24042003> 
Hello Jayson,
 
don´t ya worry!
 
You´ve already helped me a great 
deal in understanding the "basix" of Addtocomposite.
 
1./ somehow my indices have been stored in 
-->markets-->market253 AND group 253. While I 
understand the latter, I don´t understand the former. Is this a MUST?<FONT 
color=#0000ff><SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003>I think markets 253 is equivalent to All your stocks 
and tickers. I am not sure what you are doing but I tend to break that group 
into watch lists for testing and explorations. For instance you could create a 
watch list of Nas 100 stocks. This watchlist would contain stocks that reside in 
the new list AND market 253........ 
 
2./ I used the "x" option for the field code, 
figuring that would enable me to make a bar chart from it (since OHLC are 
updated). But this is NOT the case. I get only. No way to produce a bar chart as 
in HGS/QP2 from it?? I thought of generating 4 ATC´s (one for Open, one for High 
etc.) but how to bring those together in one index bar for each trading day 
:-((((<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003>Yes you may plot candles but think about what you were 
trying to do....
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003><FONT 
face=Arial> AddToComposite(<FONT 
color=#000000>C<FONT 
color=#282828>,sym,"X"<FONT 
color=#282828>);  would not this populate closing value through out all the 
fields? try......<FONT 
color=#0000ff>
<SPAN 
class=678142113-24042003> 
<FONT 
color=#0000ff> 
AddToComposite(<FONT 
color=#000000>C<FONT 
color=#282828>,sym,"C"<FONT 
color=#282828>);<FONT 
size=2>
AddToComposite(<FONT 
color=#000000>O<FONT 
color=#282828>,sym,"O"<FONT 
color=#282828>);<FONT 
size=2>
AddToComposite(<FONT 
color=#000000>H<FONT 
color=#282828>,sym,"H"<FONT 
color=#282828>);<FONT 
size=2>
AddToComposite(<FONT 
color=#000000>L<FONT 
color=#282828>,sym,"L"<FONT 
color=#282828>);<FONT 
face=Arial>
AddToComposite(<FONT 
color=#ff00ff>1,sym,<FONT 
color=#ff00ff>"V"<FONT face=Arial 
size=2>);<FONT 
color=#0000ff> 
<SPAN 
class=678142113-24042003> 
Plotting your ticker 
now will show the appropriate OHLC data.  Unfortunately if you have any 
holes in your data they may cause misleading candles. By dividing the values by 
the number of calculations in each composite you can smooth these errors. To 
plot this create a custom indicator
<SPAN 
class=678142113-24042003> 
 
C=<SPAN 
class=678142113-24042003> c /V<FONT 
color=#0000ff>;
O=<SPAN 
class=678142113-24042003> o /V<FONT 
color=#282828>;<FONT 
color=#0000ff>
H=<SPAN 
class=678142113-24042003> h /V<FONT 
color=#0000ff>;
L=<SPAN 
class=678142113-24042003> L /V<FONT 
color=#282828>;
 
Plot(<FONT 
color=#000000>C<FONT 
color=#282828>,"Sector Index"<FONT 
color=#282828>,<FONT 
color=#000000>colorWhite<FONT 
face=Arial>,<FONT 
color=#000000>styleCandle<FONT 
face=Arial size=2>);
 
or better yet..If 
you want to plot your index in the same chart as a component stock 
try........
 <FONT 
color=#0000ff>
sym="~"+SectorID(1<FONT 
color=#0000ff face=Arial>);<FONT 
color=#0000ff>
C=Foreign(sym,"C")/V<FONT 
color=#0000ff face=Arial>;<FONT 
size=2>
O=Foreign(sym,"o")/V<FONT 
color=#282828>;<FONT 
color=#000000>
H=Foreign(sym,"h")/V<FONT 
color=#0000ff face=Arial>;<FONT 
size=2>
L=Foreign(sym,"l")/V<FONT 
color=#282828>;
 
Plot(<FONT 
color=#000000>C<FONT 
color=#282828>,"Sector Index"<FONT 
color=#282828>,<FONT 
color=#000000>colorWhite<FONT 
face=Arial>,<FONT 
color=#000000>styleCandle<FONT 
size=2>);<SPAN 
class=678142113-24042003>    For separate window or add 
|styleownscale for the same window 
 
AB will determine 
what sector (or industry in your case) the stock belongs to then automatically 
plot the index for that stock. I use this approach daily to compare the stocks 
RSI and the sectors or the stocks momentum and the sectors or to measure the 
stocks correlation to the sectors etc
<SPAN 
class=678142113-24042003> 
<IMG align=baseline 
alt="" border=0 hspace=0 src="gif00250.gif">
<SPAN 
class=678142113-24042003>  
 
 
3./ It makes me wonder that the newly 
created indices (in our case the IM200´s) have to be updated EVERY day 
MANULY(running the scan). Is there no workaround for this (i.e. store the 
calculated day somewhere and onl update the LAST session as with regular stock 
data??).<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003>The calculations needed require a look at your whole 
universe. Just save your scan and run it... think of it as part 2 of your daily 
update. It take but a moment. IMO this feature alone is worth the price of 
admission to AB. I used to do all this work as a QP scan then export to excel, 
sort, calculate and import to metastock. If I missed a day I had to rewrite the 
scan to get yesterdays data etc, etc. With AB the composite is re-created each 
day so if I miss a day, no problem. If QP makes an adjustment, no 
problem. 
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003>I have one scan that creates all my sector composites, 
all my industry composites, and several market breadth composites. It takes my 
old P600 system about 2 minutes to do the work then AB even sends them to the 
appropriate watch list for further analysis. Super 
feature........
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003>Regards,
<SPAN 
class=678142113-24042003> 
<SPAN 
class=678142113-24042003>jayson 
 
Highly appreciate your help!!!!
 
Thanx
 
Markus
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A href="" 
  title=jcasavant@xxxxxxxxxxxx>Jayson 
  To: <A 
  href="" 
  title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, April 24, 2003 6:38 
  AM
  Subject: RE: [amibroker] Creating IM200 
  indices - JAYSON
  
  <SPAN 
  class=855470704-24042003>JMarkus,
  <SPAN 
  class=855470704-24042003> 
  I 
  have been gone most of the afternoon. Sorry to leave you hanging. Answers 
  below......
   Jayson 
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: <A 
  href="">funnybiz@xxxxxx 
  [mailto:funnybiz@xxxxxx]Sent: Wednesday, April 23, 2003 5:26 
  PMTo: <A 
  href="">amibroker@xxxxxxxxxxxxxxxSubject: 
  Re: [amibroker] Creating IM200 indices - JAYSON
  Anthony,thanks for stepping in here.If I 
  may:1./ does Jayson´s SYM variable refer to the array part of the 
  addtocompositefunction. If so, why is it not put in parenthesis (though 
  this results in anerror).<FONT 
  color=#0000ff face=Arial size=2> 
   
  <FONT 
  face=Arial>The line 
  <FONT 
  face=Arial> 
  <FONT 
  face=Arial>sym="~"+sectorid(1)  
  <FONT 
  face=Arial> 
  <FONT 
  face=Arial>looks at each stock you scan and places "~" + the sector ID for 
  that stock in its place. If, for instance the stock 
  resides in the Utilities Sector then AB notes this and returns sym= 
  "~Utilities". Addtocomposite grabs this shorthand and Therefore the next line 
  
  AddToComposite(<FONT 
  color=#000000>C<FONT 
  color=#282828>,sym ,"C"<FONT 
  color=#282828>); <SPAN 
  class=855470704-24042003>  becomes 
  addtocomposite(c,"~utilities","C"); 
  <SPAN 
  class=855470704-24042003>This is repeated for each stock scanned. 
  addtocomposite then simply looks to the stocks sectorid and places the data in 
  the appropriate 
ticker
  2./ sym="~"+SectorID(1);// this does sectors for industry groups 
  useindustryid(0)I don´t understand Jayson´s remark here: WHICH stocks 
  does that include? Iwant to include all stocks belonging to the same of 
  the 200 industry groups.<FONT color=#0000ff 
  face=Arial size=2> 
   
  <FONT color=#0000ff 
  face=Arial>Sectorid(1) returns the 12 sectors (Capital goods, utilities, 
  financials etc) If you want industry groups then replace that line 
  with 
   
  <FONT color=#0000ff 
  face=Arial>sym="~"+industryID(1); 
  <SPAN 
  class=855470704-24042003><FONT color=#0000ff face=Arial 
  size=2> 
  <FONT color=#0000ff 
  face=Arial>Ab will look at all the stocks in your scan. All the stocks with 
  with the same industryID will be counted in the appropriate composite 
  Ticker.  3./ if I wanted to create an 
  index for all the 200 used industry groups(Quotes Plus Two), would I have 
  to write this code 200 times??<FONT 
  color=#0000ff face=Arial size=2> 
   
  <FONT color=#0000ff face=Arial 
  size=2>No... See above... AB does all the grunt work for 
  you... 4./ would I have to run the scan EVEREY day 
  to bring my Addtocomposites upto date?<FONT 
  color=#0000ff face=Arial size=2> 
   
  <FONT 
  face=Arial>Yes. the scan will create/update all 200 industry groups and store 
  them in group 253 (the default location for your Composites. You may also 
  create watch lists of these tickers to separate them. 
  For instance I have a watchlist with just the 12 sectors, a second for the 
  industry group tickers etc.... 5./ I 
  added "flag=16" which gave me an error. How do I have to specify if Iwant 
  to use addtocomposite in exploration mode?<FONT 
  color=#0000ff face=Arial size=2> 
   
  <FONT color=#0000ff face=Arial 
  size=2>flag=16 is a description.... just add comma 16
  
  AddToComposite(<FONT 
  color=#000000>C,sym ,<FONT 
  color=#ff00ff>"C"<SPAN 
  class=855470704-24042003> <FONT 
  color=#ff00ff face="Courier New">,16 ); 
   Many thanks for your 
  help!Markus----- Original Message -----From: "Anthony 
  Faragasso" <ajf1111@xxxxxxxx>To: 
  <amibroker@xxxxxxxxxxxxxxx>Sent: Wednesday, April 23, 2003 8:37 
  PMSubject: Re: [amibroker] Creating IM200 indices - JAYSON> 
  Also...do not forget to add this dummy line...which is needed 
  forscanning.>> Buy=0;>>>> Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxx> Send 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 <A 
  href="">http://docs.yahoo.com/info/terms/>>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. 
  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. 
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












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.


Attachment: Description: ""