[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting TimedTransaction.cs,1.
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-11-29 17:34:00
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9240/b4_Business/a1_Financial/a2_Accounting Modified Files: TimedTransaction.cs Log Message: Added GetTransactionType Index: TimedTransaction.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/TimedTransaction.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TimedTransaction.cs 13 Oct 2003 21:58:40 -0000 1.1.1.1 --- TimedTransaction.cs 29 Nov 2004 17:33:50 -0000 1.2 *************** *** 24,27 **** --- 24,28 ---- using QuantProject.ADT; using QuantProject.Business.Financial.Instruments; + using QuantProject.Business.Financial.Ordering; namespace QuantProject.Business.Financial.Accounting *************** *** 60,63 **** --- 61,100 ---- } + static public TransactionType GetTransactionType( OrderType orderType ) + { + TransactionType returnValue; + switch ( orderType ) + { + case OrderType.LimitBuy: + returnValue = TransactionType.BuyLong; + break; + case OrderType.MarketBuy: + returnValue = TransactionType.BuyLong; + break; + case OrderType.LimitCover: + returnValue = TransactionType.Cover; + break; + case OrderType.MarketCover: + returnValue = TransactionType.Cover; + break; + case OrderType.LimitSell: + returnValue = TransactionType.Sell; + break; + case OrderType.MarketSell: + returnValue = TransactionType.Sell; + break; + case OrderType.LimitSellShort: + returnValue = TransactionType.SellShort; + break; + case OrderType.MarketSellShort: + returnValue = TransactionType.SellShort; + break; + //this line should never be reached! + default: + returnValue = TransactionType.AddCash; + break; + } + return returnValue; + } public override string ToString() { |