[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] CVS commit in GT/Docs/design
Update of /bourse/cvsroot/GT/Docs/design
In directory arrakis:/scratch/tmp/cvs-serv23974
Modified Files:
PortfolioAnalysis
Log Message:
- Written down a first design in term of objects.
--- /bourse/cvsroot/GT/Docs/design/PortfolioAnalysis 2003/05/25 23:13:30 1.2
+++ /bourse/cvsroot/GT/Docs/design/PortfolioAnalysis 2003/06/08 18:38:14 1.3
@@ -36,11 +36,67 @@
PROPOSED DESIGN
+Portfolio:
+- contains a set of historic positions
+ - list / add / remove
+- contains a set of open positions
+ - list / add / remove
+- contains a Brokering object
+ - get / set
+- contains a MoneyEvolution for the "cash"
+- function to compute the evaluation at any time
+ (find all the non-marged positions that were active at that time and sum
+ the evaluations)
+- function to compute marged gains at any time
+ (find all the marged positions that were active at that time and sum
+ the evaluations)
+- must be fully serializable
+
+Portfolio::Position:
+- contains a set of order
+- contains a MoneyEvolution for the evaluation (start at non-zero for
+ non-marged positions)
+- contains a MoneyEvolution for the gain/loss (start at 0)
+- computes cost for brokerage
+- fully serializable
+
+Portfolio::Order:
+- like actually without the is_executed that should move
+ to Brokering
+
+MoneyEvolution:
+- evolution of a sum of money
+- add money at a specified datetime
+- remove money at a specified datetime
+- set the sum of money at a specified date (generate automatically the
+ required add/remove event if there's no event registered at a later
+ datetime)
+- be able to compute the sum of money at any time
+- be able to compute the variation of money between two dates
+- can extract a list of values following a list of "datetimes" given
+ directly (or through an existing object like GT::Prices)
+- datetime provided by the user is expressed by a combination of
+ "timeframe" (cf DateTime.pm) and a string ("1999-10-12", "2000-03") in the
+ given format
+- fully serializable
+
+Brokering:
+- submit order
+- manage pending orders (discard, etc)
+- confirm order execution, get price of execution, etc
+- fully serializable
+
+Portfolio::Analysis:
+- input: set of positions (active or not)
+- much like indicators for the rest
PROBLEMS
* How to manage stats which need another stat as input to be computed ?
+ => something like indicators dependency ?
* How to mix positions traded on different timeframes ? (eg intradday
position and long-term positions)
+ => MoneyEvolution + internal use of "datetime" computed with "timeframe"
+ + "datetime string provided" (cf GT::TimeFrame for the support)