Commit Graph

360 Commits

Author SHA1 Message Date
Theodore Aptekarev
b90025555b Remove defirate scraping (#2113)
* Remove functions based on defirate scraping

* Update docs

* Update tests
2022-07-19 19:40:08 +03:00
montezdesousa
82b6411cab remove cumulative returns functionalities (#2103)
Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2022-07-18 18:50:59 +03:00
Chavithra
1995344965 Tests : mock api call (#2105) 2022-07-18 17:51:12 +03:00
Jalil F
96ed08daaa [Bugfix#2094] Fix handling of balances when user has no tokens. (#2095)
* Add edge case handlers for crypto balance. Resolves OpenBB-finance/OpenBBTerminal#2094

* Clear print statement.

* Run previous df generation.

* Run pure row merge.

* Fixing spacing.

* Adding test and fixing previous test failures.

* Clear comment.

* Adding vcr test.

* revert to old poetry.lock

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-07-17 13:33:16 +01:00
montezdesousa
0f6852cf0c Fixes error message on portfolio menu help (#2088)
* fix message display on help

* rewrite expected on print help

* fix linting
2022-07-15 10:21:02 +01:00
ghbcode
51b6c6ca76 Corrected wording (#2080) 2022-07-13 09:15:12 -04:00
James Maslek
9e7cf49e91 sources goofed (#2079) 2022-07-13 07:44:15 +01:00
DidierRLopes
9e220e8f3c Creates a controller to specify sources (#2069)
* Add all data sources to data_sources_default.json so we can have a list in one place

* create menu to get and set data sources

* improve settings controller

* james request

* improve helper message

* minor improvement

* fix tests
2022-07-12 18:56:52 +01:00
Chavithra
0dfd53f28a Portoflio : add pa export command for Degiro (#2065)
* Portoflio : add pa export command for Degiro

* Update controller + tests

* Tests

* Degiro : update pa export format

* Fixing Premium

* Black

* Show index
2022-07-12 19:38:34 +02:00
montezdesousa
4c0b1135a9 Economic calendar command (#2043)
* add ecocal command to menu

* add menu legend

* run black and pylint

* fix date input

* add command to main.yml

* sort and remove duplicates

* run black on model

* fetch user timezone automatically

* remove tz option and None displays

* adds choices to controller

* fix dates corner case

* create test for get_economic_calendar

* write tests for investingcom_view

* fix ycrv model

* remove unused imports

* rewrite expected for economy print help

* rewrite expected for portfolio model

* fix linting

* fix linting

* try to pass pylint again

* create _index.md

* complete docstrings

* rewrite expected  on portfolio model

* Update _index.md

* Update _index.md

* change -i default to all

* rewrite portfolio model and mark vcr

* run black on test changes

* revert changes on tests

* add limit to nr of events

Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-07-12 16:22:48 +01:00
Theodore Aptekarev
5267af2876 Bump python version (#2061)
* Add python 3.9 conda environment

* Bump dependency versions

* Bump default python version in github actions to 3.9

* Update install documentation

* Update tests

* Bump black version in conda environments

* Skip test_display_norm in econometrics menu tests

* Bump black and tensorflow versions in pyproject toml

* Attempt to fix failing concurrent windows tests

* Skip test_display_norm in econometrics menu tests

* Bump python in conda test workflows

* Update requirements.txt

* Fix old version fallback tag
2022-07-12 16:30:59 +03:00
montezdesousa
dfd6d49056 Fixes portfolio_model.py tests (#2071)
* fix portfolio tests

* run black on test file

* remove unused argument
2022-07-12 11:41:59 +02:00
James Maslek
72e2e78ad2 Get rid of datetime and market open closes in default stock load (#2067)
* Get rid of datetime and market open closes in default stock load

* fix portfolio tests
2022-07-11 15:55:26 -04:00
montezdesousa
2c3e10a128 Overhaul Portfolio class (#2021)
* adds pythonic portfolio class

* start calculate trades refactoring

* adds comments to portfolio model - delete afterwards

* finish calculate trades refactoring

* restore original portfolio_model.py

* implement calculate_allocations

* adapt and test controller load, show, bench, alloc and perf

* add old code that was ok

* adapt controller

* adapt portfolio_view

* run black on pythonic_portfolio.py

* fix crypto bug

* change column name in example datasets

* substitute portfolio_model.py

* update show command

* push cumulative returns calculation to model

* fix last change in cumulative returns

* add comments on possibly unused code

* run black on changes

* bring metrics from helper to model

* push rolling metrics from view to model

* Details and linting

* Fix tests

* remove empty attribute and rename class

* fix view and controller rf

* change returns calculation method

* remove CASH from code

* remove cash from tickers_list

* run black on changes

* change function name

* adapt to PortfolioModel

* fix tests

* fix tests on help

* fix linting

* call metrics from PortfolioModel

* call drawdown from model

* fix some mypy issues

* fix remaining mypy issues

* fix test

* Fix linting

* Remove unused function

* Small fixes

* Remove old code and adjust summary to simply work

* Update the Excel since CASH is no longer a thing

* Fix tests

* Update the csvs

* Updates to usage of full_shares and more details

* Fix -t flag for perf

Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-07-08 17:59:09 +02:00
James Maslek
d1e97c7ac4 Update data sources json to allow submenu loading (#2057)
* update data sources json

* missed one

* fix test
2022-07-07 19:05:57 +01:00
DidierRLopes
0276784b35 Update defaults.ini (#2035)
* update defaults.ini

* fix arg

* Make arg more robust when you use ini file

* Fix tests

Co-authored-by: JerBouma <jer.bouma@gmail.com>
2022-07-07 13:39:29 +02:00
northern-64bit
89297fadc4 Adding new portfolio metrics (#2029)
* Making pa active + pa minor features

Makes pa actice and adds country to the df. The groupby command also gets percents of holding allocation. It also fixes warnings and prepares for a later pr that I'm currently working on.

* Fix linting

* black linter

* Fixes

Should fix everything

* Linting

* Making pa controller to base class standard

* Fix linting

* first metrics

* Adding calmar ratio

* Adding metrics to controller

* Linting

* Linting

* Test fixes

* Test fixes

* Adding tests

* Linting

* Restructuring added tests

* Linting

* Updating hugo website and fixing help

* Fixing commands

* Fix kelly criterion command

* Fixing tests

* Linting

* More linting

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-07-07 10:14:16 +02:00
Jeroen Bouma
b749d6e3c6 Improvements within the Terminal for the Documentation (#2048)
* Change about us to open_terminal_documentation

* Change the home menu to be more compact

* Make changes to menu layout and change bottom bar

* Change about command to send you to the documentation and add about to bottom bar

* Add in about choices to all menus

* Adjust wording

* Adjust the website to match terminal commands and make adjustments for common menus

* Update the website and small change to about command

* Small adjustment to about command

* Remove update command

* Add some more info about arguments

* Fix broken link

* Add pro tip

* Update keys to work well with about

* Fix some common paths

* Add back in the update command with exception if packaged application

* Remove update comment

* Fix all the things

* Make about more robust and also add in exe

* Make sure that there are actual commands and menus
2022-07-06 13:52:26 +01:00
northern-64bit
5188884105 Crypto api fixes (#1959)
* Making pa active + pa minor features

Makes pa actice and adds country to the df. The groupby command also gets percents of holding allocation. It also fixes warnings and prepares for a later pr that I'm currently working on.

* Fix linting

* black linter

* Fixes

Should fix everything

* Linting

* Making pa controller to base class standard

* Fix linting

* Refactor API to accept Crypto Symbol as an input argument

* Crypto API fixes

* Fixes

* Linting

* Linting

* More linting

* Fixes

* Tests : cryptocurrency/helper

* Tests : cryptocurrency/glassnode

* Pytest : Cryptocurrency/due_diligence

* Pytest : cryptocurrency/discovery

* Pytest : cryptocurrency/due_diligence

* Remove not a needed function argument

* Linting

* Test fixes

* Fixing mentioned fixes

* Test fixes

* Tests: cryptocurrency/defi

* Fix linting

* Final test fixes

Co-Authored-By: Chavithra <6114398+Chavithra@users.noreply.github.com>

* Fix merge

* Linting

* Fixing error

* Linting

* Removed long link

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
Co-authored-by: Minh Hoang <nminh.hoang1023@gmail.com>
Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
Co-authored-by: Chavithra <6114398+Chavithra@users.noreply.github.com>
2022-07-06 13:08:32 +01:00
DidierRLopes
3d3ee96874 Remove print and fix issue with str on sia/vis (#2034)
* remove print and fix issue with str on sia/vis

* fix tests

Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-07-04 10:08:14 +01:00
DidierRLopes
066d347c63 replace curve brackets by square ones (#2040) 2022-07-03 21:31:04 +01:00
soggyomelette
7849b5668b Adds a test for binance key as asked for in #2006 (#2026)
* Adds a test for binance key as asked for in #2006

* Update keys_controller.py

* Update keys_controller.py

* fixing linting

* fixing tests

* fixing linting

* fix tests

* fix linting

* fix linting

* fix linting

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-07-02 12:06:51 +01:00
Paul Symonds
248deed202 New Feature Financial Analysis, checks Yahoo if no data at Alpha Advantage. (#1984)
* Added code to look at Yahoo Finance Financials (Income, Balance sheet and cashflow, if tickers not found in Alpha Vantage.  Should cover all UK (only tested with .L appended to tickers).

* Added code to look at Yahoo Finance Financials (Income, Balance sheet and cashflow, if tickers not found in Alpha Vantage.  Should cover all UK (only tested with .L appended to tickers).

* change

* refactored to keep yahoo fa financials (income, cash, balance) separate.

* refactored to keep yahoo fa financials (income, cash, balance) separate.

* refactored to keep yahoo fa financials (income, cash, balance) separate.

* refactored to keep yahoo fa financials (income, cash, balance) separate (fixed dates).

* Fixed source bug

* empty commit

* fixed header date issue

* Fixed source

* fixed bugs related to no data returned

* fixed bugs related to no data returned

* fixed bugs related to no data returned

* Added yf to av when no data returned from av

* Added support for polygon statement of cash flows

* Fixed issue I created

* fixed pylint error else after return

* fixed pylint error with disable R1732

* fixed tests relating to av

* Updated polygon model and fixed tests

* fixed load GNR in fa after SNR.L in stocks

* fixed load GNR in fa after SNR.L in stocks

* Added newline to print

* Added newlines

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
Co-authored-by: colin99d <colin99delahunty@gmail.com>
2022-06-29 14:02:01 -04:00
DidierRLopes
221bfce452 Improve economy menu (#1996)
* slight improvement on the reports controller

* improve economy menu

* fix tests

Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-06-29 12:49:00 +01:00
montezdesousa
8f6bd9cab6 Removes command govp from crypto/defi (#1980)
* remove govp from defi menu

* rewrites help txt

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-06-25 00:54:14 +01:00
minhhoang1023
7c597befe2 Unify input arguments between Terminal and Crypto API usage (#1942)
* Refactor API to accept Crypto Symbol as an input argument

* Fix tests

* Fix tests 2
2022-06-25 00:02:07 +01:00
James Simmons
2a5fbd4cd5 Fixing default view and ascending order in cglosers and cggainers (#1923)
* Fixing default view and ascending order in cglosers and cggainers

* Fixing futurewarnings error, adding test data, and changing dollar sign issue

* Adding --rewrite-expected test to pass CI

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-06-25 00:01:20 +01:00
soggyomelette
0b9a81b1bd [Bug] Broken ETF functionalities (#1976)
* Update stockanalysis_model.py

* Update etf_controller.py

* Fix tests and linting

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: JerBouma <jer.bouma@gmail.com>
2022-06-24 23:49:54 +01:00
montezdesousa
2386bd2da2 [Bug] crypto/defi/sratio: Remove scientific notation in Chart title (#1965)
* removes sratio from choices and help

* rewrites help test txt

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
Co-authored-by: Chavithra <chavithra@gmail.com>
2022-06-24 14:01:13 +01:00
Colin Delahunty
e3daff2161 fixed crypto load (#1981)
* fixed crypto load

* Added fix

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-06-23 14:07:27 -04:00
montezdesousa
57b61d1b2a Display the help menu whenever users move to a different menu (#1968)
* switch auto print_help on exits

* display help when home called from home directory

* change in test to expect help cmd

* change in test to expect help cmd

* sets autoexithelp flag on conftest

* supress help string print on quit

* adapt tests to expect help

* adds help on 3 tests missing

* run black

* respect literal bool type

* second attemp to respect literal bool

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-06-22 13:45:48 +01:00
James Simmons
0c60d70cb2 Fixing fails to deliver bug and resulting NaN values in dataframe bug (#1956)
* Fixing fails to deliver bug and resulting NaN values in dataframe bug

* Taking out print statement

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-06-20 08:48:26 +01:00
montezdesousa
99dce2457a Fix crypto/defi/vaults not showing for default and -k lp (#1957)
* fix vault sort

* rewrite tests

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
2022-06-17 09:15:48 -04:00
Sam Kerr
497324d75f Preferred data source for a given command and help docs for any command (#1928)
* Add a feature flag loaded from . env for preferred data source

* Update the load command to use the preferred source

* Add a test

* Black syntax checker updates

* Update test syntax

* Update load command documentation

* Add a variable to read a sources file from

* Add a default sources.json file

* Add a helper function to read the source file and get the most relevant value

* Add some comments

* Remove older preferred data source file setting

* Add a default source file for data and use it if no user preference specifies a specific file

* Remove duplicate source file and old settings values

* Update the test file

* Update documentation string

* Update tests/openbb_terminal/test_settings_controller.py

* Black syntax formatting issues

* Fix a test case

* Fix a typo

* Fix Flake8 errors

* Fix Flake8 errors

* Pyupgrade syntax fixes

* Additional linter corrections

* More pylint issues

* Improve predefined default sources

* refactor parse_known_args_and_warn for documentation

* Update openbb_terminal/helper_funcs.py

* Add a feature flag loaded from . env for preferred data source

* Update the load command to use the preferred source

* Add a test

* Black syntax checker updates

* Update test syntax

* Update load command documentation

* Add a variable to read a sources file from

* Add a default sources.json file

* Add a helper function to read the source file and get the most relevant value

* Add some comments

* Remove older preferred data source file setting

* Add a default source file for data and use it if no user preference specifies a specific file

* Remove duplicate source file and old settings values

* Update the test file

* Update documentation string

* Update tests/openbb_terminal/test_settings_controller.py

* Black syntax formatting issues

* Fix a test case

* Fix a typo

* Fix Flake8 errors

* Fix Flake8 errors

* Pyupgrade syntax fixes

* Additional linter corrections

* More pylint issues

* Improve predefined default sources

* refactor parse_known_args_and_warn for documentation

* Update openbb_terminal/helper_funcs.py

* Forex controller

* Tests : Fixing `parse_known_args_and_warn` issue

* Comparison Analysis controller

* Tests : Comparison Analysis

* Tests : Stocks/DarkPoolShorts + Stocks/Options

* Tests : fix call_load tests

* Linting : fixing line size

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-06-14 20:23:55 +02:00
Colin Delahunty
b6300e906c Fix for DCF glitch (#1932)
* Added fixes

* Added fixes

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2022-06-14 17:09:38 +03:00
James Simmons
4ad367d2e0 Changing no data label and test files (#1922)
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2022-06-10 13:17:44 -04:00
jose-donato
0e03b9e9e4 refactoring load, changed chart to candle (#1838)
* refactoring load, changed chart to candle

* updating load

* refactor done, missing tests

* fixed chart

* refactor

* linting

* tests failing

* fix minh issues

* auto completion for load

* linting

* Tests : cryptocurrency/controller ; remove mocking of functions which are not used anymore

* Cryptocurrency/Controller : call_headlines ; fix bug

* Tests : cryptocurrency/controller ; mock function

* Tests : cryptocurrency/due_diligence ; fix expected output

* cryptocurrency/due_diligence ; mock functions

Co-authored-by: Chavithra <chavithra@gmail.com>
Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2022-06-09 13:25:33 +01:00
James Simmons
7527e91692 Fixes bug #1907 scraping management data (#1914)
* Fixing bug #1907 scraping  management data

* adding csv for failed tests on last push for bug fix

* business_insider_view tests

Co-authored-by: Chavithra <chavithra@gmail.com>
Co-authored-by: james <jmaslek11@gmail.com>
2022-06-08 14:52:58 -04:00
Sam Kerr
a9a777143c Add argument to remove masking for heatmap in hcorr and print correlations to command line (#1913)
* Remove masking for heatmap

* Add a comment

* Add a flag to show either half or the full correlation matrix.

* Fix printed correlation table cutting off for large data sets

* Update the test

* Update some formatting issues

* Fix another formatting error

* Formatting issue

* Remove a double blank line

* Black formatting changes

* Fix a pylint formatting issue

* Use rich table and add a raw flag

* Fix formatting issue

* Capitalize ticker name in table columns

* Update a test

* Add docs for new arguments

* retrigger checks
2022-06-08 13:29:35 -04:00
Sam Kerr
610b19bbb5 Clarify values by re-ordering rows in enterprise value report (#1908)
* Re-order columns in enterprise value report

* Update test files with changed values

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2022-06-06 15:29:40 -04:00
minhhoang1023
4c02dc2a66 Fix multiple crypto bugs (#1903)
* fix #1850

* fix #1831

* add extra check to Reddit API keys

* ignore warning message to update praw api

* improve OpenBB links

* fix quick performance only on stocks class because I'm James bitch

* fix quick performance only on stocks class because I'm James bitch

* fix #1829

* fix #1821

* add messari to keys - fix #1819

* example of multiple oclumns to check on options/chains

* minor improvement in xlabel re. #1814

* remove repeated command

* fix #1698

* fix line too long

* fix #1814 fr now

* fix tests

* Fix multiple bugs

* Disable false positive pylint in some crypto models

* Fix website not building because of expo command removed

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2022-06-06 18:20:44 +03:00
didierlopes.eth
49560ab880 Econometrics UX (#1878)
* improve econometrics load, custom_reset

* improve econometrics UX and remove options cmd

* fix sector and industry analysis

* improve econometrics and export data from main menu

* improve toolbar vis to add helper -h

* imporve type and desc

* add logger

* econometrics improve ols

* improve root and norm commands

* more cleanup

* improve econometrics commands

* api econometrics

* tests econometrics

* improve index command

* change modify to add,delete,combine and rename

* minor fix

* update docs

* update pylint

* update pylint

* tests

* Update documentation

* fix type command

* index

* improve more econometrics for Jer

* improve docs

* fix tests

* fix test

* remove help

* Add in robustness for when you select two dependent variables

* Update Website documentation

Co-authored-by: JerBouma <jer.bouma@gmail.com>
2022-06-01 12:41:45 +01:00
jp
b9e097ef8d Bug/crypto defi vaults command broken #1822 (#1874)
* Add separate view for finbrain for crypto curreny sentiment analysis

* Move json with symbols to separate directory, little refactoring, update readme

* Add screenshot of finbrain for PolkaDot

* Fix defi coindix vaults. Risk param is disabled. Disable urllib3 warning bout not verified request url

* update tests for coindix - cassetes, csvs, txts

* update vaults docs

* Update _index.md

* run crypto tests with record_mode=rewrite

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-06-01 12:16:03 +01:00
Theodore Aptekarev
35ba7fd79f Fix tests and bump pandas version (#1888)
* Fix forex polygon model tests

* Release pandas version lock

* Release pylint version lock on the CI

* Alternative : covid - fix csv separator issue

* FIx spacing change related to pandas upgrade

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-05-31 14:46:45 +02:00
Theodore Aptekarev
0f0604a387 Update pred deps and instructions (#1885) 2022-05-31 12:53:48 +03:00
James Maslek
4e451b4553 Oops this should be fixed (#1881) 2022-05-27 18:48:22 -04:00
James Maslek
7db8fa04e5 Clean up forex menu. Add in polygon load (#1871)
* Clean up forex menu.  Add in polygon load

* Forex candle matches stock with --ma option

* fxempire tests

* forex controller tests

* Test polygon model

* Hugo

* oops

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-05-26 20:54:34 +01:00
didierlopes.eth
385d12803a Add bottom toolbar hint feature flag - helps new users in getting started (#1873) 2022-05-26 16:43:04 +01:00
Colin Delahunty
75d0832682 Improved fraud function (#1855)
* Improved fraud function

* Updated docs

* Didier fixes

* Fixed test

* Added help

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-05-26 09:59:05 +01:00
didierlopes.eth
80b3c01988 Refactor main menu to have: Settings and Feature Flags menus (#1864) 2022-05-24 22:11:40 -04:00