Skip to content

Commit

Permalink
add extra comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineLep committed Apr 27, 2022
1 parent cccfc3d commit 69163e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions strategies/cryptofeed_strategy/cryptofeed_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

from strategies.cryptofeed_strategy.enums.cryptofeed_data_type_enum import CryptofeedDataTypeEnum

# Display all received data if set to true. Only the data > min_data_size is displayed otherwise
# Display all received data if set to true (verbose)
DISPLAY_ALL_DATA = False
exchanges = ['BINANCE_FUTURES', 'FTX']
EXCHANGES = ['BINANCE_FUTURES', 'FTX']


class CryptofeedService(object):
Expand Down Expand Up @@ -60,7 +60,7 @@ async def open_interest(data, receipt):
print("Querying exchange metadata")
for exchange_string, exchange_class in EXCHANGE_MAP.items():

if exchange_string not in exchanges:
if exchange_string not in EXCHANGES:
continue

if exchange_string in ['BITFLYER', 'EXX', 'OKEX']: # We have issues with these exchanges
Expand Down
13 changes: 13 additions & 0 deletions strategies/cryptofeed_strategy/cryptofeed_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,21 @@ def __init__(self):
logging.info("TestStrategy run strategy")
super(CryptofeedStrategy, self).__init__()

# Array of array of LiquidationDataDict, every sub array is the liquidation list received during the last
# SLEEP_TIME_BETWEEN_LOOPS sec. Use CryptofeedService EXCHANGES global to configure the list of exchange to
# retrieve data on
self.liquidations: List[List[LiquidationDataDict]] = []

# {
# exchange1: {
# coin1: { open_interest: value, timestamp: value },
# coin2: { open_interest: value, timestamp: value}
# },
# ...
# }
# Use CryptofeedService EXCHANGES global to configure the list of exchange to retrieve data on
self.open_interest = {}

self._t: threading.Thread = threading.Thread(target=CryptofeedService.start_cryptofeed, args=[])
self._t.start()

Expand Down

0 comments on commit 69163e6

Please sign in to comment.