Code Monkey home page Code Monkey logo

hippo's Introduction

Hippo

A cryptocurrency exchange recording and playback package, based on the XChange library.

Reading Usage

To read data, you will need a database with data in it. A read only one is provided for you. You'll need to set your environment variables upon launch to the following values:

HIPPO_DB_URL=mongo.nefariousplan.com
HIPPO_DB_NAME=cryptomarkets
HIPPO_DB_USERNAME=hippo
HIPPO_DB_PASSWORD=hippo

Then, make a new MongoTickerDatabase, and get the feed for the currency pair, and turn that into a OHLCV data set:

TickerDatabase ticker = new MongoTickerDatabase("Bittrex");
Set<Trade> rawPriceData = ticker.get(new CurrencyPair("BTC", "USDT"));
OHLCVDataSet data = new OHLCVDataSet(rawPriceData, Duration.standardHours(1));

You can them stream that into any data analysis:

WeightedMovingAverageFunction wma = new WeightedMovingAverageFunction(10);
  data.stream().map(x -> new WeightedSample(x.volume, BigDecimal.ONE)).forEach(x -> {
  wma.addSample(x);
});

Writing Usage

To write data, you will need to provide your own database and credentials in the environment variables.

Then construct your XChange exchange adapter:

Exchange cryptopiaExchange = new CryptopiaExchange();
cryptopiaExchange.applySpecification(cryptopiaExchange.getDefaultExchangeSpecification());
exchanges.add(cryptopiaExchange);

And give it to a LiveTickerWriter:

new LiveTickerWriter(exchange);

And watch the data stream in!


All software is Copyright of Travis Savo [email protected] and is licensed under the Apache License Version 2.0 AS IS without any guarentee that it will work or not do something stupid.

hippo's People

Contributors

tsavo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.