Hi evreyone,
I'm new to QC so let me start off by saying: I really enjoy the site and its features!
I've been reading through a whole bunch of the samples (both in the documentation section and on the github repo).
I'm struggling to put together a piece of code which:
1. Select some stocks based on coarse & fine criteria (figured this out)
2. Based on the stocks selected, purchase call options (figured this out as well)
3. Based on individual unrealized profit of the call option, sell. I'm having trouble with this
So I suspect you can select a pricing model for the options. Once you do this, is there a way to check the unrealized profit per OnData call?
Any help would be appreciated. I'm more than comfortable with being directed to a code dump and figuring out the bits and pieces I would need from it!
Alethea Lin
Hi Sina,
Welcome to QC and we are glad you are enjoying our platform! To get the individual unrealized profit, please try the following code:
decimal unrealized_pnl = Portfolio[OptionSymbol].UnrealizedProfit
You can read more about Securities and Portfolio in the docs. Hope this helps!
Sina nowr
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!