Merge branch 'develop' into feat/refactor-ws

This commit is contained in:
Timothy Pogue
2022-11-18 13:41:22 -07:00
6 changed files with 116 additions and 200 deletions

View File

@@ -4,7 +4,7 @@ from typing import Any, Dict, Union
import orjson
import rapidjson
from pandas import DataFrame, Timestamp
from pandas import DataFrame
from freqtrade.misc import dataframe_to_json, json_to_dataframe
from freqtrade.rpc.api_server.ws.proxy import WebSocketProxy
@@ -51,11 +51,6 @@ def _json_default(z):
'__type__': 'dataframe',
'__value__': dataframe_to_json(z)
}
# Pandas returns a Timestamp object, we need to
# convert it to a timestamp int (with ms) for orjson
# to handle it
if isinstance(z, Timestamp):
return z.timestamp() * 1e3
raise TypeError

View File

@@ -218,9 +218,10 @@ class RPC:
stoploss_current_dist_pct=round(stoploss_current_dist_ratio * 100, 2),
stoploss_entry_dist=stoploss_entry_dist,
stoploss_entry_dist_ratio=round(stoploss_entry_dist_ratio, 8),
open_order='({} {} rem={:.8f})'.format(
order.order_type, order.side, order.remaining
) if order else None,
open_order=(
f'({order.order_type} {order.side} rem={order.safe_remaining:.8f})' if
order else None
),
))
results.append(trade_dict)
return results