A pluggable trading-strategy framework: indicators, market data adapters, backtesting, and a Strategy interface you implement yourself.
Project description
confluence-engine
A pluggable trading-strategy framework for Python: technical indicators, market-data adapters (crypto/forex/idx), a backtester, and a clean Strategy interface you implement yourself. Bring your own signal logic and scoring — the framework stays out of your way.
Install
pip install confluence-engine
Quickstart
from confluence_engine import (
AdapterConfig, StrategyConfig, BreakoutDemo,
get_adapter, calculate_indicators, run_backtest,
)
cfg = StrategyConfig()
df = get_adapter("crypto", AdapterConfig(exchange="binance")).fetch_ohlcv("BTC/USDT", "1h", limit=300)
df = calculate_indicators(df, cfg.ema_fast, cfg.ema_slow, cfg.rsi_length)
print(run_backtest(df, BreakoutDemo(), cfg))
Write your own strategy
from confluence_engine import Strategy, Signal, StrategyConfig
import pandas as pd
class MyStrategy:
name = "my-strategy"
def generate_signal(self, df: pd.DataFrame, config: StrategyConfig) -> Signal:
last = df.iloc[-1]
if last["rsi"] < 25:
return {"signal": "BUY", "reason": "deeply oversold", "score": 0.8,
"stop_loss": None, "take_profit": None}
return {"signal": "HOLD", "reason": "wait", "score": 0.0,
"stop_loss": None, "take_profit": None}
Pass an optional scorer=lambda df, config: 0.0..1.0 to run_strategy / run_backtest; signals scoring below config.confidence_threshold are downgraded to HOLD.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file confluence_engine-0.1.1.tar.gz.
File metadata
- Download URL: confluence_engine-0.1.1.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f16107d85039ae52caefa870e39c91bec636aa493138c69101e8ed0dbe80e2a9
|
|
| MD5 |
98f50759040b67bb6ac152b3e0e400df
|
|
| BLAKE2b-256 |
3abaf4077f3b6ddc7c538d9ef5acdb08d69ff835a683b9c78852d505eb8c7bfb
|
Provenance
The following attestation bundles were made for confluence_engine-0.1.1.tar.gz:
Publisher:
publish.yml on Rustam335/confluence-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
confluence_engine-0.1.1.tar.gz -
Subject digest:
f16107d85039ae52caefa870e39c91bec636aa493138c69101e8ed0dbe80e2a9 - Sigstore transparency entry: 2194835105
- Sigstore integration time:
-
Permalink:
Rustam335/confluence-engine@13638af72f94237dd9aad17b8e8ace46f895a9bf -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Rustam335
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13638af72f94237dd9aad17b8e8ace46f895a9bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file confluence_engine-0.1.1-py3-none-any.whl.
File metadata
- Download URL: confluence_engine-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47147b1e7f1e35c6858c67285e6194aec7dd33dd01679872bf887c9786dec5c8
|
|
| MD5 |
adce250f00b8a0c304df283067a657b9
|
|
| BLAKE2b-256 |
9cde907233b72f3ac3bd5489cd7a2845769e2b89a92f2da4820db056ec2b50a9
|
Provenance
The following attestation bundles were made for confluence_engine-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Rustam335/confluence-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
confluence_engine-0.1.1-py3-none-any.whl -
Subject digest:
47147b1e7f1e35c6858c67285e6194aec7dd33dd01679872bf887c9786dec5c8 - Sigstore transparency entry: 2194835116
- Sigstore integration time:
-
Permalink:
Rustam335/confluence-engine@13638af72f94237dd9aad17b8e8ace46f895a9bf -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Rustam335
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13638af72f94237dd9aad17b8e8ace46f895a9bf -
Trigger Event:
push
-
Statement type: