[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a3_Ordering HistoricalEndOfDayOrde
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-09-29 21:15:02
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a3_Ordering In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14039/a3_Ordering Modified Files: HistoricalEndOfDayOrderExecutor.cs Log Message: The new revision moves toward an intraday enabled framework. EndOfDayDate time has been removed, DateTime is used now. The code has been changed accordingly. Index: HistoricalEndOfDayOrderExecutor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a3_Ordering/HistoricalEndOfDayOrderExecutor.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HistoricalEndOfDayOrderExecutor.cs 20 Dec 2005 19:37:57 -0000 1.6 --- HistoricalEndOfDayOrderExecutor.cs 29 Sep 2008 21:14:44 -0000 1.7 *************** *** 3,7 **** HistoricalEndOfDayOrderExecutor.cs ! Copyright (C) 2003 Glauco Siliprandi --- 3,7 ---- HistoricalEndOfDayOrderExecutor.cs ! Copyright (C) 2003 Glauco Siliprandi *************** *** 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; *************** *** 40,62 **** public class HistoricalEndOfDayOrderExecutor : IOrderExecutor { ! private IEndOfDayTimer timer; ! private IHistoricalQuoteProvider historicalQuoteProvider; ! private ISlippageManager slippageManager; ! public HistoricalEndOfDayOrderExecutor( IEndOfDayTimer timer , ! IHistoricalQuoteProvider historicalQuoteProvider ) { this.timer = timer; ! this.historicalQuoteProvider = historicalQuoteProvider; ! this.slippageManager = new ZeroSlippageManager(); } ! public HistoricalEndOfDayOrderExecutor( IEndOfDayTimer timer , ! IHistoricalQuoteProvider historicalQuoteProvider, ISlippageManager slippageManager ) ! { ! this.timer = timer; ! this.historicalQuoteProvider = historicalQuoteProvider; ! this.slippageManager = slippageManager; ! } ! [field:NonSerialized] public event OrderFilledEventHandler OrderFilled; --- 40,64 ---- public class HistoricalEndOfDayOrderExecutor : IOrderExecutor { ! private Timer timer; ! private HistoricalMarketValueProvider historicalMarketValueProvider; ! private ISlippageManager slippageManager; ! public HistoricalEndOfDayOrderExecutor( ! Timer timer , HistoricalMarketValueProvider historicalMarketValueProvider ) { this.timer = timer; ! this.historicalMarketValueProvider = historicalMarketValueProvider; ! this.slippageManager = new ZeroSlippageManager(); } ! public HistoricalEndOfDayOrderExecutor( ! Timer timer , ! HistoricalMarketValueProvider historicalMarketValueProvider , ! ISlippageManager slippageManager ) ! { ! this.timer = timer; ! this.historicalMarketValueProvider = historicalMarketValueProvider; ! this.slippageManager = slippageManager; ! } ! [field:NonSerialized] public event OrderFilledEventHandler OrderFilled; *************** *** 64,78 **** public void Execute( Order order ) { ! double instrumentMarketPrice = ! this.historicalQuoteProvider.GetMarketValue(order.Instrument.Key , ! this.timer.GetCurrentTime()); ! double instrumentPriceWithSlippage = instrumentMarketPrice + ! this.slippageManager.GetSlippage(order); ! EndOfDayTransaction endOfDayTransaction = new EndOfDayTransaction( ! TimedTransaction.GetTransactionType( order.Type ) , order.Instrument , ! order.Quantity , instrumentPriceWithSlippage , ! new EndOfDayDateTime( this.timer.GetCurrentTime().DateTime , ! this.timer.GetCurrentTime().EndOfDaySpecificTime ) ); ! OrderFilled( this , new OrderFilledEventArgs( order , endOfDayTransaction ) ); } } --- 66,83 ---- public void Execute( Order order ) { ! double instrumentMarketPrice = ! this.historicalMarketValueProvider.GetMarketValue(order.Instrument.Key , ! this.timer.GetCurrentDateTime()); ! double instrumentPriceWithSlippage = instrumentMarketPrice + ! this.slippageManager.GetSlippage(order); ! TimedTransaction timedTransaction = new TimedTransaction( ! TimedTransaction.GetTransactionType( order.Type ) , ! order.Instrument , ! order.Quantity , ! instrumentPriceWithSlippage , ! this.timer.GetCurrentDateTime() ); ! // new EndOfDayDateTime( this.timer.GetCurrentTime().DateTime , ! // this.timer.GetCurrentTime().EndOfDaySpecificTime ) ); ! OrderFilled( this , new OrderFilledEventArgs( order , timedTransaction ) ); } } |