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

bcbookie.py crashes on buy attempt with TypeError: unsupported operand type(s) for -: 'unicode' and 'int' #15

Closed
GoogleCodeExporter opened this issue Nov 8, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Hello,

    I'm running the latest git release. After successfully running the 
gal.py with [PyPy 1.6.0 with GCC 4.5.2], I have imported the API key and 
manually ran the bcbookie.py with [Python 2.7.1+]. After a few sleep cycles it 
tries to buy a few shares and crashes with an error message pasted below. 
Please advise what to do next, or feel free to ask for more data or more 
detailed troubleshooting.

Grateful in advance!

---------

sleeping...
________________________________________________________________________________



________________________________________________________________________________
    update: current price: 6.300  account market value: 4.4100 @ Mon Jan  9 17:10:41 2012
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
checking open orders
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
checking held positions
--------------------------------------------------------------------------------
main: Availble Funds (USDS,BTCS) :(u'0', u'0.7')
buy: order validated
Traceback (most recent call last):
  File "bcbookie.py", line 550, in <module>
    b.buy(0.5,t['buy'],commit,t['target'],t['stop'],60 * 5,t['stop_age'])
  File "bcbookie.py", line 278, in buy
    if (self.funds() - self.balance_committed) > cost and qty >= 0.01:
TypeError: unsupported operand type(s) for -: 'unicode' and 'int'

Original issue reported on code.google.com by purge...@gmail.com on 9 Jan 2012 at 4:18

@GoogleCodeExporter
Copy link
Author

The 'funds' function wasn't casting the returned data as a float which caused 
the error. Fixed on the repo.

Original comment by brian.mo...@gmail.com on 9 Jan 2012 at 11:00

  • Changed state: Fixed

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

No branches or pull requests

1 participant