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

Re: [amibroker] Re: Ranking of MG Industry Groups



PureBytes Links

Trading Reference Links

Here is a sort function that I got from the AB board, 

function sort(value)
{
//Value is array for same bar from all sectors
//12 data points (Sectors 2 through 13, based on Quotes Plus)
//
for(i = 13; i>=2; i--)
{
 for (j = 3; j <= i; j++)
 {
 if (value[j-1] > value[j])
  {
  tempvalue  = value[j-1];
  value[j-1] = value[j];
  value[j]   = tempvalue;
  }
 }
}
SortList = Value;
//list now sorted
//sortid = ID for top sector

return SortList;
}


----- Original Message ----- 
From: "marketmonk777" <RedEyes777@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, June 25, 2007 11:01 PM
Subject: [amibroker] Re: Ranking of MG Industry Groups


> --- In amibroker@xxxxxxxxxxxxxxx, "Gordon Sutherland" <gosuth@xxx> wrote:
>>
>> Check-out the function:
>> 
>> SetSortColumns( col1, col2, .... )  
>> 
>> Cheers,
>> 
>> Gordon Sutherland
> 
> Hi Gordon,
> 
> That is a good solution for multi column sorting but I really am
> looking to rank each industry group based on various time frames. 
> 
> Here is an excerpt from an Automatic Analysis that I had to change to
> vertical in order to properly show it in this posting:
> 
> 
> Ticker MG851
> Date/Time 6/22/2007
> Name            Internet Service Providers
> Close  24.2
> 1P % -0.4
> 1P R 38      I inserted this 1 Day change rank
> 5P % 0.3
> 21P % 2       Want to add 5 day, 21 day, 63 day and 255 day Ranks
> 63P % 35
> 255P % 116
> NL 21 No
> ATR5 0.39
> ADR5 0.39
> HC 732.34
> L YR C 13.78
> YTD % 75.6
> YTD R 1         Another row I inserted to show YTD Rank
> 
> So all I am trying to do is rank each of the percentage change columns
> from 1 to 240 (best to worst) in this one AA report.
> 
> Any help would be appreciated.
> 
> Regards,
> 
> Dave
> 
> 
> 
> 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/