Skip to main content

ci-cd codecov Documentation Status

fxtracker

This is a package created as a group project for DSCI_524 Collaborative Software Development of UBC Master of Data Science (MDS) program 2022-2023. Based on the foreign exchange data in Yahoo Finance, this package allows user to perform currency conversion based on the latest available exchange rate, lookup a target exchange rate from historical data as well plotting exchange rate history and profit/loss percentage history by specifying a currency pair (and other input parameters).

The full documentation of this package can also be found on https://fxtracker.readthedocs.io/en/latest/

Function Description

  • fx_conversion
    Convert the input amount of currency 1 to currency 2 based on the latest available exchange rate.
  • fx_rate_lookup
    Lookup for the most recent date on which the input target rate of a currency pair is within the day's high/low.
  • price_trend_viz
    Plot the historical exchange rate of the input currency pair for a specific period of time.
  • pl_trend_viz
    Plot the historical profit/loss percentage of the input currency pair for a specific period of time.

There is a python package (forex-python) relevant to foreign exchange. That package is basically for retrieving exchange rates and bitcoin prices in plain text as well as performing conversion. It does not provide visualizations and lookup function like fxtracker does. fxtracker allows user to visualize the trends and understand if a target price of a currency pair of interest is within a reasonable range.

Installation

$ pip install fxtracker

Usage

If the package is installed successfully, users then need the following nine input parameters:

curr, target_px, start_date, end_date, chart_type, option, curr1, curr2, amt. The output of the functions will be in forms of a datetime string, a float and interactive plots from the "altair" package.

fxtracker can be used to convert a specific amount of money from one currency to another, find the most recent date on which the target price falling between day high and day low of that day, visualize the trend of the exchange rate of a currency pair and the trend of the profit and loss of a currency pair between the selected start date and end date.

The functions can be imported from the package as follows:

from fxtracker.fxtracker import fx_conversion
from fxtracker.fxtracker import fx_rate_lookup
from fxtracker.fxtracker import price_trend_viz
from fxtracker.fxtracker import pl_trend_viz

To convert a specific amount of money from current currency (curr1) to desired currency (curr2):

fx_conversion('EUR', 'USD', 150.75)

163.68

To look up the most recent date on which the target price falling between day high and day low of that day:

fx_rate_lookup('EURUSD', 1.072)

'2023-01-10'

To visualize the trend of the exchange rate of a currency pair between the selected start date and end date:

price_trend_viz('EURUSD', '2018-12-01', '2022-12-01', 'High').show()

To visualize the trend of the profit and loss of a currency pair between the selected start date and end date:

If a line chart is specified in the input:

pl_trend_viz("EURUSD", "2020-01-01", "2022-01-01", 'line').show()

If an area chart is specified in the input:

pl_trend_viz("EURUSD", "2020-01-01", "2022-01-01", 'area').show()

Dependencies

  • python = "^3.9"
  • pandas = "^1.5.2"
  • altair = "^4.2.0"
  • numpy = "^1.24.1"
  • plotly = "^5.12.0"
  • yfinance = "^0.2.3"
  • ipykernel = "^6.20.2"
  • altair-viewer = "^0.4.0"

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

fxtracker was created by Sarah Abdelazim, Markus Nam, Crystal Geng and Lennon Au-Yeung. It is licensed under the terms of the MIT license.

Credits

fxtracker was created with cookiecutter and the py-pkgs-cookiecutter template.


Release files for fxtracker 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fxtracker 1.0.3
File Size Uploaded
fxtracker-1.0.3.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fxtracker 1.0.3
File Interpreter ABI Platform
fxtracker-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / fxtracker-1.0.3.tar.gz

Download URL fxtracker-1.0.3.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8dca9b88dafeafccf5a0e40e12d231680fdbadcc6226534dba9b4faa395cf42b
BLAKE2b-256 checksum
How to use checksums
670263d2d517ad62ce10a669ec277ddcbdb2cbbb50b53e7a4a110e55eb070ad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / fxtracker-1.0.3-py3-none-any.whl

Download URL fxtracker-1.0.3-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3387570fa22337d8948b2e2e0cdc262f1027901f4d82a498dd7983d6b9f578e1
BLAKE2b-256 checksum
How to use checksums
3dc5c34d5609dfe0c74ccec923b4fb044ec10f6997470419091b0761d342db52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page