Commit Graph

3062 Commits

Author SHA1 Message Date
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
b229ed7570 Fix the available sorting columns in divcal (#2059) 2022-07-07 21:51:50 +01:00
James Maslek
311bdef099 Stop consuming first element of list (#2058) 2022-07-07 15:34:59 -04: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
hjoaquim
e2eab7dc1f Fixes #2044 Stocks/Load - Cannot load monthly/weekly interval with Polygon as source. (#2051)
* fixed polygon timespan, it wasn't using the montly/weekly flags

* validate if the column exists before proceeding with the sort

* if the stock dataframe is empty we'll keep the previous behaviour. also, added quotes to keep the formatting the same as the original message.

Co-authored-by: Chavithra <chavithra@gmail.com>
2022-07-07 16:01:13 +02:00
hjoaquim
583d1632e6 added verification for windows. if start is prior to 1970, convert it to 1970-01-02 (1 day buffer in case of timezone adjustments) (#2056)
reference_1 : https://stackoverflow.com/questions/2518706/python-mktime-overflow-error
reference_2 : https://discuss.python.org/t/please-help-getting-try-except-working-for-yfinance-download/11682/6

Co-authored-by: Chavithra <chavithra@gmail.com>
2022-07-07 13:30:51 +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
cda2e81af5 add labels automatically when issue is created (#2033)
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2022-07-06 00:50:52 +01:00
northern-64bit
85ce998d57 Making the news command pretty with more data (#2045)
* Formatting news command

* Linting

* Linting
2022-07-05 23:31:24 +01:00
DidierRLopes
ac4820cdef Fix trading hours bringing ticker in (#2038)
* fix trading hours bringing ticker in

* fix conditions that were not accounted for

Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-07-05 13:22:41 +01:00
DidierRLopes
eba85a56c5 Fix sorting of candle data (#2032)
* fix sorting of candle data

* fix adjclose sorting

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
2022-07-04 11:21:55 +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
0517135bc9 Fix volatility of crypto (#2039)
* fix volatility of crypto

* fix wrong annual value being used

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-07-04 09:22:25 +02:00
DidierRLopes
2ffaace7c3 fix documentation (#2037)
Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-07-03 23:44:57 +01:00
DidierRLopes
17fc484651 fix messari spelling (#2036)
Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-07-03 22:34:39 +01:00
DidierRLopes
066d347c63 replace curve brackets by square ones (#2040) 2022-07-03 21:31:04 +01:00
soggyomelette
45f0a0a049 Fixes #2018 and updates default dates in dd_controller.py (#2028)
* Fixes #2018 and updates default dates in dd_controller.py

* Fixing linting

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-07-02 12:07:53 +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
Jeroen Bouma
a4d1d071ca Add in guide to Scripts & Routines (#2027)
* Small detail

* Add in Scripts guide

* Add template script

* Add Scripts to menu

* Update Scripts guide

* Add section on Scripts & Routines in the Getting Started guide

* Update _index.md

* Get rid of images
2022-07-02 12:06:24 +01:00
Paul Symonds
0f0e769156 Update stocks_helper.py (#2025)
* Update stocks_helper.py

When a stock is returned:

Market: CLOSEDSENIOR PLC 10p

Fixed to show:

Market: CLOSED
Company: SENIOT PLC 10p

* Update stocks_helper.py

Added logic for US if source requires .US. without this logic Datetime is printed twice.

* Update stocks_helper.py

Updated logic to fix pyLint Error.

* Update stocks_helper.py

* Update stocks_helper.py

Further testing revealed Upper and Lower case issues, if .upper() is used it throws errors.

This function uses yfinance to return info data for tickers. 

Yahoo does not have .US suffix for US stocks but other feeds may (will) have this.

Some testing gave the following:

Stock:                                                                                                                                                            │
                                                                                                                                                              
Datetime:                                                                                                                                                         
Timezone:                                                                                                                                                         
Exchange:                                                                                                                                                         
Market:                                                                                                                                                           
Currency:                                                                                                                                                         
Company:  

or:

Datetime: 2022 Jul 01 07:51
Timezone: Europe/London
Exchange: LSE
Currency: GBp
Market:   OPENSENIOR PLC 10P


or this:

Datetime: 
Datetime: 2022 Jul 01 02:44
Timezone: America/New_York
Currency: USD
Market:   CLOSED
Company:  

Final Result is this:

Datetime: 2022 Jul 01 02:51
Timezone: America/New_York
Currency: USD
Market:   CLOSED
Company:  Apple Inc.


I don't think this function is overly complex and could do with a refactor at some point.

* Update stocks_helper.py

fixed Black error

* Simplified if statement

* Reverted poetry

Co-authored-by: colin99d <colin99delahunty@gmail.com>
Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
2022-07-01 11:18:56 -04:00
James Simmons
951c94db97 Adding integration tests to intel mac workflow (#2020) 2022-07-01 13:49:34 +01:00
Jeroen Bouma
c98c467e47 Add in Economy Guide to the website (#2016)
* Add in Economy Guide (WIP)

* Add in Example text

* Update _index.md

* Remove images

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-06-30 15:47:01 +02:00
Jeroen Bouma
d0aaa9ab5e Add in Cryptocurrency guide and remove the old 'Guides' folder (#2015)
* Add in Crypto guide

* Remove redundant folder

* Fix links
2022-06-30 14:01:41 +01:00
Jeroen Bouma
ddef89d115 Add in Forex Menu guide and apply redirect to a terminal page that shouldn't exist (#2011)
* Add redirect

* Add in Forex guide

* Update _index.md

* Remove images

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-06-30 09:35:14 +02:00
Colin Delahunty
282132f059 Fix yf FA quarterly issue (#2017)
* Fixed issue with yf

* Added todo
2022-06-30 00:09:37 +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
James Simmons
7cdd9ae23e Build workflow 1 (#1999)
* Build workflow to save .openbb folder for testing later

* Adding prediction install to workflow

Co-authored-by: Chavithra <chavithra@gmail.com>
2022-06-29 11:58:07 -05: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
Jeroen Bouma
8324f739b6 Add in a new GIF that better demonstrates the terminal (#2010)
* Add new GiF

* Get rid of the old gif

* Add in new GIF

* Update README.md

* Update README.md
2022-06-29 11:50:02 +01:00
James Simmons
2c2112df9e Changing menu dialogue for keys menu to be more apparent on how to add an api key (#1971)
* Changing menu dialogue for keys menu to be more apparent on how to add an api key

* Changing key dialogue based on suggestions
2022-06-28 20:41:10 +01:00
soggyomelette
c6f7912aaf Warning messages in #2002 (#2004)
* Update requirements-full.txt

Updating finvizfinance version

* Update requirements.txt

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-06-28 17:50:43 +01:00
soggyomelette
1fe1f8714f Fix: crypto/headlines missing Legend & wrong Chart Title (#1997)
* Update stockanalysis_model.py

* Update etf_controller.py

* Fix tests and linting

* 'Fixing #1978 by switching to check_positive_float'

* 'Fixes #1977 by switching labels'

* Fixes #1992 by modifying finbrain_crypto_view.py

* 'Changed the markers to white to avoid confusion'

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: JerBouma <jer.bouma@gmail.com>
2022-06-28 16:44:50 +01:00
Danglewood
2e7b54205f Adds Stocks/DD Guide (#2001)
* Adds Stocks/DD Guide

* Demo routine for the Stocks/DD menu

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-06-28 16:28:35 +01:00
Danglewood
d23d8dd698 Fixed typo - SCI --> SIC (#2000) 2022-06-28 10:49:53 +01:00
soggyomelette
fe96ab2dd8 Fixes stock price and metrics in #1993 (#1998) 2022-06-27 20:58:54 +01:00
minhhoang1023
67e3b3be13 Add Introduction to Cryptocurrency Guide & Fix crypto/find (#1970)
* Add Introduction to Cryptocurrency

* Add images

* Finish guides

* Add images

* Fix find not working

* Add keywords

* Update top_level_menu.md
2022-06-26 23:57:51 +01:00
Danglewood
9d75692af4 Fixed bad URL to options screener intro (#1990) 2022-06-26 01:51:08 +01:00
Sam Kerr
b40868491e Handle errors when tickers can't be loaded (#1986)
* Add error handling for when financial statements cannot be parsed

* Formatting updates

* Remove a rogue print statement

* Fix a copy paste error

* Formatting issues with Black

* Use sentinel values rather than exception based workflow

* Remove unneeded change

* Fix formatting

* Don't use exceptions for handling error

* Fix a null check case

* Add an error print string to pass tests

* Remove exception throwers

* Update docs since we don't throw this exception
2022-06-25 16:05:06 +01:00
soggyomelette
5790f0bfa9 [Bug] ta/bbands: when value contains a decimal: error: argument -s/--std: invalid check_positive value: '4.5' (#1988)
* Update stockanalysis_model.py

* Update etf_controller.py

* Fix tests and linting

* 'Fixing #1978 by switching to check_positive_float'

* 'Fixes #1977 by switching labels'

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: JerBouma <jer.bouma@gmail.com>
2022-06-25 16:04:13 +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
teh_coderer
d45bd55ec8 disnake intents patch (#1987)
* disnake intents patch

* update docs

* update bots readme
2022-06-24 23:52:58 +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
Jeroen Bouma
a4de5763e6 Add in Introduction to Funds guide (#1979)
* Small fixes

* Add in Introduction to Funds page

* Update _index.md

* Delete images and fix some grammar

Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
2022-06-24 10:10:58 +02: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