From 554c8c61120d144d35a8a5b1dbabe6d20ee3c904 Mon Sep 17 00:00:00 2001 From: JacobPlaster Date: Tue, 14 Apr 2020 16:17:39 +0100 Subject: [PATCH] models: linting --- bfxapi/models/funding_ticker.py | 12 ++++++++---- bfxapi/models/position.py | 13 ++++++++----- bfxapi/models/ticker.py | 3 ++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bfxapi/models/funding_ticker.py b/bfxapi/models/funding_ticker.py index bd7d1ec..983f8ad 100644 --- a/bfxapi/models/funding_ticker.py +++ b/bfxapi/models/funding_ticker.py @@ -25,7 +25,8 @@ class FundingTickerModel: class FundingTicker: """ - FRR float Flash Return Rate - average of all fixed rate funding over the last hour (funding tickers only) + FRR float Flash Return Rate - average of all fixed rate funding over the last hour + (funding tickers only) BID float Price of last highest bid BID_PERIOD int Bid period covered in days (funding tickers only) BID_SIZE float Sum of the 25 highest bid sizes @@ -33,12 +34,14 @@ class FundingTicker: ASK_PERIOD int Ask period covered in days (funding tickers only) ASK_SIZE float Sum of the 25 lowest ask sizes DAILY_CHANGE float Amount that the last price has changed since yesterday - DAILY_CHANGE_RELATIVE float Relative price change since yesterday (*100 for percentage change) + DAILY_CHANGE_RELATIVE float Relative price change since yesterday + (*100 for percentage change) LAST_PRICE float Price of the last trade VOLUME float Daily volume HIGH float Daily high LOW float Daily low - FRR_AMOUNT_AVAILABLE float The amount of funding that is available at the Flash Return Rate (funding tickers only) + FRR_AMOUNT_AVAILABLE float The amount of funding that is available at the + Flash Return Rate (funding tickers only) """ def __init__(self, pair, frr, bid, bid_period, bid_size, ask, ask_period, ask_size, @@ -64,7 +67,8 @@ class FundingTicker: """ Generate a Ticker object from a raw ticker array """ - # [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7,6167.26141685,6964.2,6710.8]] + # [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7, + # 6167.26141685,6964.2,6710.8]] return FundingTicker( pair, diff --git a/bfxapi/models/position.py b/bfxapi/models/position.py index 5a6a4a8..e748bd7 100644 --- a/bfxapi/models/position.py +++ b/bfxapi/models/position.py @@ -30,8 +30,10 @@ class Position: """ SYMBOL string Pair (tBTCUSD, …). STATUS string Status (ACTIVE, CLOSED). - ±AMOUNT float Size of the position. A positive value indicates a long position; a negative value indicates a short position. - BASE_PRICE float Base price of the position. (Average traded price of the previous orders of the position) + ±AMOUNT float Size of the position. A positive value indicates a + long position; a negative value indicates a short position. + BASE_PRICE float Base price of the position. (Average traded price + of the previous orders of the position) MARGIN_FUNDING float The amount of funding being used for this position. MARGIN_FUNDING_TYPE int 0 for daily, 1 for term. PL float Profit & Loss @@ -41,14 +43,15 @@ class Position: POSITION_ID int64 Position ID MTS_CREATE int Millisecond timestamp of creation MTS_UPDATE int Millisecond timestamp of update - TYPE int Identifies the type of position, 0 = Margin position, 1 = Derivatives position + TYPE int Identifies the type of position, 0 = Margin position, + 1 = Derivatives position COLLATERAL float The amount of collateral applied to the open position COLLATERAL_MIN float The minimum amount of collateral required for the position META json string Additional meta information about the position """ def __init__(self, symbol, status, amount, b_price, m_funding, m_funding_type, - profit_loss, profit_loss_perc, l_price, lev, id, mts_create, mts_update, + profit_loss, profit_loss_perc, l_price, lev, pid, mts_create, mts_update, p_type, collateral, collateral_min, meta): self.symbol = symbol self.status = status @@ -60,7 +63,7 @@ class Position: self.profit_loss_percentage = profit_loss_perc self.liquidation_price = l_price self.leverage = lev - self.id = id + self.id = pid self.mts_create = mts_create self.mts_update = mts_update self.type = p_type diff --git a/bfxapi/models/ticker.py b/bfxapi/models/ticker.py index bcd749e..831f1f1 100644 --- a/bfxapi/models/ticker.py +++ b/bfxapi/models/ticker.py @@ -50,7 +50,8 @@ class Ticker: """ Generate a Ticker object from a raw ticker array """ - # [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7,6167.26141685,6964.2,6710.8]] + # [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7, + # 6167.26141685,6964.2,6710.8]] return Ticker( pair,