BitBotFactory / MikaLendingBot

Automated lending on Cryptocurrency exchanges Poloniex and Bitfinex
http://poloniexlendingbot.readthedocs.io/en/latest/index.html
MIT License
1.11k stars 345 forks source link

Alternative outputcurrency #309

Open Reno007 opened 7 years ago

Reno007 commented 7 years ago

If I add EUR as an alternative output currency (instead of BTC) for the html log it does not work (and the bot applies BTC instead). Does this work for any of you guys?

laxdog commented 7 years ago

Works fine for me :

screen shot 2017-04-28 at 4 29 29 pm

Is there anything in the log to stdout?

rnevet commented 7 years ago

Same here, my bot is in EUR. image

Try the following link: https://blockchain.info/tobtc?currency=EUR&value=1 This is the link the bot uses to get the EUR conversion rate, if it fails it will display BTC.

Reno007 commented 7 years ago

capture1 capture2

Reno007 commented 7 years ago

Hmm, this is what I get...

laxdog commented 7 years ago

Also, if you're running on pythonanywhere, it won't work. They block that address https://github.com/Mikadily/poloniexlendingbot/issues/262

Reno007 commented 7 years ago

Ah that would be it....

Reno007 commented 7 years ago

Thanks!

rnevet commented 7 years ago

We could actually move the entire output currency conversion to HTML Javascript side. @yura-pakhuchiy what do you think? exchange rates are anyway public APIs.

laxdog commented 7 years ago

Good idea, it could also be a drop down then.

yura-pakhuchiy commented 7 years ago

Yes, we can have BTC -> output currency conversion done in JS (allowing output currency switch in runtime). However, it is better to keep altcoin -> BTC rate in bot it self. Requesting every altcoin rate from JS will greatly increase time between json retrieval and moment when data can be displayed to user. Maybe even leave BTC->USDT rate in bot (for fastest default option), but move BTC -> EUR/real USD/others to JS (if user wants alternative currencies).

Reno007 commented 7 years ago

That would be great! Thanks guys, awesome project

laxdog commented 7 years ago

Can we close this and create another ticket for the work to come out of it if that's still happening @yura-pakhuchiy or @rnevet ?

rnevet commented 7 years ago

@AndreyIlinX can you elaborate on the solution in your branch?

AndreyIlinX commented 7 years ago

@rnevet Hello, in short, I use build_opener from urllib2 instead of using urlopen from urllib, and it works

rnevet commented 7 years ago

@AndreyIlinX Why not use that as the first call? Do you have any idea why this is working? I thought the issue was that PythonAnywhere blocks the api access.