Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Economic calendar command #2043

Merged
merged 32 commits into from
Jul 12, 2022
Merged

Economic calendar command #2043

merged 32 commits into from
Jul 12, 2022

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Jul 4, 2022

Description

This PR adds an economic calendar to the economy menu. The command (ecocal) output is a rich table with information regarding world economic events. The database can be sliced by date, event category, event importance, country and set a GMT time zone. User can get actual, forecast and previous data point for each event (when applicable). Historic data is available as well.

Still have to write tests but would be nice to get some feedback first, particularly on usage and defaults. I believe this data might be useful later on automated reports for e.g. It is quite relevant for any investor or economic researcher that tracks on advanced indicators and arguably accounts for a relevant part of daily market movements.

Examples (after changes):

  • Lisbon time
    image

  • New York time
    image

image

image

  • Summary of the change / bug fix.
  • Screenshot of the feature or the bug before/after fix, if applicable.
  • Relevant motivation and context.

How has this been tested?

  • Please describe the tests that you ran to verify your changes.
  • Provide instructions so we can reproduce.
  • Please also list any relevant details for your test configuration.

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

@Chavithra Chavithra added the feat S Small T-Shirt size Feature label Jul 4, 2022
action="store",
dest="time_zone",
nargs="+",
default=None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the default timezone, we could fetch users' timezone in the settings and populate it dynamically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that makes sense

@minhhoang1023
Copy link
Contributor

Very nice feature! 🚀 Calendar events can give some useful signals on how the economy is doing.

  • When I filtered for events with a high level of importance, an event without any determined level of importance (aka None) still show up. It should instead be hidden.

image

  • Would be nice to add a link to the event. The natural tendency is to read more about certain events to understand their implications. Right now users would need to copy-paste the event name and Google search. Some event names are rather generic, so searches can be incorrect. e.g. Factory Orders (MoM) (May)

  • A minor thing - there is a lot of None in the table. It'd be cleaner to display it as empty strings - gonna be easier to scan for information. Similar to the investing.com source

image

dest="categories",
nargs="+",
default=None,
help="Event category.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add the param choices to restrict only certain values, and to show in documents the available options. Like the interval one below. You already added auto-completion for this purpose, but argparse wouldn't allow for autocompletion if it's not the first argument. Pain in the neck.

image

@montezdesousa montezdesousa marked this pull request as ready for review July 8, 2022 15:49
@minhhoang1023
Copy link
Contributor

we should set a limit on # of events. now i had to scroll a lot get to the top...

image

@montezdesousa
Copy link
Contributor Author

montezdesousa commented Jul 8, 2022

we should set a limit on # of events. now i had to scroll a lot get to the top...

image

Did you pull the last version? 'None' should not be there and title should be "Calendar (GMT+...)" like the screenshots I replaced in the PR. Anyway you mean a limiting argument similar to other commands?

@minhhoang1023
Copy link
Contributor

@montezdesousa yes that's what I mean. And we can set a default limit of 10. As my default is US, the return list of events is very long, spanning over several pages.

@montezdesousa montezdesousa merged commit 4c0b113 into main Jul 12, 2022
@montezdesousa montezdesousa deleted the calendar_backup branch July 12, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat S Small T-Shirt size Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants