Skip to content

Commit

Permalink
Refactor market data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
MDUYN committed Dec 4, 2023
1 parent ecaa936 commit c74edd7
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,16 @@ It also exposes an REST API that allows you to interact with the algorithm.
```python
import pathlib
from datetime import datetime, timedelta

from investing_algorithm_framework import create_app, PortfolioConfiguration, \
RESOURCE_DIRECTORY, TimeUnit, CCXTOHLCVMarketDataSource, Algorithm

def start_date_func():
return datetime.utcnow() - timedelta(days=17)

# Define market data sources
bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
identifier="BTC",
market="BITVAVO",
symbol="BTC/EUR",
timeframe="2h",
start_date_func=start_date_func
start_date_func=lambda : datetime.utcnow() - timedelta(days=17)
)
app = create_app({RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()})
app.add_portfolio_configuration(
Expand Down Expand Up @@ -75,20 +71,16 @@ but instead of running the algorithm, you can run a backtest.
```python
import pathlib
from datetime import datetime, timedelta

from investing_algorithm_framework import create_app, RESOURCE_DIRECTORY, \
TimeUnit, CCXTOHLCVMarketDataSource, Algorithm, pretty_print_backtest

def start_date_func():
return datetime.utcnow() - timedelta(days=17)

# Define market data sources
bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
identifier="BTC",
market="BITVAVO",
symbol="BTC/EUR",
timeframe="2h",
start_date_func=start_date_func
start_date_func=lambda : datetime.utcnow() - timedelta(days=17)
)
app = create_app({RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()})

Expand Down

0 comments on commit c74edd7

Please sign in to comment.