kyleloomis
kyleloomis on Hacker News
Posted by
kyleloomis on Monday November 04, 2024 @08:53PM
from the kyleloomis.com dept.
Finstruments is an instrument definition library, meaning that you can build the specifications of an instrument. Currently, this library is primarily useful for serialization and deserialization to and from JSON, but it can also be used for backtesting, option payoffs, tracking portfolio P&L, risk management, API integration, and document storage.
Regarding the Portfolio class, I opted to distinguish trades from positions. This is useful for tracking and organizational purposes. For example, if you enter into a straddle, it's useful to combine the put and call into one "trade" instead of just a bunch of random positions.
This is a very early work-in-progress, so I would suggest checking back in over the coming weeks for additional instruments and usage details.
Thanks for sharing. Unfortunately doesn't look to support Python natively, and it looks quite complex for my purposes of instrument definitions, but it seems useful as a reference point.
Thanks for sharing. Your library seems to be a bit more extensive, including not only definitions but also modeling. Might be useful as a reference point if I integrate other functionality such as pricing.
Financial data, as in a time series of prices? It really depends on your budget, desired overhead, and amount of data. Some funds store data in flat files (broken down by date, instrument, ticker, etc), others use time series databases, such as ClickHouse or Kdb+. Using flat files is probably the simplest and most cost effective while still enabling you to store a massive amount of data, but using a database obviously enables querying and analytics.
Not yet, I will work to add this soon.
Let me know your thoughts and how it could be improved.
Thanks for the note! I removed this for now... will fix later.
QuantLib is an bloated library built in C++ and ported over to Python. The design is unintuitive, lacks modularity, and employs a number of hacks, such as locks. My goal is to build an intuitive, simple, and modular alternative for users that care more about the coding experience.
Posted by
kyleloomis on Monday October 28, 2024 @01:18AM
from the show-hn dept.
https://github.com/kyleloomis/finstruments
finstruments is a Python library designed for modeling financial instruments. It comes with the core financial instruments, such as forwards and options, out of the box, as well as position, trade, and portfolio models. finstruments comes with the basic building blocks, making it easy to extend and build new instruments for any asset class. These building blocks also provide the functionality...