Merge pull request #2061 from nanoric/okexf_fix

[Fix] OkexfGateway: Fixed typo
This commit is contained in:
vn.py 2019-09-02 08:44:50 +08:00 committed by GitHub
commit 2e7271d789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,7 +164,7 @@ class OkexfRestApi(RestClient):
OKEXF REST API OKEXF REST API
""" """
def __init__(self, gateway: BaseGateway): def __init__(self, gateway: "OkexfGateway"):
"""""" """"""
super(OkexfRestApi, self).__init__() super(OkexfRestApi, self).__init__()
@ -407,8 +407,8 @@ class OkexfRestApi(RestClient):
direction=Direction.SHORT, direction=Direction.SHORT,
volume=int(pos_data["short_qty"]), volume=int(pos_data["short_qty"]),
frozen=float(pos_data["short_qty"]) - float(pos_data["short_avail_qty"]), frozen=float(pos_data["short_qty"]) - float(pos_data["short_avail_qty"]),
price=float(["short_avg_cost"]), price=float(pos_data["short_avg_cost"]),
pnl=float(["realised_pnl"]), pnl=float(pos_data["realised_pnl"]),
gateway_name=self.gateway_name, gateway_name=self.gateway_name,
) )
self.gateway.on_position(pos) self.gateway.on_position(pos)