[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a3_Ordering HistoricalEndOfDayOrderE
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-12-20 19:38:09
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a3_Ordering In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17455/b4_Business/a1_Financial/a3_Ordering Modified Files: HistoricalEndOfDayOrderExecutor.cs Log Message: Added slippage management code (through ISlippageManager interface) Index: HistoricalEndOfDayOrderExecutor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a3_Ordering/HistoricalEndOfDayOrderExecutor.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HistoricalEndOfDayOrderExecutor.cs 4 Feb 2005 00:10:25 -0000 1.5 --- HistoricalEndOfDayOrderExecutor.cs 20 Dec 2005 19:37:57 -0000 1.6 *************** *** 29,32 **** --- 29,33 ---- using QuantProject.Business.Financial.Accounting.Transactions; using QuantProject.Business.Timing; + using QuantProject.Business.Financial.Accounting.Slippage; *************** *** 41,44 **** --- 42,46 ---- private IEndOfDayTimer timer; private IHistoricalQuoteProvider historicalQuoteProvider; + private ISlippageManager slippageManager; public HistoricalEndOfDayOrderExecutor( IEndOfDayTimer timer , *************** *** 47,51 **** --- 49,61 ---- 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; *************** *** 54,62 **** public void Execute( Order order ) { ! double instrumentPrice = this.historicalQuoteProvider.GetMarketValue( order.Instrument.Key , ! this.timer.GetCurrentTime() ); ! EndOfDayTransaction endOfDayTransaction = new EndOfDayTransaction( TimedTransaction.GetTransactionType( order.Type ) , order.Instrument , ! order.Quantity , instrumentPrice , new EndOfDayDateTime( this.timer.GetCurrentTime().DateTime , this.timer.GetCurrentTime().EndOfDaySpecificTime ) ); --- 64,75 ---- 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 ) ); |