Series without primary instrument
Sample of how to add a series to a chart without having a primary instrument
by sonylnagale
HTML
<link rel="stylesheet" type="text/css" href="https://jsfiddle.chartiq.com/chart/css/stx-chart.css" media="screen" />
<div class="chartContainer" style="width:100%;height:400px;position:relative;"></div>
JavaScript
import { CIQ } from "https://jsfiddle.chartiq.com/chart/js/advanced.js";
// Declare a CIQ.ChartEngine object. This is the main object for drawing charts.
const stxx = new CIQ.ChartEngine({ container: document.querySelector(".chartContainer") });
// Set the periodicity to match what is in your series
const series = [
{
"DT": "2022-05-09T04:00:00.000Z",
"Open": 84.11,
"High": 84.74,
"Low": 83.95,
"Close": 84.66,
"Volume": 36958623,
"Date": "20220509000000000",
"ratio": 1,
"iqPrevClose": 84.31,
"atr": 1.0024939131112147,
"trueRange": 0.789999999999992,
"hl/2": 84.345,
"hlc/3": 84.45,
"hlcc/4": 84.5025,
"ohlc/4": 84.36500000000001,
"tick": 221,
"candleWidth": null
},
{
"DT": "2022-05-10T04:00:00.000Z",
"Open": 85.92,
"High": 85.96,
"Low": 85.54,
"Close": 85.6,
"Volume": 33057367,
"Date": "20220510000000000",
"ratio": 1,
"iqPrevClose": 84.66,
"atr": 1.017369217455654,
"trueRange": 1.2999999999999972,
"hl/2": 85.75,
"hlc/3": 85.7,
"hlcc/4": 85.675,
"ohlc/4": 85.755,
"tick": 222,
"candleWidth": null
},
{
"DT": "2022-05-11T04:00:00.000Z",
"Open": 86.18,
"High": 86.98,
"Low": 85.88,
"Close": 86.24,
"Volume": 58459162,
"Date": "20220511000000000",
"ratio": 1,
"iqPrevClose": 85.6,
"atr": 1.0355007565828718,
"trueRange": 1.3800000000000097,
"hl/2": 86.43,
"hlc/3": 86.36666666666667,
"hlcc/4": 86.33500000000001,
"ohlc/4": 86.32000000000001,
"tick": 223,
"candleWidth": null
},
{
"DT": "2022-05-12T04:00:00.000Z",
"Open": 85.29,
"High": 86.35,
"Low": 85.08,
"Close": 85.69,
"Volume": 58315782,
...