[Quantproject-developers] QuantProject/b4_Business/a2_Strategies/Eligibles ByPriceMostLiquidLessVo
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2010-03-28 14:11:52
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18844/a2_Strategies/Eligibles Modified Files: ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs Log Message: The code has been reformatted, and it now follows "standard" indentation Index: ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs 29 Sep 2008 21:14:49 -0000 1.3 --- ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs 28 Mar 2010 14:11:44 -0000 1.4 *************** *** 19,23 **** along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; --- 19,23 ---- along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; *************** *** 42,52 **** /// -step 2: from tickers selected by step 1, the most liquid /// are selected (not more than maxNumberOfMostLiquidTickersToBeChosen); ! /// -step 3: from tickers selected by step 2, the ones that are /// less volatile (OTC returns in the last /// numOfDaysForVolatilityComputation days ! /// are analyzed) are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// -step 4: from tickers selected by step 3, the ones that are ! /// always quoted at all market days are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// </summary> --- 42,52 ---- /// -step 2: from tickers selected by step 1, the most liquid /// are selected (not more than maxNumberOfMostLiquidTickersToBeChosen); ! /// -step 3: from tickers selected by step 2, the ones that are /// less volatile (OTC returns in the last /// numOfDaysForVolatilityComputation days ! /// are analyzed) are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// -step 4: from tickers selected by step 3, the ones that are ! /// always quoted at all market days are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// </summary> *************** *** 74,78 **** private void byPriceMostLiquidLessVolatileOTCAlwaysQuoted_checkParameters() { ! if(this.maxNumberOfMostLiquidTickersToBeChosen <= this.maxNumberOfEligibleTickersToBeChosen) throw new Exception("The set of the most liquid tickers has to " + --- 74,78 ---- private void byPriceMostLiquidLessVolatileOTCAlwaysQuoted_checkParameters() { ! if(this.maxNumberOfMostLiquidTickersToBeChosen <= this.maxNumberOfEligibleTickersToBeChosen) throw new Exception("The set of the most liquid tickers has to " + *************** *** 81,90 **** public ByPriceMostLiquidLessVolatileOTCAlwaysQuoted( ! string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, int maxNumberOfMostLiquidTickersToBeChosen, ! int numOfDaysForAverageOpenRawPriceComputation, int numOfDaysForVolatilityComputation, ! double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; --- 81,90 ---- public ByPriceMostLiquidLessVolatileOTCAlwaysQuoted( ! string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, int maxNumberOfMostLiquidTickersToBeChosen, ! int numOfDaysForAverageOpenRawPriceComputation, int numOfDaysForVolatilityComputation, ! double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; *************** *** 92,100 **** this.maxNumberOfEligibleTickersToBeChosen = maxNumberOfEligibleTickersToBeChosen; ! this.maxNumberOfMostLiquidTickersToBeChosen = maxNumberOfMostLiquidTickersToBeChosen; this.numOfDaysForAverageOpenRawPriceComputation = numOfDaysForAverageOpenRawPriceComputation; ! this.numOfDaysForVolatilityComputation = numOfDaysForVolatilityComputation; this.minPrice = minPrice; --- 92,100 ---- this.maxNumberOfEligibleTickersToBeChosen = maxNumberOfEligibleTickersToBeChosen; ! this.maxNumberOfMostLiquidTickersToBeChosen = maxNumberOfMostLiquidTickersToBeChosen; this.numOfDaysForAverageOpenRawPriceComputation = numOfDaysForAverageOpenRawPriceComputation; ! this.numOfDaysForVolatilityComputation = numOfDaysForVolatilityComputation; this.minPrice = minPrice; *************** *** 106,144 **** History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; if(this.temporizedGroup) ! //the group is "temporized": returned set of tickers ! // depends on time group = new SelectorByGroup(this.tickersGroupID, currentDate); ! else//the group is not temporized ! group = new SelectorByGroup(this.tickersGroupID); ! DataTable tickersFromGroup = group.GetTableOfSelectedTickers(); ! int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; ! SelectorByAverageRawOpenPrice byPrice = ! new SelectorByAverageRawOpenPrice(tickersFromGroup,false, ! currentDate.AddDays(-this.numOfDaysForAverageOpenRawPriceComputation), ! currentDate, ! numOfTickersInGroupAtCurrentDate, ! this.minPrice,this.maxPrice, 0.00001, double.MaxValue); ! DataTable dataTableByPrice = byPrice.GetTableOfSelectedTickers(); SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, history.FirstDateTime, currentDate, ! this.maxNumberOfMostLiquidTickersToBeChosen); ! DataTable dataTableMostLiquid = mostLiquidSelector.GetTableOfSelectedTickers(); ! SelectorByOpenToCloseVolatility lessVolatileSelector = new SelectorByOpenToCloseVolatility( dataTableMostLiquid , ! true, currentDate.AddDays(-this.numOfDaysForVolatilityComputation), currentDate, ! this.maxNumberOfEligibleTickersToBeChosen); ! ! DataTable dataTableLessVolatile = lessVolatileSelector.GetTableOfSelectedTickers(); // DataSet dataSet = new DataSet(); --- 106,144 ---- History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; if(this.temporizedGroup) ! //the group is "temporized": returned set of tickers ! // depends on time group = new SelectorByGroup(this.tickersGroupID, currentDate); ! else//the group is not temporized ! group = new SelectorByGroup(this.tickersGroupID); ! DataTable tickersFromGroup = group.GetTableOfSelectedTickers(); ! int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; ! SelectorByAverageRawOpenPrice byPrice = ! new SelectorByAverageRawOpenPrice(tickersFromGroup,false, ! currentDate.AddDays(-this.numOfDaysForAverageOpenRawPriceComputation), ! currentDate, ! numOfTickersInGroupAtCurrentDate, ! this.minPrice,this.maxPrice, 0.00001, double.MaxValue); ! DataTable dataTableByPrice = byPrice.GetTableOfSelectedTickers(); SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, history.FirstDateTime, currentDate, ! this.maxNumberOfMostLiquidTickersToBeChosen); ! DataTable dataTableMostLiquid = mostLiquidSelector.GetTableOfSelectedTickers(); ! SelectorByOpenToCloseVolatility lessVolatileSelector = new SelectorByOpenToCloseVolatility( dataTableMostLiquid , ! true, currentDate.AddDays(-this.numOfDaysForVolatilityComputation), currentDate, ! this.maxNumberOfEligibleTickersToBeChosen); ! ! DataTable dataTableLessVolatile = lessVolatileSelector.GetTableOfSelectedTickers(); // DataSet dataSet = new DataSet(); *************** *** 146,157 **** // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.xml" ); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, history, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableToBeReturned = quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); ! return new EligibleTickers( dataTableToBeReturned ); } --- 146,157 ---- // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.xml" ); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, history, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableToBeReturned = quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); ! return new EligibleTickers( dataTableToBeReturned ); } |