Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

len() not defined for object type None #24

Open
elnazsn1988 opened this issue Jun 4, 2020 · 1 comment
Open

len() not defined for object type None #24

elnazsn1988 opened this issue Jun 4, 2020 · 1 comment

Comments

@elnazsn1988
Copy link

elnazsn1988 commented Jun 4, 2020

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):

@mjuchli
Copy link
Owner

mjuchli commented Jun 14, 2020

Hi @elnazsn1988
Sorry for the late reply. Would it be possible to share your order book (or parts of it if its too large) so that I can test it myself?

Are you using the loadFromFile method?, or did you write your own parser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants