Open dysonance opened 6 years ago
Some thoughts.
JuMP.jl
(probably overkill).@brilhana Thanks for your thoughts! This is something I've been meaning to get back to for some time. I agree that each asset class should have its own logic. Obviously what makes this tricky is getting sufficient coverage for different asset types and the corresponding ordering and portfolio management logic, particularly when asset types are mixed within the same portfolio (e.g. using futures and equities in the same strategy).
The other challenge is creating logic flexible enough to allow different targets/objectives for the optimization problem. I agree adding a JuMP.jl
dependency is probably overkill, but what's needed is a good understanding of how to set up the optimization in the right way so that it is useable and flexible.
Implement a Julia type,
Order
(orAbstractOrder
from which more concrete order types could be children, likeMarketOrder
,LimitOrder
,StopOrder
, etc.) for storing, processing, and manipulating orders.This type should be able to interact with a
Portfolio
object in a highly structured order queue processing pattern. In other words, when aSignal
/Rule
triggers some market action, it should be communicated through anOrder
type.At a broad level I imagine it would look somewhat like this.
Indicator
function runs computations on raw market data at each time tSignal
function fires based on results ofIndicator
calculationsRule
dictates what action to take when theSignal
is triggeredRule
is processed, it should should output anOrder
Order
object should then be placed in an order queue to be handled at time t+1Order
"processing" logic should probably depend on aPortfolio
object, which should receive a series ofOrder
s and make the appropriate adjustments at time t+1 to the position holdings and update the per-asset portfolio weightsQuestions:
Order
to buy an equity constitutes a cash outflow at time t but that the same does not go for a futures contract. But futures contracts should probably have their own logic as well (e.g. initial margin, maintenance margin, etc).