hashabcd / opstrat Goto Github PK
View Code? Open in Web Editor NEWOption visualization python package
License: MIT License
Option visualization python package
License: MIT License
hi abhijith,
this is an awesome work. is it possible to add lotsize.
edit: please ignore i got it from example files
I am no good with matplotlib but I wonder if we could have access / full control of the resulting figure to customise or improve it. I tried in a number of different ways but I still get either a new figure or a figure with no axes.
import matplotlib.pyplot as plt
op.multi_plotter(spot=70, spot_range=50, op_list=ls)
print(plt.gcf())
the above code results in:
<Figure size 432x288 with 0 Axes>
Thanks a lot for great package. Just looking for an enhancement where we can get payoff chart for target date. Now by default it's for expiry day.
The BSM formula offered in this pip is the standard BSM model. Could you please add support for equities that pay regular dividends where the input 'q' represents the yield?
Example:
import opstrat as op
K = 425 # Strike
r = 1.978 # Risk free rate
t = 35 # Time to expiry (in days)
sigma = 28.84 # Annualized volatility
St = 425.48 # Underlying price
type = 'p' # Option type (c or p)
bsm=op.black_scholes(K=K, St=St, r=r, t=t, v=sigma, type=type)
q = 3.2 # Dividend
bsm_div=op.black_scholes(K=K, St=St, r=r, t=t, v=sigma, type=type, q=q)
Hi, its a great tool! Thank you it works great. Can you please add the ability to add different expiry dates to each leg and quantity for each leg.
Like Friday and Monday - Diagonal
and Selling 1 and Buying 2
Appreciate it!
Great package! I been curious to use this to visualize strategies like writing covered calls, and also take into account dividend payments. Is that possible?
for multi_plotter (multi-leg) , can we return a dictionary with break-even, max loss, max profit etc?
Would be great if you could update the example notebook too. Thanks!
Hi. It would be nice to add future contracts along with options
Hi, I would like to suggest including a feature to calculate the positive and negative area of accumulated curve.
That would make it easier to compare multiple curves.
Thanks.
The yf_plotter(...)
function appears to always use the MSFT spot price regardless of the ticker passed. Thus, the displayed payoff chart always has the wrong spot price which makes the chart way off when prices are either significantly lower or higher than MSFT's.
Example: AMD vertical call spread. Notice that even though AMD's spot price on 6/24/2022 EOD was $87.08, the displayed spot price was $267.70, MSFT's spot price.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.