Files
OpenBB/openbb_terminal/reports
Jeroen Bouma 49641bd9e8 Update the routine, portfolio and screener files and adjust the documentation (#4021)
* Remove undesired example files

* Update the documentation for routines

* Add in video

* Add some additional text

* Add in a routines example that can be activated with --example

* Remove default old examples

* Add portfolio example holdings file

* Add portfolio optimization example allocation file

* Add example files for the portfolio menus

* Remove code that unintentionaly prints the home menu on every routine

* Add home instead of /

* Remove requirement to add file if you have an example

* Ensure portfolio/po/params also talks about docs correctly

* Move all routine, portfolio and screener presets to the correct folder

* Remove presets since they are moved

* Remove presets since they are moved

* Same implementation as for file in po

* Adjust code so it works with new folder

* Adjust code so it works with new folder

* Adjust code a little since I changed folder

* Update screener documentation to include how to create a screener

* Remove old readme

* Update documentation to better reflect where to find the files

* Also update SDK notes

* Update exe with auto complete and more info

* Add images

* Update images and the last script

* Update text to make it more apparent that it has an example attached

* Add section for routine scripts on home menu

* Make call_about more robust and add record and stop

* Update the routine markdown with info about record/stop including video

* Update scripts

* Update portfolio report

* Update tests and report

* fix small load bug

* rewrite help test

* last fix was buggy

* example by default

* fix po integration test

* keep example on arg

* adapt integration test

* fix portfolio integration test

* fix more portfolio integration tests

* pa is not an option anymore

* portfolio report choices only holdings

* update integration test for portfolio report

* Small formatting improvements

* Remove sleep and fix inconsistent return

* Some spelling

* oops

* Fix tests

---------

Co-authored-by: Jeroen Bouma <jeroenbouma@Jeroens-MacBook-Pro.local>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
Co-authored-by: Diogo Sousa <montezdesousa@gmail.com>
2023-01-30 13:22:32 -05:00
..
…

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

  1. Copy one of the existing notebook reports as a template, e.g. dark_pool.ipynb.

  2. Rename that notebook with a name that reflects what you want this notebook to contain, even including your name.

  3. One of the notebook cells will have a parameters tag, that's where the papermill will parametrize the notebook. Thus, your variables should be declared there.

  4. Remove the function calls that you don't care about to build your own report.

  5. 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

  1. In config_terminal you may need to change your PAPERMILL_NOTEBOOK_REPORT_PORT from 8888. If the notebook generation fails, it is likely that the port selected is not the correct one.

  2. Start the terminal with python terminal.py

  3. Select reports context, and choose from the options selected - which are derived from the .ipynb jupyter notebook files on the reports folder.

  4. This should prompt you with a filled notebook with name: <date time>_<report name>_<args>.ipynb. E.g. 20210725_193517_dark_pool_AMC.ipynb

  5. Due to the last cell of the notebook, the report is saved by default as .html. E.g. 20210725_193517_dark_pool_AMC.html

    folder = "notebooks/reports/"
    extension = ".ipynb"
    !jupyter nbconvert {report_name} --to html --no-input
    
  6. 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
  7. 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)