adamhyman / dinar-trader

0 stars 3 forks source link

Creating generic exchange methods for session objects #4

Closed bustoutfunk closed 7 years ago

bustoutfunk commented 7 years ago

Create generalized methods to query, buy, sell, trade, etc. in the exchange_session class.

bustoutfunk commented 7 years ago

@adamhyman, I have created a generalized class that will encompass a session from any of the exchanges (just Kraken and Gemini for now).

You won't notice any difference as of right now but this issue requests an enhancement to create an "all encompassing API." I plan to create generic methods that will enable us to buy, sell, trade, etc. without going into the specific exchange API methods.

adamhyman commented 7 years ago

This is really awesome. I understand what that code is doing and will be able to add on other exchanges in a similar fashion.

My question: In exchange_session.py we have "import krakenex" - but how does it know that krakenex is located inside python3-krakenex?

I think we have this issue with python-krakenex.

bustoutfunk commented 7 years ago

Good question: Because we ran setup.py so it gets stored in your default libraries just like anything downloaded via Pip would.


From: Adam Hyman notifications@github.com Sent: Wednesday, June 28, 2017 11:08:22 PM To: adamhyman/dinar-trader Cc: bustoutfunk; Assign Subject: Re: [adamhyman/dinar-trader] Creating generic exchange methods for session objects (#4)

This is really awesome. I understand what that code is doing and will be able to add on other exchanges in a similar fashion.

My question: In exchange_session.pyhttps://github.com/adamhyman/dinar-trader/blob/master/exchange_session.py we have "import krakenex" - but how does it know that krakenex is located inside python3-krakenex?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/adamhyman/dinar-trader/issues/4#issuecomment-311871407, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHL76WQydlrmmvokfTSyZ1BfY5-0PakWks5sIz9WgaJpZM4OI1Dt.

adamhyman commented 7 years ago

When this code runs, it doesn't find Krakenex. Because the Krakenex module is within the python-krakenex folder.

image

This is the error message:

Python 3.6.2rc1 (heads/3.6:268e1fb, Jun 17 2017, 19:01:44) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ====== RESTART: C:\Users\ahyman\Dropbox\Crypto\dinar\exchange_query.py ====== Traceback (most recent call last): File "C:\Users\ahyman\Dropbox\Crypto\dinar\exchange_query.py", line 3, in <module> from exchange_session import exchange_session File "C:\Users\ahyman\Dropbox\Crypto\dinar\exchange_session.py", line 5, in <module> import krakenex ModuleNotFoundError: No module named 'krakenex' >>>

bustoutfunk commented 7 years ago

Did you run setup.py? in the kraken folder?

On Thu, Jun 29, 2017 at 9:41 AM, Adam Hyman notifications@github.com wrote:

When this code runs, it doesn't find Krakenex. Because the Krakenex module is within the python-krakenex folder.

[image: image] https://user-images.githubusercontent.com/1277113/27699254-812fe8d6-5cae-11e7-9722-4cbf5822af36.png

This is the error message:

Python 3.6.2rc1 (heads/3.6:268e1fb, Jun 17 2017, 19:01:44) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information.

====== RESTART: C:\Users\ahyman\Dropbox\Crypto\dinar\exchange_query.py

Traceback (most recent call last): File "C:\Users\ahyman\Dropbox\Crypto\dinar\exchange_query.py", line 3, in

from exchange_session import exchange_session File "C:\Users\ahyman\Dropbox\Crypto\dinar\exchange_session.py", line 5, in import krakenex ModuleNotFoundError: No module named 'krakenex'

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/adamhyman/dinar-trader/issues/4#issuecomment-312023885, or mute the thread https://github.com/notifications/unsubscribe-auth/AHL76fT_BY1gWkKuZHUw0kjrtSu0YIBJks5sI9O1gaJpZM4OI1Dt .

adamhyman commented 7 years ago

AWESOME. I see.

I have to run python3-krakenex\Setup.py first, then I can run Exchange_Query!

Now it's working perfectly. And I can add some other exchanges :)

image

bustoutfunk commented 7 years ago

Awesome. I still need to work on that class. It's not totally modular yet. I'll keep you posted.


From: Adam Hyman notifications@github.com Sent: Thursday, June 29, 2017 11:44:02 AM To: adamhyman/dinar-trader Cc: bustoutfunk; Assign Subject: Re: [adamhyman/dinar-trader] Creating generic exchange methods for session objects (#4)

AWESOME. I see.

I have to run python3-krakenex\Setup.py first, then I can run Exchange_Query!

Now it's working perfectly. And I can add some other exchanges :)

[image]https://user-images.githubusercontent.com/1277113/27704680-3c2f45a8-5cc0-11e7-8f85-ca0d382b03f6.png

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/adamhyman/dinar-trader/issues/4#issuecomment-312063228, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHL76ZmzvYtidVbOpuDB7-rfyZM-Mykbks5sI_BygaJpZM4OI1Dt.

adamhyman commented 7 years ago

I fixed it by replacing: import krakenex

with: import importlib krakenex = importlib.import_module("python3-krakenex.krakenex")

Now you don't need to run setup.py

bustoutfunk commented 7 years ago

Closing as the bulk of this work has been completed.