Closed BlackArbsCEO closed 2 years ago
I might have an idea
A contract group is for grouping PNL, for example,grouping options with different strikes and maturities. If you want to track PNL for each stock separately, then you would create a contract group for each. In this case, I would just do it in a loop.
cgs = {} for name in [ 'AAPL', 'IBM', 'MSFT']: cgs[name] = pq.ContractGroup.create(name)
On Thu, Jan 13, 2022 at 1:14 PM Brian @.***> wrote:
I might have an idea
— Reply to this email directly, view it on GitHub https://github.com/abbass2/pyqstrat/issues/24#issuecomment-1012431183, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCN2V47X4P4UKBV5PB3AMLUV4QA3ANCNFSM5L2LSGKQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
For example if you want to backtest a portfolio of 20 stocks how do you create the contract groups without hardcoding each one as you did in your example for the pair trading strategy?