-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] - Add Futures Curve Chart #6547
Conversation
I have added the possibility for multiple dates, similarly to the I had to modify Cboe has been narrowed in scope to be just VIX futures. There is VX_AM and VX_EOD, where AM is the mid-morning trade-weighted average price level. When date(s) are requested, the VX1-VX9 symbols are supplied as identifiers to facilitate direct comparisons of the term structure. The symbols, "vx", "vix", "^vix", are all interpreted as "VX_EOD". |
…BB-finance/OpenBBTerminal into feature/futures-curve-chart
@@ -133,8 +134,13 @@ def get_params(self) -> ChartParams: | |||
).replace("/", "_")[1:] | |||
if hasattr(ChartParams, charting_function): | |||
return getattr(ChartParams, charting_function)() | |||
raise ValueError( | |||
f"Error: No chart parameters are defined for the route: {charting_function}" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain? if you tried to use an endpoint that doesn't have a charting function it should raise (it shouldn't also get here probably).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does raise, in the lines above, if there is no route. After verifying the route exists, it checks ChartParams for that function; if it doesn't exist, then it will return the charting function's help. This allows parameters to be detailed in the code, outside of the charting extension.
@@ -139,7 +151,7 @@ def test_derivatives_futures_curve(params, headers): | |||
|
|||
query_str = get_querystring(params, []) | |||
url = f"http://0.0.0.0:8000/api/v1/derivatives/futures/curve?{query_str}" | |||
result = requests.get(url, headers=headers, timeout=60) | |||
result = requests.get(url, headers=headers, timeout=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be a bad idea to have such a small timeout on an integration test, will probably cause a false positive.
from openbb_charting.core.chart_style import ChartStyle | ||
from openbb_charting.core.openbb_figure import OpenBBFigure | ||
from openbb_charting.styles.colors import LARGE_CYCLER | ||
from openbb_core.app.model.abstract.error import OpenBBError | ||
from openbb_core.provider.abstract.data import Data | ||
from pandas import DataFrame, to_datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is due to import time reduction?
Why? (1-3 sentences or a bullet point list):
What? (1-3 sentences or a bullet point list):
Impact (1-2 sentences or a bullet point list):
chart
is available on the command.Testing Done: