Skip to content

Commit 269949c

Browse files
committed
Optimize imports
1 parent 5d559bd commit 269949c

File tree

75 files changed

+273
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+273
-269
lines changed

examples/backtest/algorithm/strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import tulipy as ti
22

33
from investing_algorithm_framework import TimeUnit, TradingStrategy, \
4-
Algorithm, OrderSide, BACKTESTING_INDEX_DATETIME
4+
Algorithm, OrderSide
55

66
"""
77
This strategy is based on the golden cross strategy. It will buy when the

examples/backtest/backtest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
from datetime import datetime, timedelta
22

3-
from investing_algorithm_framework import PortfolioConfiguration, \
4-
pretty_print_backtest
5-
6-
from app import app
73
from algorithm.algorithm import algorithm
84
from algorithm.data_sources import bitvavo_btc_eur_ohlcv_2h, \
95
bitvavo_dot_eur_ohlcv_2h, bitvavo_dot_eur_ticker, bitvavo_btc_eur_ticker
10-
6+
from app import app
7+
from investing_algorithm_framework import PortfolioConfiguration, \
8+
pretty_print_backtest
119

1210
app.add_algorithm(algorithm)
1311
app.add_market_data_source(bitvavo_btc_eur_ohlcv_2h)

examples/bitvavo_trading_bot/bitvavo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
23
from investing_algorithm_framework import MarketCredential, TimeUnit, \
34
CCXTOHLCVMarketDataSource, CCXTTickerMarketDataSource, TradingStrategy, \
45
create_app, PortfolioConfiguration, Algorithm, SYMBOLS, RESOURCE_DIRECTORY

examples/coinbase_trading_bot/coinbase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
23
from investing_algorithm_framework import MarketCredential, TimeUnit, \
34
CCXTOHLCVMarketDataSource, CCXTTickerMarketDataSource, TradingStrategy, \
45
create_app, PortfolioConfiguration, Algorithm, SYMBOLS, RESOURCE_DIRECTORY

examples/crossover_moving_average_trading_bot/backtesting.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
from datetime import datetime, timedelta
22

3-
from investing_algorithm_framework import PortfolioConfiguration, \
4-
pretty_print_backtest
5-
6-
from app import app
73
from algorithm.algorithm import algorithm
84
from algorithm.data_sources import bitvavo_btc_eur_ohlcv_2h, \
95
bitvavo_dot_eur_ohlcv_2h, bitvavo_dot_eur_ticker, bitvavo_btc_eur_ticker
10-
6+
from app import app
7+
from investing_algorithm_framework import PortfolioConfiguration, \
8+
pretty_print_backtest
119

1210
app.add_algorithm(algorithm)
1311
app.add_market_data_source(bitvavo_btc_eur_ohlcv_2h)

examples/crossover_moving_average_trading_bot/production.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from investing_algorithm_framework import MarketCredential
21
from app import app
2+
from investing_algorithm_framework import MarketCredential
33

44
# Configure your market credentials here
55
bitvavo_market_credential = MarketCredential(

investing_algorithm_framework/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from investing_algorithm_framework.app import App, Algorithm, AppHook
2-
from .create_app import create_app
2+
from investing_algorithm_framework.app import TradingStrategy, \
3+
StatelessAction, Task
34
from investing_algorithm_framework.domain import ApiException, \
45
TradingDataType, TradingTimeFrame, OrderType, OperationalException, \
56
OrderStatus, OrderSide, Config, TimeUnit, TimeInterval, Order, Portfolio, \
@@ -9,12 +10,11 @@
910
TickerMarketDataSource, MarketService, BacktestReportsEvaluation, \
1011
pretty_print_backtest_reports_evaluation, load_backtest_reports, \
1112
RESERVED_BALANCES, APP_MODE, AppMode, DATETIME_FORMAT
12-
from investing_algorithm_framework.app import TradingStrategy, \
13-
StatelessAction, Task
1413
from investing_algorithm_framework.infrastructure import \
1514
CCXTOrderBookMarketDataSource, CCXTOHLCVMarketDataSource, \
1615
CCXTTickerMarketDataSource, CSVOHLCVMarketDataSource, \
1716
CSVTickerMarketDataSource
17+
from .create_app import create_app
1818

1919
__all__ = [
2020
"Algorithm",

investing_algorithm_framework/app/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from investing_algorithm_framework.app.app import App, AppHook
2-
from investing_algorithm_framework.app.web import create_flask_app
3-
from investing_algorithm_framework.app.strategy import TradingStrategy
42
from investing_algorithm_framework.app.stateless import StatelessAction
3+
from investing_algorithm_framework.app.strategy import TradingStrategy
54
from investing_algorithm_framework.app.task import Task
5+
from investing_algorithm_framework.app.web import create_flask_app
66
from .algorithm import Algorithm
77

88
__all__ = [

investing_algorithm_framework/app/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import inspect
12
import logging
23
import os
34
import shutil
45
import threading
6+
from abc import abstractmethod
57
from datetime import datetime
68
from distutils.sysconfig import get_python_lib
79
from time import sleep
810
from typing import List, Optional, Tuple
9-
import inspect
1011

11-
from abc import abstractmethod
1212
from flask import Flask
1313

1414
from investing_algorithm_framework.app.algorithm import Algorithm

investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
23
from investing_algorithm_framework.app.stateless.action_handlers \
34
.action_handler_strategy import ActionHandlerStrategy
45

0 commit comments

Comments
 (0)