Skip to main content

Quantaforge

Quantaforge is a comprehensive library for creating and backtesting trading strategies.

Features

  • Define custom trading strategies using various indicators, signals, and risk management techniques.
  • Backtest strategies with historical data.
  • Optimize strategy parameters.
  • Generate detailed performance reports.

Installation

pip install quantaforge

Usage

import quantaforge as qf

# Create a new strategy
strategy = qf.Strategy()

# Add a new indicator
strategy.add_indicator(qf.Indicator('SMA', 5))

# Add a new signal
strategy.add_signal(qf.Signal('CrossOver', 'SMA', 5))

# Add a new position
strategy.add_position(qf.Position('Long', 1))

# Add a new risk management
strategy.add_risk_management(qf.RiskManagement('StopLoss', 0.02))

# Add a new portfolio
portfolio = qf.Portfolio('SimplePortfolio', 100000)
strategy.add_portfolio(portfolio)

# Add a new backtest
backtest = qf.Backtest(name='SimpleBacktest', strategy=strategy, portfolio=portfolio)

# Mock data to emulate a 5 day SMA crossover strategy

data = {
    'symbol': ['AAPL'] * 20,
    'close': [150, 152, 148, 151, 155, 160, 158, 162, 165, 170, 175, 180, 190, 210, 200, 190, 180, 170, 160, 150]
}

# Set the data for the backtest
backtest.set_data(data)
strategy.add_backtest(backtest)

# Add a new report
report = qf.Report(portfolio=portfolio)
strategy.add_report(report)

# Run the strategy
strategy.run()
strategy.report.generate()

License

MIT

Metadata

Release files for quantaforge 0.1.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 quantaforge 0.1.3
File Size Uploaded Provenance Actions
quantaforge-0.1.3.tar.gz 10.2 kB Without provenance Details for quantaforge-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 24.7 kB

Release files / quantaforge-0.1.3.tar.gz

Download URL quantaforge-0.1.3.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9b93bbf0499ac028537b9655ee40c775a96b0d848ebc4d50763600e00caf8132
BLAKE2b-256 checksum
How to use checksums
3b1586c79d6b636a6fcf149cd6cebc875dcb1745710d5fd0c0ece8429b47d2e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.10

Release files / quantaforge-0.1.3-py3-none-any.whl

Download URL quantaforge-0.1.3-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6063f9f534305af6527b4ee85bb68a8a58c710ca516d7fbbb40598bd61d8038
BLAKE2b-256 checksum
How to use checksums
8fe059803741d3098363ffb96e60f46b007fb359295302ca4e09fbf791ddb987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.10

Security for quantaforge 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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