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

0 Members and 1 Guest are viewing this topic.

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
Is this already fixed? I can see delegates with 0.4.24-RC2 and active feeds.

But no matter wich script I tried, from bitsuperlab or xeroc I get
"print "Warnning: rpc call error, retry 5 seconds later"
                                              ^
SyntaxError: invalid syntax"
I'm on 0.4.24-RC2 too.

Edit: with xeroc's script I get "Traceback (most recent call last):
  File "/root/bts_feed/bts_feed_auto.py", line 4, in <module>
    import requests
ImportError: No module named 'requests'
"

You can still use old script connecting to 0.4.23 client in order to produce feeds.
I'll update my version of the script at the first opportunity. I hope this will be before the hardfork.

Offline taa

  • Full Member
  • ***
  • Posts: 54
    • View Profile
Thanks Bro.  just have no time to view ALT 's autofeed code.  My friend told me he is fighting with this issue since he upgraded to 0.24RC 2 days ago and he did upgrade ALT's autofeed code accordingly......  :'(

there have been some changes into the json format lately .. current price update scripts don't work with the latest git head ...

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
there have been some changes into the json format lately .. current price update scripts don't work with the latest git head ...

Offline taa

  • Full Member
  • ***
  • Posts: 54
    • View Profile
updated but having following warning

Code: [Select]

Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later
Warnning: rpc call error, retry 5 seconds later

please update from github for version 0.4.24-rc1

    rename asset name: BTSX->BTS, GLD->GOLD, SLV->SILVER
    remove PTS, PPC, LTC

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
please update from github for version 0.4.24-rc1

    rename asset name: BTSX->BTS, GLD->GOLD, SLV->SILVER
    remove PTS, PPC, LTC

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
update: add source  from yunbi.com
btc38 return time out many times. maybe because of their firewall.

Offline kokojie

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

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Code: [Select]
>>> url="http://api.btc38.com/v1/ticker.php"                                                                                                                           
>>> headers = {'content-type': 'application/json',
...    'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0'}
>>> params = { 'c': 'btsx', 'mk_type': 'btc' }
>>> responce = requests.get(url=url, params=params, headers=headers)
>>> vars(responce)['_content']
'\xef\xbb\xbf{"ticker":{"high":6.92e-5,"low":6.37e-5,"last":6.78e-5,"vol":1213613.924615,"buy":6.7e-5,"sell":6.78e-5}}'
>>>
you can see there is special charset '\xef\xbb\xbf', this is because of utf8 encode
so we need to add a call decode("utf-8-sig")

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
delegate please update the script,
fixed a mistake that can't fetch price from btc38.
https://github.com/bitsuperlab/operation_tools/commit/781f62387586278a30d1462dcd8d03641831582b
I don't really understand what you fixed there!?  :-\

could you elaborate?

Offline Riverhead

delegate please update the script,
fixed a mistake that can't fetch price from btc38.

I think btc123 have the same problem, btsx/cny  stop updated since 20 hours ago, who can tell them?

Updated riverhead-del-server-1. Thanks for staying on top of this :).

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
delegate please update the script,
fixed a mistake that can't fetch price from btc38.

I think btc123 have the same problem, btsx/cny  stop updated since 20 hours ago, who can tell them?

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
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?

you need to change the update rule, this is what I use now
Code: [Select]
  "price_limit": {
    "common": "only update price feed when the change rate is between 5% ~ 50%",
    "change_min": 0.5,
    "change_max": 50,
    "common1": "set the frequency, how many seconds need to wait until next fetch",
    "sample_timer": 60,
    "common2": "update the feed price at least 23.5 hours a time",
    "max_update_hours": 23.5,
    "common3": "we use the media price, how many samples need to use",
    "median_length": 61
  },

Offline amencon

  • Sr. Member
  • ****
  • Posts: 227
    • 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?
depends on how often you run the script .. and in the config there is a parameter called
Code: [Select]
"common2": "update the feed price at least 23.5 hours a time",
"max_update_hours": 23.5,
Yep you can also set the min and max change required to trigger an update there as well which will definitely effect how often your feeds update each day.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
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?
depends on how often you run the script .. and in the config there is a parameter called
Code: [Select]
"common2": "update the feed price at least 23.5 hours a time",
"max_update_hours": 23.5,

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
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?
There are different modifications of that script. As far as I know xeroc's version and mine: https://bitsharestalk.org/index.php?topic=9698.0 .
It also depends on how often you invoke it. How often you get errors from exchanges or clients. Some versions are more sensitive to price changes and even more sensitive when price falls down.