Edit in JSFiddle

var stxx = new CIQ.ChartEngine({
  container: $$$(".chartContainer")
}); // Declare a CIQ.ChartEngine object. This is the main object for drawing charts.

stxx.loadChart("SPY", sampleData, function() {
  // add anything you want done in the callback

  // in this case we are adding a moving average study
  var inputs = {
    "Period": 50,
    "Field": "Close",
    "Type": "ma"
  };
  var outputs = {
    "MA": "red"
  };
  CIQ.Studies.addStudy(stxx, "ma", inputs, outputs);

  // and a volume underlay
  CIQ.Studies.addStudy(
    stxx,
    "vol undr", {}, {
      "Up Volume": "blue",
      "Down Volume": "yellow",
      "Up Border": "red",
      "Down Border": "green",
    }
  );
});
<div class="chartContainer" style="width:600px;height:400px;position:relative;"></div>

<script src="https://jsfiddle.chartiq.com/chart/examples/data/STX_SAMPLE_DAILY.js"></script>
<script src="https://jsfiddle.chartiq.com/chart/js/chartiq.js"></script>