Skip to content

len() not defined for object type None #24

@elnazsn1988

Description

@elnazsn1988

Hi - very cool repo, I have an issue in that inside the orderbook.py I am trying to pull my info from a orderbook csv file with pre-existing historical data, and it will not allow the generateDict to actually generate a dict due to the clause stating that if the len(self.dictbook< index, and self.dictbook is defined as 'None' in the beginning of the code. Same issue happens later on in different part of ipynb file remake with external orderbook, is there anyway to fix this? I tried replacing with self.dictbook={} and self.dictbook=[], neither fixes the issue.

The issue is always in this part of the code :
~/ctc-executioner/ctc_executioner/orderbook.py in getDictState(self, index)
195 if len(self.dictBook) <= index:
196 raise Exception('Index out of orderbook state.')
--> 197 return self.dictBook[list(self.dictBook.keys())[index]]
198
199 def summary(self):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions