File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
examples/crossover_moving_average_trading_bot Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 22
33from investing_algorithm_framework import TimeUnit , TradingStrategy , \
44 Algorithm , OrderSide
5+ from .data_sources import bitvavo_btc_eur_ohlcv_2h , bitvavo_btc_eur_ticker , \
6+ bitvavo_dot_eur_ticker , bitvavo_dot_eur_ohlcv_2h
7+
58
69"""
710This strategy is based on the golden cross strategy. It will buy when the
@@ -49,10 +52,10 @@ class CrossOverStrategy(TradingStrategy):
4952 time_unit = TimeUnit .HOUR
5053 interval = 2
5154 market_data_sources = [
52- "BTC/EUR-ohlcv" ,
53- "DOT/EUR-ohlcv" ,
54- "BTC/EUR-ticker" ,
55- "DOT/EUR-ticker"
55+ bitvavo_dot_eur_ticker ,
56+ bitvavo_dot_eur_ohlcv_2h ,
57+ bitvavo_btc_eur_ticker ,
58+ bitvavo_btc_eur_ohlcv_2h
5659 ]
5760 symbols = ["BTC/EUR" , "DOT/EUR" ]
5861
Original file line number Diff line number Diff line change 55 bitvavo_dot_eur_ohlcv_2h , bitvavo_dot_eur_ticker , bitvavo_btc_eur_ticker
66from app import app
77from investing_algorithm_framework import PortfolioConfiguration , \
8- pretty_print_backtest
8+ pretty_print_backtest , BacktestDateRange
99
1010app .add_algorithm (algorithm )
1111app .add_market_data_source (bitvavo_btc_eur_ohlcv_2h )
2626if __name__ == "__main__" :
2727 end_date = datetime (2023 , 12 , 2 )
2828 start_date = end_date - timedelta (days = 100 )
29+ date_range = BacktestDateRange (
30+ start_date = start_date ,
31+ end_date = end_date
32+ )
2933 backtest_report = app .run_backtest (
3034 algorithm = algorithm ,
31- start_date = start_date ,
32- end_date = end_date ,
35+ backtest_date_range = date_range ,
3336 pending_order_check_interval = "2h" ,
3437 )
3538 pretty_print_backtest (backtest_report )
You can’t perform that action at this time.
0 commit comments