Commit Graph

162 Commits

Author SHA1 Message Date
David Khouya
abf79a5249 Handle KeyboardInterrupt on user input read (#1124)
Co-authored-by: David Khouya <david.khouya@leddartech.com>
2022-01-02 22:03:36 +00:00
Didier Rodrigues Lopes
c961fcb278 Add whatif scenario feature (#1122)
* Add whatif scenario feature

* fix tests
2022-01-01 17:57:52 +00:00
Colin Delahunty
18180c2126 Fix to dcf command (#1115)
* Fix to dcf command

* Forgot to take out a comment

* Dider change

* user data patch for now
2022-01-01 17:28:26 +03:00
Didier Rodrigues Lopes
78f110b389 ETF context new and improved (#1103)
* Add lookup commands

* main ETF commands

* Add technical analysis to ETF

* add prediction techniques to ETF

* add comparison analysis to etf

* allow to select nr of holdings on load

* add shold and summary commands to ETF

* minor improvs

* screener on ETF menu

* add etf/scr wsj commands

* readd compare command

* add sbc to etf/screener

* rename chold and shold

* fix rogue etf and reset

* minor corrections

* minor menu print improv

* legend of weights and title of plot

* refactor screener to screener and disc on ETF

* add ETF scripts
2021-12-30 03:21:21 +00:00
Didier Rodrigues Lopes
af62b22bb7 have an empty default export (#1112) 2021-12-30 02:42:29 +00:00
Didier Rodrigues Lopes
2e4d22458d fix infinite loop (#1111) 2021-12-30 02:26:14 +00:00
Didier Rodrigues Lopes
d59d6b45b7 minor fix to hcorr (#1107) 2021-12-30 00:16:07 +00:00
Didier Rodrigues Lopes
11d89b7928 Tiny tiny fixes (#1101)
* fixes

* fixes found on discordbot
2021-12-26 22:31:34 +00:00
Didier Rodrigues Lopes
4e57fc0359 minor fixes that saw while showing terminal to my parents (#1096) 2021-12-24 19:03:29 +00:00
Didier Rodrigues Lopes
b4a876ac6b fix minor bug (#1091)
* fix minor bug

* fix pylint
2021-12-23 23:54:55 +00:00
Didier Rodrigues Lopes
52d9c29242 Fix option screeners and add danglewood presets (#1085)
* Fix option screeners and add danglewood presets

* black linting (#1086)
2021-12-23 03:09:47 +00:00
Didier Rodrigues Lopes
63b2c72f6a Remove unnecessary return self.queue (#1083)
* remove unnecessary return self.queue

* fix some bugs found by running script files

* add ticker to crypto/dd reset
2021-12-22 22:39:32 +00:00
Didier Rodrigues Lopes
e89f257bef add use ion to plots so it doesn't hang (#1081) 2021-12-22 15:12:48 +00:00
Didier Rodrigues Lopes
8c84ff2831 improve some stuff on ca menu (#1080) 2021-12-22 10:17:20 +00:00
Didier Rodrigues Lopes
a85758c9ec Big UX improvement (#1041)
Co-authored-by: jmaslek <jmaslek11@gmail.com>
Co-authored-by: Chavithra <chavithra@gmail.com>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: Didier Rodrigues Lopes <dro.lopes@campus.fct.unl.pt>

* improve user experience phase 1

* add difflib replacement

* implement auto-complete on discovery menu

* auoto-complete, difflib,jump through menus with cd

* Updating tests : terminal

* improve navigation on gst

* add q command to terminal.py

* usage instructions

* Updating tests : terminal

* fix cd command

* vars updated

* show menu when user is going through menus

* allow user to forget the intiail / on scripting

* terminal to accept text file with configuration

* refactor -n to -l and clean code

* add all commands to the tests_stocks_disc

* remove fds from disc since we have search on stocks/ and stocks/sia

* hopefully fix tests

* skip test

* fix completer type and calling menu after command for stocks/disc

* show help menu when moving forward/backwards in menus

* skip test

* skip test - bug fix

* add reset, help and quit to choices

* improve stocks/disc controller

* refactor sia menu

* UX improvements for sia menu

* improve ux design

* refactor ca controller

* fix infinite loop

* improve ux on dps controller

* Add capability of going back from a menu going into a menu

* Ux economy (#1056)

* First round of UX improvements on economy menu

* Do fred menu + sample tests file

* revert to > on menu

* rename jobs file to .gst

* remove cd option

* improve return

* final refactoring of disc_controller

* fix ca,dps,sia,disc,stocks and terminal controllers

* work on ba_controller menu

* fix reset and try_except

* UX on screener controller

* fix for full reset name

* Ux etfs (#1059)

* Refactor ETF menu for new UX

* Add couple more examples to test

* r->reset

* Clean up switch

* gov menu refactored

* fix reset issue

* 80% of refactoring options and pricing/payoff menu is done

* improve payoff controller

* minor fix

* fix: refactor pred and ta stocks controller

* fix: refactor fa(and fmp) controllers

* fix: refactored dd controller (still missing .gst tests)

* fix infinite loop bug

* refactor options controller

* add tests for payoff and pricing

* fix reset for options

* UX Upgrade for Crypto controller(s) (#1049)

* refactor crypto controller

* refactor crypto/defi controller

* added simple test and fixes not returning queue in commands

* Clean up unused functions / iex load (#1047)

* Clean up unused functions and adjust iex load function to not depend on dates

* Had an incorrect tab on s_start definition

* wrong default arg

* regenerate pytest yml

* Comment out parametrization

* Tests : Stocks > Discovery (#1050)

* Updating tests : stocks/discovery/ark

* Updating tests : stocks/discovery/fidelity

* Updating tests : stocks/discovery/fidelity

* Updating tests : stocks/discovery/fidelity

* Updating tests : stocks/discovery/seeking_alpha

* Updating tests : stocks/discovery/seeking_alpha

* Updating tests : stocks/discovery/shortinterest

* Updating tests : stocks/discovery/shortinterest

* Updating tests : stocks/discovery/seeking_alpha

* Updating tests : stocks/discovery/shortinterest

* Updating tests : stocks/discovery/disc_controller

* Updating tests : stocks/dd

* Updating tests : stocks/fa

* Updating tests : stocks/discovery/financedatabase

* Updating tests : stocks/discovery/finnhub

* Updating tests : stocks/discovery/geekofwallstreet

* Updating tests : stocks/discovery/marketbeat

* Updating tests : stocks/discovery/nasdaq

* Updating tests : stocks / discovery / yahoofinance

* Updating tests : black

* Updating tests : unused import

* Updating tests : stocks/discovery/ark

* Tests : Stocks > Doc + Helpers + Government (#1051)

* Updating tests : stocks/government/controller

* Updating tests : stocks/government

* Updating tests : conftest

* Updating tests : stocks > government

* Updating tests : stocks/government

* Updating tests : docs

* Tests : Stocks > Insider (#1054)

* Updating tests : stocks > helper

* Updating tests : doc

* Updating tests : clean stocks > fa > av

* Updating tests : stocks/insider/controller

* Updating tests : stocks/insider/business insider

* Updating tests : stocks/insider/finviz

* Updating tests :  stocks/insider/openinsider

* Updating tests :  stocks/insider/controller

* Updating tests : black

* Updating tests : stocks/insider/controller

* Tests : Stocks > Backtesting + Behavioural Analysis  (#1057)

* Updating tests : add __init__ files

* Updating tests : stocsk/behavioural_analysis

* Updating tests : black

* Updating tests : stocks/backtesting

* Updating tests : stocks/backtesting

* fix: converted top to limit arguments

* fix: refactor disc controller, updated docs

* fix: refactor dd_controller and docs

* fix: refactor nft controller and docs

* fix: pass test temporarily, onchain controller refactor, docs

* fix: overview controller refactor, fix quit command

* fix: linting issues

* fix: refacot ta controller

* fix: refactor pred controller

* fix: linting

* fix: crypto controller

* fix: added tests, updated all controlers

* fix: menu print renamed from stocks to crypto controller, added tests

* fix: fix faster function execution

* Fix annoying pylint C0201 error

* fix: renamed commands to long format

* DISC Cleanup (#1058)

* Get rid/cleanup of marketbeat functions

* Get rid of last unused disc function + fix related tests

* fix test

* Dividend History Chart (#1053)

* Dividend History Chart

* changed to default number 10

* changed divs flag default to false

* updating the expected result for test_fa_controller.

* else statement

* fix: added load on dd

* fix: added autocompletion in all commands with argument choices

* fix: linting

* Workflows + Stocks > Insider (#1061)

* Updating code : stocks/insider remove unused file

* Updating workflows : tests - set mypy==0.910

* fix: linting

* Fixing Linting (#1062)

* Updating code : fixing linting

mypy message = Too many arguments for <lambda>

* Updating workflows : allow newest mypy version

* Updating code : apply black

* Updating code : black

* fix: updated predict controller help to match stocks

* Ux: portfolio (#1063)

* First step of portfolio UX

* Add all broker controllers to UX stuff

* UX Improvement for PO

Co-authored-by: Didier Rodrigues Lopes <dro.lopes@campus.fct.unl.pt>

* UX Improvement for resources (#1064)

Co-authored-by: Didier Rodrigues Lopes <dro.lopes@campus.fct.unl.pt>

* UX: stock/bt (#1065)

* UX: stocks>qa (#1068)

* fix mypy lambda

* skip tests for now

* remove unused paths.py

* rename tests/simulator to tests/e2e

* refactor options/screener menu

* UX : move `gst` files location

* fix stocks_controller

* UX upgrade of the Forex menu (#1048)

* Add basic forex menu test

* Add forex routes to terminal paths

* Remove commands from paths because they're not menus

* WIP Refactor forex controller

* refactor crypto controller

* Remove commented code

* Improve user output with printed text

* Add "help" back to the list of choices

* Enable the command queue for the forex controller

* refactor crypto/defi controller

* Fix candle chart blocking the terminal

* Black

* Return help and reset to the list of known args

* added simple test and fixes not returning queue in commands

* Add currency codes loading to the av_model

* Return the queue in edge cases (when commands don't process)

* Split select into to and from to enable autocompletion

* Style text output

* Stop printing help after the execution of every command

* Update test scenarios

* Black

* fix: converted top to limit arguments

* fix: refactor disc controller, updated docs

* Delete oanda the old view file that was moved into the oanda menu

* fix: refactor dd_controller and docs

* fix: refactor nft controller and docs

* fix: pass test temporarily, onchain controller refactor, docs

* fix: overview controller refactor, fix quit command

* fix: linting issues

* fix: refacot ta controller

* fix: refactor pred controller

* fix: linting

* fix: crypto controller

* fix: added tests, updated all controlers

* fix: menu print renamed from stocks to crypto controller, added tests

* fix: fix faster function execution

* Implement basic UX improvement of the oanda controller

* Update the forex controller

* Fix annoying pylint C0201 error

* Add latest convention changes to the forex controller

* fix: renamed commands to long format

* fix: added load on dd

* Merge the latest updates of the controller design

* fix: added autocompletion in all commands with argument choices

* fix: linting

* fix: linting

* fix: updated predict controller help to match stocks

* Update the forex menu e2e test scripts

* Add check_non_negative_float helper

* Update the controller with the latest changes to the convention

* Update the currency pair loading mechanism

* Move data models logic to the models file

* Update update oanda views to be interact with the models

* Upgrade oanda controller

* Remove raw stocks ba and eda code from the forex menu

* Update "help wanted" banner for ba and eda in forex menu

* Remove remainders of stocks ba and eda from forex context

* Improve typing, docstrings and error messages

* Remove stocks ba and eda code that was merged from other ux branches

* Add fixes that prevented incorrect argument handling

* Remove -argument from the candles call
If there is an expected agr `-g` and you put an incorrect argument
`-argument` the difflib will interpret `argument` as `g`

Co-authored-by: jose-donato <zmcdonato@gmail.com>
Co-authored-by: Didier Rodrigues Lopes <dro.lopes@campus.fct.unl.pt>

* fix reset for menus that require ticker

* UX improvement on research menu

* skip insider controller test

* initial refactoring of insider_controller

* improve insider controller ux part 2

* finish refactoring ins controller ux menu

* fix bug of when commands in queue have args

* skip test

* comment test stuff

* UX: stocks>qa (#1071)

* refactor return self.queue

* fix return None

* minor fix

* minor tabulate fix

* Get rid of leading '/' in terminal and add some newlines on quits. (#1074)

* Get rid of leading '/' in terminal and add some newlines on quits.

* print crypto help on menu entry

* looks like a format issue here...

* newlines on quit

* remove unnecessary line break

* fix pylint issue

* refactor

* refactor

* allow portfolio optimization to quit context

* add exit at end of scripts

* improve dd_controller

* test ux in stocks/dd menu

* Ux upgrade for reports context (#1075)

* Refactor reports and upgrade them with the latest controller convention

* Add test scenarios for the reports context

* test ux stocks/ta

* ux branch scripts/ta

* improvement on main param

* Upgrades for the UX upgrade for the fa and fa/fmp menus (#1076)

* Change --num to --limit

* Remove inconsistent/unreliable functions from the choices list

* Improve docstring compliance with numpy doc format

* Fix hardcoded class id in dcf scrapper

* Fix annoying pylint error in discordbot that was blocking the hook

* Add test scenarios for the fa and fa/fmp menus

* Fix forgotten replacement of --num to --limit

* Fix tests

* Return some excluded commands to the choices list

* Fix dd report to reflect the updates

* Fix set function not returning the queue

* Update gst test files

* fix exit on ca from another submenu

* fix changes of options/screener

* fix dps controller

* fix fa when running out of AV calls

* Fix TVL plot locking interpreter during defi test

* Add exception handling for broken coingecko scrapper

* skip fa/av test that fails

* fix dps tests

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
Co-authored-by: jmaslek <jmaslek11@gmail.com>
Co-authored-by: jose-donato <zmcdonato@gmail.com>
Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
2021-12-21 15:19:23 +03:00
Artem Veremey
7b3852a25a Initial implementation of logging (#1069)
* Initial implementation of logging

* Fixing pyupgrade

* Fixing pylint

* Updating per suggestions
2021-12-19 10:32:27 +03:00
Chavithra
73624dcc18 Fixing Linting (#1062)
* Updating code : fixing linting

mypy message = Too many arguments for <lambda>

* Updating workflows : allow newest mypy version

* Updating code : apply black

* Updating code : black
2021-12-16 14:03:40 +01:00
Chavithra
2f010c5287 Workflows + Stocks > Insider (#1061)
* Updating code : stocks/insider remove unused file

* Updating workflows : tests - set mypy==0.910
2021-12-16 11:21:33 +00:00
Danglewood
b82e4225b6 Dividend History Chart (#1053)
* Dividend History Chart

* changed to default number 10

* changed divs flag default to false

* updating the expected result for test_fa_controller.

* else statement
2021-12-15 10:17:43 -05:00
jmaslek
aacbc911be DISC Cleanup (#1058)
* Get rid/cleanup of marketbeat functions

* Get rid of last unused disc function + fix related tests

* fix test
2021-12-15 14:59:41 +00:00
jmaslek
e362569c63 Clean up unused functions / iex load (#1047)
* Clean up unused functions and adjust iex load function to not depend on dates

* Had an incorrect tab on s_start definition

* wrong default arg

* regenerate pytest yml

* Comment out parametrization
2021-12-11 15:07:47 +00:00
Colin Delahunty
0be4c8a2d7 Binomial Options Pricing (#1017)
* Added variables for binom function

* Finished binom function

* Updated .ipynb handling

* James updates

* Expanded definitions

* Expanded description
2021-12-08 16:23:03 -05:00
Didier Rodrigues Lopes
5a3bf70953 refactor load command (#1034)
* refactor load command

* fix reports based on code changes

* Fixing tests : stocks > dd > business insider

* Fixing tests : stocks > dd > controller

* add start to load

* fix minor bug

* fix bug for exchanges

* minor improvs

* add load to technical analysis

* fix bug for exchanges

* minor enhancement

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2021-12-08 00:18:58 +00:00
Chavithra
2afb1bc6d3 Fix stocks (#1035)
* Fix Stocks > FA > Eclect US

* Fix Stocks > FA > Market Watch

* Fix Stocks > FA > Eclect US : black

* Fixing linting
2021-12-07 12:34:45 +00:00
Didier Rodrigues Lopes
c1b2787783 Fix finviz news (#1033)
* fix q on nft controller

* fix finviz news function - #1006
2021-12-07 00:49:04 +00:00
Didier Rodrigues Lopes
60b39ca05f Sector and Industry Analysis Improvement (#1019)
* Improve menu with 2 more commands

* prepare for code improvement

* Improve sia filtering parameters

* fix minor bug

* implement cpis command

* consider excluding/including exchanges in stats

* Add cpcs command to sia

* add cpci command to sector and industry analysis

* optimize implementation of financials on sia

* Add a lot of additional commands to sia controller

* bump financedatabase to 1.0.2

* remove yield and dividend because always null and add forward PE

* Add sector and industry defaults to avoid a 8min loading for new users

* Improve controller for better user experience

* catch exception with exchanges on financedatabase

* from sam to sama

* allow to export all without limitation of companies

* add auto complete for industry sector and country

* Make chart title not leave the screen space by adding line breaks

* improve title further

* add auto complete for metrics

* fix small bug

* Fix pylint C0201 error that was blocking the pre-commit hook

* Fix ndarray division bug

* Add logic to handle missing values

* Split looooooooong company names to 2 lines in the chart

Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2021-12-06 23:27:41 +00:00
jmaslek
377d26fc71 Fix incorrect type on num argument (#1030) 2021-12-06 17:50:00 +00:00
jmaslek
cf14dca9ca Improve UI for intraday plotly candle (#1029) 2021-12-06 17:35:44 +00:00
jmaslek
aa9cf7502f add back end date for load (#1024) 2021-12-05 20:03:31 -05:00
jmaslek
0789bbeffa Remove unused function in av_model (#1022) 2021-12-05 20:03:22 -05:00
jmaslek
cdd04cf392 Add dividend history from yfinance (#1021) 2021-12-05 20:03:07 -05:00
Cameron Beebe
a951a7bdab Feature/price (#961)
* Begin implementing price option for quote in stocks

* Still sane tests.  Note:  Why can't we interface with the ticker (pandas df) itself from within the GST?  E.g. GME.price

* Basic function of price option for quote achieved (e.g. "quote -t GME -p" returns "Price of GME 210.0").  Not sure if this is compatible with non-YF data backends.  Still need to update documentation.

* Removed personalized comments in prep for pull request.  Simple feature works, but IMO brings up questions about ideal function of load and quote functions.

* Changed one comment, also tried testing pre-commit, no output is good?

* Added option [-p] to usage and description

* cleaned extra lines

* Cleaned extra lines

* Test print df in load, fixed formatting for print in quote (hope it passes linter)

* Deleted whitespace for linter...

* Reformatted for linter

* Removed tests for load

* Rewrote but black linter still seems to fail on ```
2021-12-05 14:51:09 -05:00
DidierRLopes
70b0e79f66 Improve comparison analysis controller to not depend on main ticker (#1012)
* improve comparison analysis controller to not depend on main ticker

* make sure there are similar companies selected

* make sure user specifies ticker to get similar companies from first

* improve ca menu and allow rmv to rmv all

* improve comparison analysis menu

* fix ca/sentiment

* improve titles for James :b

* minor styling fix

* improve help message on screener menu

* allow to go from screener to comparison analysis
2021-12-03 23:00:26 +00:00
Theodore Aptekarev
79bacf3f51 Fix mypy hook and Resolve documentation errors (#1008)
* Make mypy pre-commit check non-strict

* Fix mypy pre-commit hook

* Update docstrings to be compliant with sphinx-readthedocs commonmark

* Change report path to be relative to the module and not the terminal.py

* Update class library documentation
2021-12-01 23:19:50 +00:00
DidierRLopes
233d9411f3 Screener controller big improvements (#1007)
* massively improve screener controller

* Add limit of stocks to display
2021-12-01 23:07:33 +00:00
DidierRLopes
d00904a5bf Sector and industry analysis (#995)
* initial version of sector and industry analysis

* Add company per sector/industry on country (and mktcap)

* fix hint

* improve README

* Commit export sia folder

* Export capability

* improve export generic function

* fix linting

* fix spelling correctly parameters

* add a limiting parameter

* black linting

* add tight_layout plot

* Add benchmark to barchart

* add more financials

* add ignore too many lines

* black linting

* Add tqdm for tracking loading progress

* Fix data exporting on cpi and cps when passing a dict to a df without index

* save data for next use of financials in fast mode

* Improve cpi/cps piechart plotting

* linter

* ensure country is selected for cpi/cps

* fix bug with limiting companies message in sia/financials

* add raw/max sectors/industries and min pct allowed

* allow to output raw data and improve pie chart concept

* improve coding guidelines

* fix ordering of func

* improve units and bugfixes

* capitalize helper messages

* allow from sia to jump into ca and improve code/bugs

* linter

* mypy linter

* docstring
2021-12-01 16:42:34 +00:00
Colin Delahunty
ec09805a84 Tests (#957)
* Addded test

* Expanded tests

* Improved tests

* Improved tests

* Reverting to old

* Modern problems require modern solutions
2021-12-01 12:31:27 +01:00
jmaslek
648b7034f7 Arktrade Bug (#999)
* small fixes

* Add type hints

* Add type hints 2

* docstring

Co-authored-by: James Maslek <james@Jamess-MacBook-Pro.local>
Co-authored-by: James Maslek <james@jamess-mbp.myfiosgateway.com>
2021-11-29 22:00:58 -05:00
DidierRLopes
0d42ff97ec Create comparison analysis report (#993)
* Improve comparison analysis - yf model/view

* similar analysis report
2021-11-28 13:57:16 +00:00
Colin Delahunty
0c5098bb63 Added dcf bug fix (#989) 2021-11-27 00:50:59 +00:00
Artem Veremey
ce91919084 Updating __init__.py (#986)
* Updating __init__.py

* Add reports
2021-11-25 20:47:51 +03:00
jmaslek
0d49294f1a Add difflib to controllers (#982)
* First few

* Rest of stock controllers

* Other context controllers

Co-authored-by: James Maslek <james@macbook-pro.myfiosgateway.com>
2021-11-25 20:47:10 +03:00
jmaslek
0883cfaeb6 Add nested completer to all ba functions (#981) 2021-11-25 12:36:18 -05:00
jmaslek
0eb14a3054 Improve ca NaN handling + update pre-commit (#980) 2021-11-25 12:36:04 -05:00
Artem Veremey
a1cba7378a Enable full mypy (#985)
* Add mypy types to dev requirements

* Add optional discord dependencies and generate requirements.txt for DiscordBot

* Add a full run of MyPy

* Fixing mypy errors and ignoring where unclear to establish a baseline

* Don't run mypy on Windows
2021-11-25 08:56:14 -08:00
Artem Veremey
1e8daa1f9a Enabling pylint for DiscordBot (#979)
* Enabling markdown linting for DiscordBot

* Clearning remaining linters

* Enabling pylint for DiscordBot

* Fix DiscordBot imports, pylint and mypy

* Flake8 fixes

* Add an exception for too-many-branches
2021-11-24 17:15:42 -08:00
Artem Veremey
099f1cabe3 Enabling f-string enforcement and fixing offenders (#977) 2021-11-24 09:06:14 -08:00
Artem Veremey
13767e3275 Flake not in 2021-11-23 16:23:31 -08:00
Artem Veremey
683b0d3f88 Enable consider-iterating-dictionary and consider-using-in 2021-11-23 16:18:28 -08:00
jmaslek
0923e0bea3 General UI improvements with sorting/filtering on some functions (#971)
* Add sorting abilities to options>unu

* Sorting on econ>performance

* disc>arkord filtering and hugo updates

* Change ca select to use set

Co-authored-by: James Maslek <james@Jamess-MacBook-Pro.local>
Co-authored-by: James Maslek <james@macbook-pro.myfiosgateway.com>
2021-11-23 15:25:51 -05:00