Giter Club home page Giter Club logo

lightstreamer-example-marketdepth-client-javascript's Introduction

Lightstreamer - Market Depth Demo - HTML Client

The Market Depth Demo is a very simple market depth application based on Lightstreamer for its real-time communication needs.

This project includes a web client front-end for the demo. The server-side part of this demo, the Metadata and Data Adapters, is covered in this project: Lightstreamer - Market Depth Demo - Java Adapter.

Live Demo

screenshot

### View live demo

Details

Market depth is an electronic list of buy and sell orders, organized by price level and updated to reflect real-time market activity. Market depth data are also known as Level II, Depth Of Market (DOM), and the order book.

Lightstreamer has semi-native support for market depth, which can be managed very easily via COMMAND mode subscriptions. Basically, the bid and ask lists for an instrument will be two items subscribed to in COMMAND mode.
You will be able to add, update, and remove rows, where each row is identified by a key, which is the price. Lightstreamer will take care of aggregating updates to market depth in the most optimized way, based on bandwidth and frequency constraints.
This way, you will be able to manage full market depths even on unreliable networks and also benefit from update resampling with conflation, if needed.

The demo is based on an adapter that simulates the generation of random orders and any contracts in case of matching. Furthermore you can add orders at your convenience through the basic input form (only limited orders are allowed).

The demo includes the following client-side functionalities:

  • A Subscription containing 1 item, subscribed to in MERGE mode feeding a StaticGrid (showing summary data for the stock).
  • Two Subscriptions containing 1 item each, subscribed to in COMMAND mode feeding two DynaGrids (showing the bid and ask lists).
  • The orders are sent to the adapter through the Lightstreamer Server using the LightstreamerClient.sendMessage utility.

Install

If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:

  • As prerequisite, the Lightstreamer - Market Depth Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
  • Download this project.
  • Get the lightstreamer.js file from the latest Lightstreamer distribution and put it in the src/js folder. Alternatively, you can build a lightstreamer.js file from the online generator. In that case, be sure to include the LightstreamerClient, Subscription, StaticGrid, DynaGrid, and StatusWidget modules and to use the "Use AMD" version.
  • Get the require.js file form requirejs.org and put it in the src/js folder.
  • Deploy this demo on the Lightstreamer Server (used as Web server) or in any external Web Server. In the former case, please create the folders <LS_HOME>/pages/MarketDepthDemo and copy here the contents of the /src folder of this project. The client demo configuration assumes that Lightstreamer Server, Lightstreamer Adapters, and this client are launched on the same machine. If you need to target a different Lightstreamer server, please search in js/lsClient.js this line:
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"MARKETDEPTH");

and change it accordingly.

See Also

Lightstreamer Adapters Needed by This Client

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer JavaScript Client library version 6.2 or newer.

lightstreamer-example-marketdepth-client-javascript's People

Contributors

bravo27 avatar dario-weswit avatar mone 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.