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

Re: [amibroker] Interpreting A Code Segment



PureBytes Links

Trading Reference Links

Hi Ken,

RelStrength function returns relative strength of current ticker to whatever ticker you enter as the arg. Looks to me like the code walks the watchlist, and for each ticker in the list ( unless it is the current ticker ), it calculates RelStrength of that ticker to current ticker. So maybe if current ticker was set to some index, you could see which stock in the list was performing best relative to the index. 

Steve

  ----- Original Message ----- 
  From: Ken Close 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, July 27, 2006 5:29 PM
  Subject: [amibroker] Interpreting A Code Segment



  I would really appreciate it if someone could tell me exactly what the following code snippit is doing.  This is part of someone's custom code to rank, using positionscore, the relative strength of symbols relative to Guppy MMAs.

  Here is the code portion I just cannot understand...can someone explain in words.

  // walk through the watchlist grabbing all the symbols to calculate RS vs ourself.

  List = CategoryGetSymbols(categoryWatchlist, WatchlistNum);

  for(i=0; (sym = StrExtract(List, i)) != "";i++)

  {

  if(sym != Name())

  {

  f = RelStrength(sym);

  st3 = EMA(f, 3);

  st5 = EMA(f, 5);

  st8 = EMA(f, 8);

  st12 = EMA(f, 12);

  st15 = EMA(f, 15);

  Lt30 = EMA(f, 30);

  Lt35 = EMA(f, 35);

  Lt40 = EMA(f, 40);

  Lt45 = EMA(f, 45);

  Lt50 = EMA(f, 50);

  Lt60 = EMA(f, 60);

  So, it walks thru a Watchlist, and sym gets set to the symbol name.

  f is obviously the RelStength compared to the symbol, but what is compared to the symbol...????  itself????

  st3 then becomes the 3dema of this rel strength but what are the two components of the Relative Strength comparison?

  I will post the entire code on a followup message, once I can understand just what is happening.

  Thanks for any expert explanation of this.



  Ken