rate_cny["HERTZ"] = compute_hertz() * rate_cny["USD"]
In the above snippet of code, does rate_cny["USD"]
result in the bitCNY:bitUSD rate, or the BTS:bitUSD rate?
If it's not BTS:bitUSD then it will not line up with the other hertz price feeds.
It is: CNY/USD rate (FIAT not bit).
The rates are taken from hq.sina.cn (see btsprice/sina.py). Yahoo Finance API could be as source also, but the service has been closed by Yahoo. It might worth updating the scripts to get another source of rates like Alpha Vantage API (
https://www.alphavantage.co/).. but this is another topic.
The formula does not end here, you have at btsprice/feedprice.py:161
self.price_queue[asset].append(bts_price_in_cny / self.bts_price.rate_cny[asset])
The main work (and difference) of alt's script is to compute 'bts_price_in_cny' from a variety of exchange's _order books_ (not tickers), then compute all other prices using the rate CNY / XXX.
I didn't change this principle, as I think it's the behavior expected by the witnesses are using this script maybe because they trust the BTS/CNY rate more than the others.
This mean the complete formula is:
BTS/CNY / (compute_HERTZ() * CNY/USD)
I hope this is fine.
Do not hesitate to do a review of the pull request. It will be easier to discuss around the code.
I'm not a witness so I can't test the publication. I'll try to setup it on testnet when I will have some time (probably next week).
Let me know if a witness using alt's script is avialable for testing.
I've got the hertz name reserved on testnet, I can provide you price feed publish rights on testnet if you're interested.
In the mean time, there were multiple witnesses on bitsharestalk who stated that they would consider supporting hertz once integrated into btsprice - I'll reach out to them in the next couple days.
I'll contact you or any witnesses in private so we can proceed with more testing.