Compare commits

..

1 Commits

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

Also all the necessary code  for the graph to be shown.
2025-02-04 00:30:09 -03:00
1 changed files with 1 additions and 17 deletions

View File

@ -12,8 +12,7 @@ from piker.brokers.deribit.api import (
) )
import sys import sys
import pyqtgraph as pg import pyqtgraph as pg
from PyQt6 import QtCore from pyqtgraph import ScatterPlotItem
from pyqtgraph import ScatterPlotItem, InfiniteLine
from PyQt6.QtWidgets import QApplication from PyQt6.QtWidgets import QApplication
def check_if_complete( def check_if_complete(
@ -136,21 +135,6 @@ async def max_pain_daemon(
) )
plot.addItem(scatter_iv) plot.addItem(scatter_iv)
total_intrinsic_value, max_pain = get_intrinsic_value_and_max_pain(intrinsic_values)
vertical_line = InfiniteLine(
pos=max_pain,
angle=90,
pen=pg.mkPen(color='yellow', width=2, style=QtCore.Qt.PenStyle.DotLine),
label=f'Max pain: {max_pain:,.0f}',
labelOpts={
'position': 0.8,
'color': 'yellow',
'movable': True
}
)
plot.addItem(vertical_line)
def update_oi_by_strikes(msg: tuple): def update_oi_by_strikes(msg: tuple):
nonlocal oi_by_strikes nonlocal oi_by_strikes
if 'oi' == msg[0]: if 'oi' == msg[0]: