interactive_plot: Interactive plot with dygraph

View source: R/interactive_plot.R

interactive_plotR Documentation

Interactive plot with dygraph

Description

This function takes a data frame and returns an interactive plot for the portfolio data. The plot is zoomable and specific data can be shown once the cursor is placed on the graph.

Usage

interactive_plot(x, type)

Arguments

x

A data frame that the function takes in.

type

The value depicted by the plot, choices are nmv, gmv, contract, pnl and ret.

Details

For all bar plots, green represents profit and red represents loss. This function also calculates gmv, cumulative P&L and return rates if these statistics are not in the data frame. Number of contracts will all be zero if the column is missing.

Value

A plot. Red bars indicate loss and green bars indicate profits.


knightsay/backtestGraphics documentation built on Jan. 27, 2025, 10:35 a.m.