[Quantproject-developers] QuantProject/b7_Scripts/TickerSelectionTesting EndOfDayTimerHandler.cs,1.2
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-12-17 19:49:32
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22301/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs Log Message: Updated EndOfDayTimerHandler for TickerSelection Testing, using Efficient portfolio theory Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayTimerHandler.cs 15 Dec 2004 23:21:41 -0000 1.2 --- EndOfDayTimerHandler.cs 17 Dec 2004 19:49:09 -0000 1.3 *************** *** 50,53 **** --- 50,54 ---- private Account account; + private ArrayList orders; public int NumberOfEligibleTickers *************** *** 68,72 **** this.numberOfTickersToBeChosen = numberOfTickersToBeChosen; this.account = account; ! } --- 69,73 ---- this.numberOfTickersToBeChosen = numberOfTickersToBeChosen; this.account = account; ! this.orders = new ArrayList(); } *************** *** 83,88 **** this.account.AddCash(endOfDayTimingEventArgs.EndOfDayDateTime, 16000); ! ! //this.account.ExecuteActiveOrders(); } #endregion --- 84,91 ---- this.account.AddCash(endOfDayTimingEventArgs.EndOfDayDateTime, 16000); ! foreach(object item in this.orders) ! { ! this.account.AddOrder((Order)item); ! } } #endregion *************** *** 145,149 **** Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); ! this.account.AddOrder( order ); } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() --- 148,152 ---- Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); ! this.orders.Add(order); } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() *************** *** 170,174 **** { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! //this.account.ClearOrders(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } --- 173,177 ---- { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! this.orders.Clear(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } |