Merge pull request #16 from freqtrade/develop
Update from upstream repo gcarq/freqtrade@develop
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
This module contains class to define a RPC communications
|
||||
"""
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, date
|
||||
from decimal import Decimal
|
||||
from typing import Tuple, Any
|
||||
from typing import Dict, Tuple, Any
|
||||
|
||||
import arrow
|
||||
import sqlalchemy as sql
|
||||
@@ -115,7 +115,7 @@ class RPC(object):
|
||||
self, timescale: int,
|
||||
stake_currency: str, fiat_display_currency: str) -> Tuple[bool, Any]:
|
||||
today = datetime.utcnow().date()
|
||||
profit_days = {}
|
||||
profit_days: Dict[date, Dict] = {}
|
||||
|
||||
if not (isinstance(timescale, int) and timescale > 0):
|
||||
return True, '*Daily [n]:* `must be an integer greater than 0`'
|
||||
@@ -173,7 +173,7 @@ class RPC(object):
|
||||
durations = []
|
||||
|
||||
for trade in trades:
|
||||
current_rate = None
|
||||
current_rate: float = 0.0
|
||||
|
||||
if not trade.open_rate:
|
||||
continue
|
||||
@@ -279,7 +279,7 @@ class RPC(object):
|
||||
value = fiat.convert_amount(total, 'BTC', symbol)
|
||||
return False, (output, total, symbol, value)
|
||||
|
||||
def rpc_start(self) -> (bool, str):
|
||||
def rpc_start(self) -> Tuple[bool, str]:
|
||||
"""
|
||||
Handler for start.
|
||||
"""
|
||||
@@ -289,7 +289,7 @@ class RPC(object):
|
||||
self.freqtrade.state = State.RUNNING
|
||||
return False, '`Starting trader ...`'
|
||||
|
||||
def rpc_stop(self) -> (bool, str):
|
||||
def rpc_stop(self) -> Tuple[bool, str]:
|
||||
"""
|
||||
Handler for stop.
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
This module contains class to manage RPC communications (Telegram, Slack, ...)
|
||||
"""
|
||||
from typing import Any, List
|
||||
import logging
|
||||
|
||||
from freqtrade.rpc.telegram import Telegram
|
||||
@@ -21,8 +22,8 @@ class RPCManager(object):
|
||||
"""
|
||||
self.freqtrade = freqtrade
|
||||
|
||||
self.registered_modules = []
|
||||
self.telegram = None
|
||||
self.registered_modules: List[str] = []
|
||||
self.telegram: Any = None
|
||||
self._init()
|
||||
|
||||
def _init(self) -> None:
|
||||
|
||||
@@ -18,7 +18,7 @@ from freqtrade.rpc.rpc import RPC
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def authorized_only(command_handler: Callable[[Bot, Update], None]) -> Callable[..., Any]:
|
||||
def authorized_only(command_handler: Callable[[Any, Bot, Update], None]) -> Callable[..., Any]:
|
||||
"""
|
||||
Decorator to check if the message comes from the correct chat_id
|
||||
:param command_handler: Telegram CommandHandler
|
||||
@@ -65,7 +65,7 @@ class Telegram(RPC):
|
||||
"""
|
||||
super().__init__(freqtrade)
|
||||
|
||||
self._updater = None
|
||||
self._updater: Updater = None
|
||||
self._config = freqtrade.config
|
||||
self._init()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user