publish feed price automatic(From BitSuperLab)

Started by alt, August 28, 2014, 02:18:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

emski

Quote from: Vato_ on November 11, 2014, 02:54:59 PM
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.
[url="https://bitsharestalk.org/index.php/topic,9857.0.html"]https://bitsharestalk.org/index.php/topic,9857.0.html[/url]

taa

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......  :'(

Quote from: xeroc on November 10, 2014, 08:07:42 AM
there have been some changes into the json format lately .. current price update scripts don't work with the latest git head ...

xeroc

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

taa

updated but having following warning



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


Quote from: alt on November 09, 2014, 12:52:07 AM
please update from github for version 0.4.24-rc1

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

alt

please update from github for version 0.4.24-rc1

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

alt

update: add source  from yunbi.com
btc38 return time out many times. maybe because of their firewall.


alt


>>> 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")

xeroc

Quote from: alt on October 16, 2014, 01:30:00 AM
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?

Riverhead

Quote from: alt on October 16, 2014, 01:30:00 AM
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 :).

alt

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?

alt

Quote from: kokojie on October 13, 2014, 12:28:07 AM
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

  "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
  },

amencon

Quote from: xeroc on October 13, 2014, 06:57:32 AM
Quote from: kokojie on October 13, 2014, 12:28:07 AM
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
"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.

xeroc

Quote from: kokojie on October 13, 2014, 12:28:07 AM
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
"common2": "update the feed price at least 23.5 hours a time",
"max_update_hours": 23.5,

emski

Quote from: kokojie on October 13, 2014, 12:28:07 AM
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.
[url="https://bitsharestalk.org/index.php/topic,9857.0.html"]https://bitsharestalk.org/index.php/topic,9857.0.html[/url]