Giter Site home page Giter Site logo

encounter-with-javafx-java8's Introduction

SonarTrading

Requirments

  1. JDK 1.8
  2. Apache Maven 3.5.2
  3. git client

Build and Run

  1. Clone the Project
  2. Navigate to Project folder and run the command mvn clean package sonar
  3. It creates target folder and jar.Navigate to the target folder and run the command java -jar SonarTrading-0.0.1-SNAPSHOT.jar sonar
  4. It starts the Application sonar sonar

Configuration

In src/main/resources/config.properties:

  1. webSocketURL=wss://ws.bitso.com
  2. restAPIURL=https://api.bitso.com
  3. upTick=3
  4. downTick=3
  5. maxOrders=50
  6. minOrders=50

Check List

Feature File name Method name
Schedule the polling of trades over REST. TradeRestService.java callRestService()
Request a book snapshot over REST. OrderRestService.java callRestService()
Listen for diff-orders over websocket. OrderWebSocketCall.java sendMessage()
Replay diff-orders. OrderWebSocketCall.java createOrderBook()
Use config option X to request recent trades. config.properties maxOrders
Use config option X to limit number of ASKs displayed in UI. config.properties maxOrders
The loop that causes the trading algorithm to reevaluate. TradeWebSocketCall tradingStrategy()

Bitcoin Trading App integrating with BitSo using JAVAFX and JAVA8

com\sonar\view Sonar.fxml is the fromt end interface using SceneBuilder

SonarMainclass loads this fxml and it is binded with our controller SonarController.java file

SonarController.java initialises the components and call the REST API

a) Fetch the latest OrderBook (OrderRestService.java) and map the JSON to the POJO (OrderAsks.java,OrderBids.java)
b) Fetch the latest Trade     (TradeRestService.java) and map the JSON to the POJO (TradeOrder.java)

SonarController.java captilizes on the CompletableFeature of JAVA8,So call WebSocket URL on Order and Trade after REST using thenApply

a) Fetch Live-Feed for OrderBook (OrderWebSocketCall.java) and map the result to POJO (OrderAsks.java,OrderBids.java)

      add the POJO to an ObserVableList if status is OPEN 
      remove the POJO from list using JAVA8 Predicate removeIf

b) Fetch Live-Feed for TradeBook (TradeWebSocketCall.java) and map the result to POJO (TradeOrder.java)

        check for the latest price with previous trade price,if higher then increase UpTick count by 1,downtick to 0
        check for the latest price with previos trade price ,if lesser then increase downTick count by 1,upTick to 0

encounter-with-javafx-java8's People

Contributors

smfaizalkhan avatar

Watchers

James Cloos 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.