Skip to content

Commit

Permalink
working on #35, fixes lint
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Jul 2, 2019
1 parent ef8a206 commit e363821
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aat/exchanges/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from datetime import datetime
from functools import lru_cache
from ..define import EXCHANGE_MARKET_DATA_ENDPOINT
from ..enums import TickType, TickType_from_string, OrderType, OrderSubType
from ..enums import TickType, TickType_from_string, PairType
from ..exchange import Exchange
from ..logging import log
from ..structs import MarketData, Instrument
Expand Down Expand Up @@ -121,7 +121,7 @@ def tickToData(self, jsn: dict) -> MarketData:
volume = float(jsn.get('amount', 0.0))

s = jsn.get('type').upper()
if s in ('BLOCK_TRADE', 'FILL'): # Market data can't trigger fill event
if s in ('BLOCK_TRADE', 'FILL'): # Market data can't trigger fill event
typ = TickType.TRADE
elif s in ('AUCTION_INDICATIVE', 'AUCTION_OPEN', 'BOOKED', 'INITIAL'):
typ = TickType.OPEN
Expand Down
1 change: 1 addition & 0 deletions aat/exchanges/poloniex.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def heartbeat(self):
def tickToData(self, jsn: dict) -> MarketData:
raise NotImplementedError()


POLONIEX_CURRENCY_ID = {
'1CR': '1',
'ABY': '2',
Expand Down
12 changes: 12 additions & 0 deletions aat/persistence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer
# from sqlalchemy import ForeignKey
# from sqlalchemy.orm import relationship

# Base sqlalchemy
Base = declarative_base()


class Record(Base):
__tablename__ = 'records'
id = Column(Integer, primary_key=True)
4 changes: 2 additions & 2 deletions aat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import pytz
from datetime import datetime
from functools import lru_cache
from .enums import ExchangeType, ExchangeType_from_string, ExchangeTypes, CurrencyType, OrderType, Side, PairType, TradeResult
from .enums import ExchangeType, ExchangeType_from_string, ExchangeTypes, CurrencyType, OrderType, Side, PairType
from .exceptions import AATException
from .logging import log


@lru_cache(100)
def parse_date(indate: str) -> datetime:
'''parse date
Args:
indate (string, int, or datetime): input to convert to datetime
Returns:
Expand Down

0 comments on commit e363821

Please sign in to comment.