Skip to content

Add support for order executor and portfolio provider #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ The following example connects to Binance and buys BTC every 2 hours.
import logging.config
from dotenv import load_dotenv

from investing_algorithm_framework import create_app, PortfolioConfiguration, \
TimeUnit, CCXTOHLCVMarketDataSource, Context, CCXTTickerMarketDataSource, \
MarketCredential, DEFAULT_LOGGING_CONFIG, Algorithm, Context
from investing_algorithm_framework import create_app, TimeUnit, \
CCXTOHLCVMarketDataSource, CCXTTickerMarketDataSource, \
DEFAULT_LOGGING_CONFIG, Algorithm, Context

load_dotenv()
logging.config.dictConfig(DEFAULT_LOGGING_CONFIG)
Expand All @@ -93,17 +93,15 @@ bitvavo_btc_eur_ticker = CCXTTickerMarketDataSource(
market="BITVAVO",
symbol="BTC/EUR",
)
app = create_app()

# Bitvavo market credentials are read from .env file, or you can
# set them manually as params
app.add_market_credential(MarketCredential(market="bitvavo"))
app.add_portfolio_configuration(
PortfolioConfiguration(
market="bitvavo", trading_symbol="EUR", initial_balance=40
)
app = create_app()
app.add_market(
market="BITVAVO",
trading_symbol="EUR",
initial_balance=100
)

algorithm = Algorithm(name="test_algorithm")

# Define a strategy for the algorithm that will run every 10 seconds
Expand Down Expand Up @@ -338,8 +336,8 @@ This will ensure that interested parties can give valuable feedback on the featu

## 📬 Support

* Slack Community
* Reddit Community
* [Reddit Community](https://www.reddit.com/r/InvestingBots/)
* [Discord Community](https://discord.gg/dQsRmGZP")


## 🏆 Acknowledgements
Expand Down
11 changes: 6 additions & 5 deletions examples/backtest_example/run_backtest.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import time
from datetime import datetime
import logging.config
import time
from datetime import datetime, timedelta
from investing_algorithm_framework import (
CCXTOHLCVMarketDataSource, CCXTTickerMarketDataSource, PortfolioConfiguration, create_app, pretty_print_backtest, BacktestDateRange, TimeUnit, TradingStrategy, OrderSide, DEFAULT_LOGGING_CONFIG, Context
)

from pyindicators import ema, is_crossover, is_above, is_below, is_crossunder

from investing_algorithm_framework import (
CCXTOHLCVMarketDataSource, CCXTTickerMarketDataSource, create_app,
pretty_print_backtest, BacktestDateRange, TimeUnit, TradingStrategy,
OrderSide, DEFAULT_LOGGING_CONFIG, Context
)

logging.config.dictConfig(DEFAULT_LOGGING_CONFIG)

Expand Down
16 changes: 0 additions & 16 deletions examples/test.py

This file was deleted.

9 changes: 7 additions & 2 deletions investing_algorithm_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
load_backtest_report, BacktestDateRange, convert_polars_to_pandas, \
DateRange, get_backtest_report, DEFAULT_LOGGING_CONFIG, \
BacktestReport, TradeStatus, MarketDataType, TradeRiskType, \
APPLICATION_DIRECTORY
APPLICATION_DIRECTORY, pretty_print_orders, pretty_print_trades, \
pretty_print_positions, DataSource
from investing_algorithm_framework.infrastructure import \
CCXTOrderBookMarketDataSource, CCXTOHLCVMarketDataSource, \
CCXTTickerMarketDataSource, CSVOHLCVMarketDataSource, \
Expand Down Expand Up @@ -77,5 +78,9 @@
"TradeRiskType",
"Context",
"APPLICATION_DIRECTORY",
"download"
"download",
"pretty_print_orders",
"pretty_print_trades",
"pretty_print_positions",
"DataSource",
]
Loading
Loading