Fix mypy in scripts
This commit is contained in:
parent
184b13f2fb
commit
83a2427a61
@ -41,7 +41,7 @@ jobs:
|
|||||||
name: hyperopt
|
name: hyperopt
|
||||||
- script: flake8 freqtrade scripts
|
- script: flake8 freqtrade scripts
|
||||||
name: flake8
|
name: flake8
|
||||||
- script: mypy freqtrade
|
- script: mypy freqtrade scripts
|
||||||
name: mypy
|
name: mypy
|
||||||
|
|
||||||
- stage: docker
|
- stage: docker
|
||||||
|
@ -84,5 +84,5 @@ The `-p` pair argument, can be used to plot a single pair
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
```
|
```
|
||||||
python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p BTC_LTC
|
python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p LTC/BTC
|
||||||
```
|
```
|
||||||
|
@ -146,7 +146,7 @@ def get_tickers_data(strategy, exchange, pairs: List[str], args):
|
|||||||
tickers[pair] = exchange.klines((pair, tick_interval))
|
tickers[pair] = exchange.klines((pair, tick_interval))
|
||||||
else:
|
else:
|
||||||
tickers = history.load_data(
|
tickers = history.load_data(
|
||||||
datadir=Path(_CONF.get("datadir")),
|
datadir=Path(str(_CONF.get("datadir"))),
|
||||||
pairs=pairs,
|
pairs=pairs,
|
||||||
ticker_interval=tick_interval,
|
ticker_interval=tick_interval,
|
||||||
refresh_pairs=_CONF.get('refresh_pairs', False),
|
refresh_pairs=_CONF.get('refresh_pairs', False),
|
||||||
|
@ -37,7 +37,7 @@ logger = logging.getLogger(__name__)
|
|||||||
# data:: [ pair, profit-%, enter, exit, time, duration]
|
# data:: [ pair, profit-%, enter, exit, time, duration]
|
||||||
# data:: ["ETH/BTC", 0.0023975, "1515598200", "1515602100", "2018-01-10 07:30:00+00:00", 65]
|
# data:: ["ETH/BTC", 0.0023975, "1515598200", "1515602100", "2018-01-10 07:30:00+00:00", 65]
|
||||||
def make_profit_array(data: List, px: int, min_date: int,
|
def make_profit_array(data: List, px: int, min_date: int,
|
||||||
interval: int,
|
interval: str,
|
||||||
filter_pairs: Optional[List] = None) -> np.ndarray:
|
filter_pairs: Optional[List] = None) -> np.ndarray:
|
||||||
pg = np.zeros(px)
|
pg = np.zeros(px)
|
||||||
filter_pairs = filter_pairs or []
|
filter_pairs = filter_pairs or []
|
||||||
@ -120,7 +120,7 @@ def plot_profit(args: Namespace) -> None:
|
|||||||
logger.info('Filter, keep pairs %s' % pairs)
|
logger.info('Filter, keep pairs %s' % pairs)
|
||||||
|
|
||||||
tickers = history.load_data(
|
tickers = history.load_data(
|
||||||
datadir=Path(config.get('datadir')),
|
datadir=Path(str(config.get('datadir'))),
|
||||||
pairs=pairs,
|
pairs=pairs,
|
||||||
ticker_interval=tick_interval,
|
ticker_interval=tick_interval,
|
||||||
refresh_pairs=False,
|
refresh_pairs=False,
|
||||||
@ -178,7 +178,7 @@ def plot_profit(args: Namespace) -> None:
|
|||||||
fig.append_trace(profit, 2, 1)
|
fig.append_trace(profit, 2, 1)
|
||||||
|
|
||||||
for pair in pairs:
|
for pair in pairs:
|
||||||
pg = make_profit_array(data, num_iterations, min_date, tick_interval, pair)
|
pg = make_profit_array(data, num_iterations, min_date, tick_interval, [pair])
|
||||||
pair_profit = go.Scattergl(
|
pair_profit = go.Scattergl(
|
||||||
x=dates,
|
x=dates,
|
||||||
y=pg,
|
y=pg,
|
||||||
|
Loading…
Reference in New Issue
Block a user