Skip to main content

A backtester and spreadsheet library for security analysis.

Project description

pinkfish

A backtester and spreadsheet library for security analysis.

Why another python backtesting library? How is pinkfish different? Simple, I couldn't find a python backtesting library that allowed me to backtest intraday strategies with daily data. Even simple strategies like 'buying on the close' on the SAME day a 'new 20 day high is set' were not allowed. Additionally, I was put off by the complexity of some of the libraries available, and wanted something simple, that doesn't get in the way, and just allows me to test my trading ideas. One user commented that Pinkfish is "very lightweight and to the point". I didn't set out to write a new backtesting library, but I had to. Daily data is free; minute and tick data are typically not. Using minute and tick data can require hours to run vs seconds for daily data.

Some of the key features of pinkfish:

  • leverages pandas for dataframe, spreadsheet like features
  • comes batteries included with the most common technical indicators
  • also integrates with ta-lib or pandas_ta for more advanced indicators
  • leverages matplotlib for making financial graphs
  • uses daily data (vs minute or tick data) for intraday trading
  • uses free daily data from yahoo finance
  • simple to use python API
  • backtest single stock/ETF strategy or a portfolio (basket of stocks/ETFs)
  • backtest short selling strategies and simulate trading with margin
  • write optimizers to select the best parameters
  • create spreadsheets within Jupyter Notebook by utilizing pandas dataframes and itable formatting

Installation

For basic installation of the pinkfish library (not including ta-lib):

# Note: It's recomended to create a new python virtual environment.

$ git clone https://github.com/fja05680/pinkfish.git
$ cd pinkfish
$ python -m venv venv
$ pip install setuptools
$ . venv/bin/activate
$ python setup.py install (or develop)

--OR--

For developer installation with ta-lib, follow the instructions located at:
https://fja05680.github.io/pinkfish/

Examples

Many more examples in examples folder. They are roughly ordered by complexity beginning with the easiest.

Documentation

The pinkfish API documentation: https://fja05680.github.io/pinkfish/docs/html/pinkfish/index.html

Pinkfish on youtube

https://www.youtube.com/channel/UCsPHH2UBn8Fz0g0MGrZ2Ihw

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinkfish777-0.1.2.tar.gz (131.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinkfish777-0.1.2-py3-none-any.whl (101.8 kB view details)

Uploaded Python 3

File details

Details for the file pinkfish777-0.1.2.tar.gz.

File metadata

  • Download URL: pinkfish777-0.1.2.tar.gz
  • Upload date:
  • Size: 131.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pinkfish777-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4071c4367de9f9f35f891109cf8f0233c1c8b8f043cf203c637975d528920a94
MD5 914ff934e02ccbf7b72c5cb7ff02dac1
BLAKE2b-256 542453caa076e6151d1fa87defda8b1cdb4e3ed967a0458365925579a090c3be

See more details on using hashes here.

File details

Details for the file pinkfish777-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pinkfish777-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 101.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pinkfish777-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06e58ec1444a85c4a623f2391aa2cee229874f8d96e7b03debe8a0bcfe47a265
MD5 4aef0c78cbcab2c1563d1c00ac2b4296
BLAKE2b-256 b579f7054db96eb9c268cf7e71a6c5b1771b9ecf5124be2db4dca68c7850ec5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page