Skip to main content

numin package

Project description

numin Package

numin is a Python package designed for algorithmic trading and backtesting providing an API called NuminAPI.

Features

  • Data Retrieval: Download training, round, and validation data.
  • Prediction Submission: Upload prediction CSVs to the server with built-in validation.
  • Real-Time Round Management: Fetch the current trading round from the server.
  • Backtesting: Run backtests on user-defined strategies with support for additional features and discretization.
  • File Management: Upload and deploy files via Anvil's server.
  • Returns Summary: Retrieve and format live (or simulation) trading returns.

Supported Methods

  • Data Download:

    • get_data(data_type: str)
      • Fetches data from the server based on the type (training, round, or validation).
  • Prediction Submission:

    • submit_predictions(file_path: str)
      • Submits a CSV file of predictions to the server.
      • Note: The file must include mandatory columns ["id", "predictions", "round_no"] and optional columns ["stop", "target", "tLimit"] (if provided, they must be integers between 1 and 100).
  • Round and Validation Data:

    • get_current_round()
      • Retrieves the current round number from the server.
    • fetch_validation_data(date: str)
      • Downloads validation data for a given date.
    • get_validation_dates()
      • Lists available validation dates on the server.
  • Backtesting:

    • run_backtest(user_strategy : str, date:str, val_data:str, val_df:DataFrame,result_type="results" or "returns")
      • Executes a backtest using a user-provided strategy function on the given date.
    • display_results(backtest_results: results as above, validation_dataframe: dataFrame, indicators: list of indicators to show e.g. used for entry by strategy )
      • Displays results of a backtest in a readable format with entry, exit prices, p/l etc.
      • Input can be merely the date, in which case the data is downloade; if a csv file path is provided in val_data then that file is taken; if a dataframe is provided in val_df that is taken. (e.g. using the dataframe returned by fetch_validation_data.)
  • File Upload and Deployment:

    • upload_file(file, user_id, filename)
      • Uploads a file to remote storage via the Anvil server.
    • deploy_file(filename: str, user_id: str)
      • Deploys a file for a given user.
  • Live Returns Summary:

    • show_returns(user_id, mode="live"/"sim")
      • Retrieves and displays a formatted summary of returns for the strategy associated with the given user ID

Installation

Install numin using pip:

pip install numin

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

numin-2.0.1.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

numin-2.0.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file numin-2.0.1.tar.gz.

File metadata

  • Download URL: numin-2.0.1.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for numin-2.0.1.tar.gz
Algorithm Hash digest
SHA256 fc7f5b89a196efaa6ecfd99b25748073342893a015d8bf4a0e121dc16872c3ff
MD5 df3125befdf790225949fad17ca437fa
BLAKE2b-256 1e441e609c34bb59daf8bdd80e75b0107176e9f4e61bba9bde79a60cc3fb196c

See more details on using hashes here.

File details

Details for the file numin-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: numin-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for numin-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e4fa2bd5d5d34e30943389a7888e94dd1f64a2c6dda28fc42ed409a58ed1772
MD5 40c606024c3fb3710b26cdfc538759e1
BLAKE2b-256 eb09fc98bc7c49bce453487ce1bf54e90082bcc63d3263f6ab209c2e5c965c98

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