Set up structure for module

risk_management
Griffiths Lott 3 years ago
parent 1ae5eb25db
commit ed754de498
  1. 1
      src/lib.rs
  2. 1
      src/risk_management.rs
  3. 12
      src/risk_management/portfolio.rs
  4. 13
      src/risk_management/position.rs
  5. 7
      src/risk_management/risk_eval.rs
  6. 12
      src/risk_management/strategy.rs

@ -1,5 +1,6 @@
mod data;
mod order;
mod risk_management;
pub type DynResult<T> = Result<T, Box< dyn std::error::Error>>;

@ -0,0 +1 @@
pub mod risk_eval;

@ -0,0 +1,12 @@
/*
Deals with things related to the portfolio.
- Details about portfolio
~ How many strategies simaltanously?
~ Should we account for concurrent strategies?
~ Can we cross-trade strategies?
~ Can we take 'emergency loans' from other strategies
- Interaction with database
- Portfolio restrictions
~ What assets types can be traded
~ Order size / time limits
*/

@ -0,0 +1,13 @@
/*
Define position object and how to interact with positions
- What is the position
- What are the risk characteristics
- How does it fit into the larger portfolio (purpose)
Position monitor object may also be included here
- How should we manage this position?
~ Do we need to implement a custom trailing SL
~ Should it close if volatility is too high?
~ Should it close at a certain time/date
- How frequently does this need to be monitored?
*/

@ -0,0 +1,7 @@
/*
Determine the risk characterisitcs of an asset/position
What is doomsday senario for an asset/position?
Is this correlated/counter to any of the current strategy or portfolio positions
Are we confortable taking this position?
What is the max allocation we can take in this portfolio?
*/

@ -0,0 +1,12 @@
/*
How do we bring in some strategy details from a database so that we can easily adjust
the program without need to change hard coded values or restart the application
This should focus on strategy details that are shared amoung the vast majority of strategies, nothing too obscure
- Max position size
- Max position loss
- Max daily loss
- Max concurrent orders/positions
- Enforeced stop loss
- Min portfolio diversity / max position allocation
*/
Loading…
Cancel
Save