Giter Site home page Giter Site logo

coin-trading's Introduction

Stock Trading

Application that connects to the Bitso cryptocurrency exchange, maintains state between the application and Bitso, and simulates trade execution following a simple trading strategy.

CircleCI Coverage Status

Usage

Assumptions

  • Regarding "Display the X most recent trades on the same UI". The X represents the same number as in the best bids and best asks configuration.

  • X will have a maximum of 500.

  • If X is greater than the available trades at any particular moment the UI will display the maximum number of trades at that moment.

  • Imaginary or simulated trades created using "contrarian trading strategy" will have the same info (id, price, created_at, etc.) as the previous trade.

  • The default value of M and N is three.

  • If M is zero or less than zero no simulated trade will be added.

  • If N is zero or less than zero no simulated trade will be added.

  • When a new simulated trade is created using the "contrarian trading strategy", the upticks and downticks count will reset. E.g.

    M = 3
    N = 3
    price = 1000  //uptick = 0, downtick = 0
    price = 1001  //uptick = 1, downtick = 0
    price = 1002  //uptick = 2, downtick = 0
    price = 1003  //uptick = 3, downtick = 0
    price = 1003  //uptick = 0, downtick = 0 New simulated trade, count reset
    price = 1004  //uptick = 1, downtick = 0
  • Uptick and downtick counting will start right after the system preloads old trades. E.g.

    // System starts and shows old trades
    price = 1000
    price = 1001
    price = 1002
    price = 1003
    // Then the systems retrieves new trades and starts counting
    price = 1004  //uptick = 0, downtick = 0
    price = 1002  //uptick = 0, downtick = 1

Checklist

Feature File name Method name
Schedule the polling of trades over REST. TradingService start
Request a book snapshot over REST. OrderBookUpdater loadOrderBook
Listen for diff-orders over websocket. DiffOrdersMessageHandler onMessage
Replay diff-orders. DiffOrderApplier applyDiffOrders
Use config option X to request recent trades. TradingService getLastTrades
Use config option X to limit number of ASKs displayed in UI. OrderBookHolder getBestAsks
The loop that causes the trading algorithm to reevaluate. TradingSimulator addSimulatedTrades

coin-trading's People

Contributors

alayor avatar

Watchers

 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.