Skip to main content

CloudQuant charting

CloudQuant Charting is a Python library for creating branded financial visualizations using the CloudQuant Data Liberator API. Import statement:

Chart types

Histogram

Generates distribution/histogram charts with CloudQuant branding. Returns: plotly.graph_objs._figure.Figure Required arguments:
  • df - pandas DataFrame containing data
  • col - string name of column to visualize
Optional arguments:
  • title, xlabel, ylabel - support HTML tags like <b>, <i>, <br>
  • histnorm - normalization type: 'percent', 'probability', 'density', or 'probability density'
  • width, height - dimensions in pixels (min 400px)
  • overlay_df, overlay_col - add comparison series
Example:

Candlestick

Generates OHLC candlestick charts with optional technical studies and overlays. Returns: Single figure or array of figures (depending on studies) Required arguments:
  • df - DataFrame with OHLC data (minimum 20 bars)
Optional arguments:
  • title, xlabel, ylabel - chart labels with HTML support
  • width, height - dimensions (min 700px width, 400px height)
  • open, high, low, close, timestamp - column names
  • entry_px, entry_time, close_px, close_time, entry_side - trade annotations
  • overlay_df, overlay_col, overlay_col2 - secondary axis data
Supported Studies (Single Figure): BBANDS, DEMA, EMA, HT_TRENDLINE, KAMA, MA, MAMA, MIDPOINT, MIDPRICE, SAR, SAREXT, SMA, T3, TEMA, TRIMA, WMA Supported Studies (Array of Figures): ADX, ADXR, APO, AROON, AROONOSC, BOP, CCI, CMO, DX, MACD, MACDEXT, MFI, MINUS_DI, MINUS_DM, MOM, PLUS_DI, PLUS_DM, PPO, ROC, ROCP, ROCR, ROCR100, RSI, STOCH, STOCHF, STOCHRSI, TRIX, ULTOSC, WILLR, ATR, MACDFIX, NATR, TRANGE Example:

LineChart

Creates line charts with support for studies and secondary Y-axis. Returns: plotly.graph_objs._figure.Figure Required arguments:
  • df - pandas DataFrame
  • cols - list of column names to plot
  • x_column - column name for X-axis (defaults to index)
Optional arguments:
  • title, xlabel, ylabel - chart labels with HTML support
  • width, height - dimensions
  • y2axis_name - activates secondary Y-axis
  • overlay_df, overlay_cols - secondary axis data
  • study - technical study name
  • study_columns - columns for study calculation
  • timeperiod - study periods
Supported Studies: BBANDS, MAMA, DEMA, EMA, HT_TRENDLINE, KAMA, MA, MIDPOINT, MIDPRICE, SAR, SAREXT, SMA, T3, TEMA, TRIMA, WMA Example:

BarChart

Generates bar charts, including stacked bars for repeated X values. Returns: plotly.graph_objs._figure.Figure Required arguments:
  • df - pandas DataFrame
  • xcol - column name for X-axis
  • ycol - numeric column for Y-axis
Optional arguments:
  • title, xlabel, ylabel - labels with HTML support
  • width, height - dimensions
  • singlecolor - boolean for uniform color (defaults True)
  • orientation - 'v' (vertical) or 'h' (horizontal)
Example:

PieChart

Generates pie/donut charts with customizable hole size. Returns: plotly.graph_objs._figure.Figure Required arguments:
  • df - pandas DataFrame
  • labelcol - column name for labels
  • valuecol - numeric column for slice size
Optional arguments:
  • title - chart title with HTML support
  • width, height - dimensions
  • hole - donut hole size (0-1, where 0 = no hole)
  • colors - color sequence: default CQ palette, or 'reds', 'greens', 'blues'
Example:

GroupedBarChart

Generates grouped bar charts comparing multiple numeric columns. Returns: plotly.graph_objs._figure.Figure Required arguments:
  • df - pandas DataFrame
  • groups - column name for grouping
  • values - list of numeric column names
Optional arguments:
  • title, group_label, value_label - labels with HTML support
  • width, height - dimensions
  • colors - color list (cycles through bars)
  • orientation - 'v' or 'h'
Example:

ScatterPlot

Generates scatter plots with optional bubble sizing and color coding. Returns: plotly.graph_objs._figure.Figure Required arguments:
  • df - pandas DataFrame
  • x_column - numeric column for horizontal axis
  • y_column - numeric column(s) for vertical axis
Optional arguments:
  • title, xlabel, ylabel - labels with HTML support
  • width, height - dimensions
  • size_column - numeric column for bubble size (negative values show red/green)
  • size_multiplier - multiplier to adjust bubble sizes
Example:

addNotes

Adds annotations/callouts to existing charts for highlighting specific data points. Returns: plotly.graph_objs._figure.Figure Arguments:
  • thefig - figure from a CloudQuant charting function
  • notes - list of dictionaries with x, y, and note keys
Example: