Commit Graph

10 Commits (dc2e41e550372e75bb897e73ab75d1c32873445e)

Author SHA1 Message Date
Nelson Torres dc2e41e550 Add Plot
Here is the `plot_graph()` that is in char of the bars, scatter and vertical line plot items.

Also all the necessary code  for the graph to be shown.
2025-02-04 17:52:52 -03:00
Nelson Torres f0fd447af7 Extract logic from get_max_pain()
All the max pain math now is in this two functions:

- get_total_intrinsic_values(): calculate the total value for all strike_prices and stores then in a dict[str, Decimal]

- `get_intrinsic_value_and_max_pain()` given the `intrinsic_values` dict, returns the `max_pain` strike price and the `total_intrinsic_value` for that `strike_price`
2025-02-03 22:39:06 -03:00
Nelson Torres 2cb7b505e1 Max pain daemon:
- To calculate the `max_pain` first we need an expiration date,
get_expiration_dates()` retrieves them and the user then enters one of
the shown, then using the select expiry_date on `get_instruments()` we
are good to build the `oi_by_strikes` important!

- Add `update_oi_by_strikes()`.

- Add `check_if_complete()`.

- `get_max_pain()`: here's where all the action takes place, the
`oi_by_strikes` must be complete to start the calculations,

- Use `maybe_open_oi_feed` for open a oi_feed.

- Add `max_pain_readme.rst`
2025-02-03 22:33:33 -03:00
Tyler Goodlet ad4847cbac basic bot: iter latest ticks first to decide new submission price per quote 2023-06-27 15:47:23 -04:00
Tyler Goodlet da07685e8b Use `iterticks()` to filter to clears, get first price manually before submit.. 2023-06-27 15:47:23 -04:00
Tyler Goodlet f1eb76d29f Drop prints, break on latest clear match tick 2023-06-27 15:47:23 -04:00
Tyler Goodlet 46b22958f0 basic bot: add real-time price trailer (task) that keeps bid price 0.0005% below last clear value 2023-06-27 15:47:23 -04:00
Tyler Goodlet 57399e4f5d basic bot: drop registry addr and connect to default pikerd 2023-06-27 15:47:23 -04:00
Tyler Goodlet 5690595064 basic bot: set unix fileformat, add KBI handling to cancel order submission 2023-06-27 15:47:23 -04:00
Tyler Goodlet 63a6c6efde Add a super basic "order bot" example B)
Shows how to boot the piker runtime, submit an order to the ems, cancel
said order right away. NOTE, this uses piker's built in paper engine but
can be easily tweaked to use a live backend at the user's whim.
2023-06-27 15:47:23 -04:00