-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Ciocanel Razvan edited this page Jun 25, 2024
·
2 revisions
QC options framework/algo
Options framework that allows for an easier implementation of option strategies using QuantConnect's Lean.
In order to make this easier you need to have quantconnect running on local dev. That means
- Create a new quant connect algorithm.
- Clone this repository
- Install the quantconnect extension on VSCode and setup your env
- Open your newly created algorithm on your local environment
- Copy all the files from the cloned repo to this quantconnect algo
- Start creating your own AlphaModel, MonitorModel and ExecutionModel (optional)
- each of the folders Alpha, Execution, Monitor, PortfolioConstruction have a Base.py class.
- when you want to use a new strategy you should/can create a new file that inherits from those Base.py classes
- examples of classes/strategies: Alpha/SPXic.py, Monitor/SPXicMonitor.py, Execution/SPXExecutionModel.py
- each of the Base.py classes have some DEFAULT_PARAMETERS with comments as to what each of those do.
- when you inherit from the Base classes you can change the DEFAULT_PARAMETERS values by definiing a PARAMETERS class variable
- at the end you just have to set those new classes you made in main.py to be used.
- the system is not 100% Algo Framework so its a hybrid. That means I hold positions in self.context.allPositions, open positions in self.context.openPositions, working orders in self.context.workingOrders.
- you can see the initial variables attached to self.context (that is actually the algorithm instance) by going to SetupBaseStructure.py
- all the positions are instances of Strategy/Position.py a dataclass with defined attributes
- the Strategy/Position.py also holds dataclasses for WorkingOrders and Legs.