* BIGGGG LINTING * fixing lints * fixing lints * black * very ruff * no export * fix hedge_view again * lints * platform lints * lints * black * black it @hjoaquim * fix some more linting --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
REPORTS
This menu has a different concept from remaining menus. It has 2 main goals:
- Generate a personalised report.
- Allow the user to write notes on that notebook (report), as if it was his personal investment diary.
How to create your own personal report
-
Copy one of the existing notebook reports as a template, e.g. dark_pool.ipynb.
-
Rename that notebook with a name that reflects what you want this notebook to contain, even including your name.
-
One of the notebook cells will have a
parameterstag, that's where the papermill will parametrize the notebook. Thus, your variables should be declared there. -
Remove the function calls that you don't care about to build your own report.
-
When building your template notebook, there are 2 type of possible things you can do:
- Create a markdown cell, where you can add a title or a description. E.g.
## Analyst Targets- Create a code cell, where you should both: import a module, and call a function to display a chart or print data. E.g.
from openbb_terminal.stocks.due_diligence import finviz_view finviz_view.analyst(ticker=ticker, export='')
Note: In order to find the name of the function you want, you should either crawl through the codebase (and ask help in discord) or look into our readthedocs (#TODO).
How to run the report
-
In config_terminal you may need to change your
PAPERMILL_NOTEBOOK_REPORT_PORTfrom8888. If the notebook generation fails, it is likely that the port selected is not the correct one. -
Start the terminal with
python terminal.py -
Select
reportscontext, and choose from the options selected - which are derived from the .ipynb jupyter notebook files on the reports folder. -
This should prompt you with a filled notebook with name:
<date time>_<report name>_<args>.ipynb. E.g.20210725_193517_dark_pool_AMC.ipynb -
Due to the last cell of the notebook, the report is saved by default as
.html. E.g.20210725_193517_dark_pool_AMC.htmlfolder = "notebooks/reports/" extension = ".ipynb" !jupyter nbconvert {report_name} --to html --no-input -
You can now write your own personal notes on the notebook. By doing:
- Click on the notebook cell that you are interested in writing your notes
- On the toolbar click on "+" to add a new cell
- On the toolbar click on "Cell" -> "Cell Type" -> "Markdown"
- You're now ready to write your own notes
-
Once you're happy with your report, you can either:
- Re-run the last cell, potentially changing output from
.html: - Or, on the toolbar click on "File" -> "Download as" -> Select your preferred option (e.g. HTML)
- Re-run the last cell, potentially changing output from