Learn R Programming

obAnalytics (version 0.1.1)

plotEventMap: Plot limit order event map.

Description

Generates a visualisation of limit order events (excluding market and market limit orders).

Usage

plotEventMap(events, start.time = min(events$timestamp), end.time = max(events$timestamp), price.from = NULL, price.to = NULL, volume.from = NULL, volume.to = NULL, volume.scale = 1)

Arguments

events
Limit order events data.frame.
start.time
Plot events from this time onward.
end.time
Plot events up until this time.
price.from
Plot events with price levels >= this value.
price.to
Plot events with price levels
volume.from
Plot events with volume >= this value relevant to volume.scale
volume.to
Plot events with volume
volume.scale
Volume scale factor.

Details

  • Ask side orders = red.
  • Bid side orders = blue.
  • Volume of order determines size of circle.
  • Opaque = volume was added.
  • Transparent = volume was removed.

Examples

Run this code

## Not run: 
# 
# # plot all orders 
# with(lob.data, plotEventMap(events))
# ## End(Not run)

# 1 hour of activity and re-scale the volume
with(lob.data, plotEventMap(events,
    start.time=as.POSIXct("2015-05-01 03:30:00.000", tz="UTC"),
    end.time=as.POSIXct("2015-05-01 04:00:00.000", tz="UTC"),
    volume.scale=10^-8))

# 15 minutes of activity >= 5 (re-scaled) volume within price range
# $ [220, 245]
with(lob.data, plotEventMap(events,
    start.time=as.POSIXct("2015-05-01 03:30:00.000", tz="UTC"),
    end.time=as.POSIXct("2015-05-01 03:45:00.000", tz="UTC"),
    price.from=220,
    price.to=245,
    volume.from=5,
    volume.scale=10^-8))

Run the code above in your browser using DataLab