Author Topic: publish feed price automatic(From BitSuperLab)  (Read 40160 times)

0 Members and 1 Guest are viewing this topic.

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
I'm using alt's script with default settings, why do I see other people have 50+ price update per day, and mine is only like 3-4 times  day?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
guess
apt-get install python3-requests

I may need to write a installation guide :) ...

gonna go to bed now .. once python module are all installed (most are part of python core) the rest should run with ease

Now it's telling me "ImportError: No module named 'numpy'", but I already done "apt-get install python-numpy python-scipy"

Offline GaltReport

its python3 .. you need python3-requests

omg ur so fast, so how do I install these? I already have "apt-get install python"

I ended up using pyenv to install python3 and to switch python environments then created a shell script to call the price feed script from cronjob so the environment was setup right for finding the right python.

https://github.com/yyuu/pyenv


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
guess
apt-get install python3-requests

I may need to write a installation guide :) ...

gonna go to bed now .. once python module are all installed (most are part of python core) the rest should run with ease

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
its python3 .. you need python3-requests

omg ur so fast, so how do I install these? I already have "apt-get install python"

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
its python3 .. you need python3-requests

Offline jckj

  • Sr. Member
  • ****
  • Posts: 331
    • View Profile

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
Perhaps the idea of continuously running script is a good choice as it can monitor the price movements more closely and publish only when required.
For example:

Fetching data from exchanges and central bank(for USD<->EUR<->CNY ) doing all the conversions and calculations and publish if one of the following conditions is met:
1 Price of any asset falls by X
2 X minutes passed since the last update
3 Price of any asset increases by Y

And as I mentioned in other threads:
Exchange volume should be accounted for in calculations.
Configurable delegate preferences that increase/decrease the weight of any exchange in the calculations.


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I thought about just having a single cronjob be run every 15 minutes or so and just update on "demand" ..

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
I change your script a little to have a "different" implementation:
https://github.com/xeroc/pytshares/blob/master/btsx_feed.py

things that are different:
 - no autoreload/just straight single run (cronjob) - maybe I change this in future
 - loads prices from yahoo/btc38/bter/poloniex for all NATIVE currencies of the platform (price_in_cny, price_in_btc,...)
 - convert each available price pair into prices denoted in btsx (convert_all())
 - also get the price for USD/EUR/CNY from bitcoinaverage
 - can set the payee for the feeds if you want someone else to pay the tx fee
I want to change this  to  single run too :)

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Actually I think it may be beneficial to discount all feeds by 0.995 to give the market makers some breathing room and provide a buffer against down trends.
delegates, please update the script with new rules bytemaster recommended

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I change your script a little to have a "different" implementation:
https://github.com/xeroc/pytshares/blob/master/btsx_feed.py

things that are different:
 - no autoreload/just straight single run (cronjob) - maybe I change this in future
 - loads prices from yahoo/btc38/bter/poloniex for all NATIVE currencies of the platform (price_in_cny, price_in_btc,...)
 - convert each available price pair into prices denoted in btsx (convert_all())
 - also get the price for USD/EUR/CNY from bitcoinaverage
 - can set the payee for the feeds if you want someone else to pay the tx fee

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
updated: support PTS,PPC,LTC now