I've done some modifications to xeroc's (which was derived from alt's version) version of the price feed script.
You can see it here:
https://github.com/emilvelichkov/pytsharesBasically I've added weighting of each exchange so a delegate could select which exchange matters more.
Also I've changed the conditions when the feed is published:
Nothing except time restrictions and price difference is taken into account. If price differs more than [-max_negative_diff , max_positive_diff]*MyLastFeed feed is published. By default: [-0.2%, 0.5%].
Feeds cannot be published more frequently than minFeedAgeInSeconds.
Also I've changed the logic of price fetching to include additional validation and to ignore error from exchanges with low trust_level. This way failure to fetch price data from low trusted exchange will not prevent the calculation and publishing of feeds.
It is still experimental so some issues might arise. Some proof-read is welcome.
Here is the full changelog:
+ added minFeedAgeInSeconds (minimum time between feed publish)
+ added minValidAssetPrice (any feed for asset with lower price will be ignored)
+ added max_positive_diff/max_negative_diff (asset price should increase more than max_positive_diff in order to be published)
+ added exchange trust level (it multiplies the volume of the exchange.)
* changed publish_rule in the following way:
price is published if maxFeedAgeInSeconds have passed
price is published if price of any asset changes more than [-max_negative_diff, max_positive_diff]
* Errors fetching prices from any exchange are ignored unless exchange_trust_level > 0.8 (this is to prevent single small exchange from stopping all feeds)