Skip to content

Commit

Permalink
Add Docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
aoki-h-jp committed Mar 16, 2023
1 parent 5bcd5a6 commit 01fd616
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions frarb/frarb.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ def get_large_divergence_dataframe_multi_exchanges(self):
return df

def display_one_by_one_single_exchange(self, exchange: str, minus=False, display_num=10):
"""
Args:
exchange (str): Name of exchange (binance, bybit, ...)
minus (bool): Sorted by minus FR or plus FR.
display_num (int): Number of display.
Returns: None
"""
df = self.get_large_divergence_dataframe_single_exchange(exchange=exchange, minus=minus)
# TODO: Check perp or spot or options exists on CEX.
for i in df.sort_values(by='Funding Rate [%]', ascending=minus).head(display_num).index:
Expand All @@ -190,6 +200,15 @@ def display_one_by_one_single_exchange(self, exchange: str, minus=False, display
print(f'Commission: {df.loc[i]["Commission [%]"]} %')

def display_one_by_one_multi_exchanges(self, display_num=10, sorted_by='revenue'):
"""
Args:
display_num (int): Number of display.
sorted_by (str): Sorted by "revenue" or "divergence"
Returns: None
"""
if sorted_by == 'revenue':
sorted_by = 'Revenue [/100 USDT]'
elif sorted_by == 'divergence':
Expand Down

0 comments on commit 01fd616

Please sign in to comment.