would it be this,

AddColumn(lastvalue(Rapport),"Rapport",1.3);

  ----- Original Message ----- 
  From: AaJ 
  To: [email protected] 
  Sent: Sunday, November 15, 2009 6:35 AM
  Subject: [amibroker] To sort the productivity


    
  Hello !!

  I wihs to sort all my database's stocks by using the productivity's indicator 
.The sort uses only the 2 last bars for each single stock .

  The matter is that I use a "For" loop by accessing to each elements .And that 
is not a array .

  If I want to sort I must use a filter and the function "setsortcolums" .But 
"filter and sortcolumms" need data array .

  The purpose is to compare the productivity's stocks .Thanks ...

  Here is my code .

  stockname = Name();
  listdestocks = CategoryGetSymbols( categoryMarket, 2) ; 

  nbstock = 0 ;


  for( i = 0; ( sym = StrExtract( listdestocks, i ) ) != ""; i++ ) 
  {
  nbstock = i ;
  action = Foreign( sym, "Close"); 
  for( j = BarCount-1; j > BarCount-2 ; j-- )
  {

  Rapport[j] = action[j]/action[j-1]; 
  _TRACE(sym);
  _TRACE(NumToStr(Rapport[j])); // Good value that i want to sort on the last 
month to compare the stocks beetween each other .


  } 

  }
  nbstock++ ; 

  Filter = 1 ;
  AddColumn(Rapport,"Rapport",1.3);



  

Reply via email to