I am new to this but i have a question about the cost of options. it might be really simple.
If i buy a contract say SPY 220121C00470000, how do i get the price for that contract in the future - Basically, i want to set a sell price/liquidate at 25% of cost price.
Any help will be appreciated.
Thanks
.ekz.
Bawoni Abayomi Olorunsola, how far?
To get the cost of an asset at some point in the future, you can reference the “AveragePrice” property of the holding
.This will give you your average entry price for your holdings of that symbol.
With that said... To track % gain/loss, I'd recommend using the property 'UnrealizedProfitPercent' instead. If you want to exit at 25% of the original entry price, this means you're exit after a 75% loss, so your condition would be:
Now, while the above may help with your goal, I'd actually advise against this. IE: I'd generally advise against stop losses like this with options, given the volatile nature of option pricing. Consider tracking the underlying price instead, and exiting if it goes below a certain level.
Hope this helps.
-ekz
Abayomi Olorunsola
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!