function drawIndicators(indicators) {
  for (const indicator of indicators) {
    // get type, settings and plot index of the indicator
    let {type, settings, plotIndex} = indicator;

    // if no plot index in the app state item, set plots count as plot index
    if (plotIndex === undefined) plotIndex = chart.getPlotsCount();

    // create new plot
    const plot = chart.plot(plotIndex);

    // for slow/fast stochastic use 'stochastic' type
    if (type.toLowerCase().includes('stochastic')) {
      plot['stochastic'].apply(plot, [mapping, ...settings]);
    } else {
      plot[type].apply(plot, [mapping, ...settings]);
    }
    // adding extra Y axis to the right side
    plot.yAxis(1).orientation('right');
  }

  // set indicator type select value and refresh selectpicker
  $indicatorTypeSelect.val(app.state.indicators.map(item => item.type)).selectpicker('refresh');
}
/**
 * Draw Indicators using settings from app state
 * @param {Array} indicators array with indicators settings
 */
Draw Indicators using settings from app state
@param {Array} indicators array with indicators settings
Draw Indicators using settings from app state @param { Array } indicators array with indicators settings
function drawIndicators(indicators) {
  for (const indicator of indicators) {
    let {type, settings, plotIndex} = indicator;
    if (plotIndex === undefined) plotIndex = chart.getPlotsCount();
    const plot = chart.plot(plotIndex);
    if (type.toLowerCase().includes('stochastic')) {
      plot['stochastic'].apply(plot, [mapping, ...settings]);
    } else {
      plot[type].apply(plot, [mapping, ...settings]);
    }
    plot.yAxis(1).orientation('right');
  }
  $indicatorTypeSelect.val(app.state.indicators.map(item => item.type)).selectpicker('refresh');
}
function drawIndicators ( indicators ) { for ( const indicator of indicators ) { let { type , settings , plotIndex } = indicator ; if ( plotIndex === undefined ) plotIndex = chart . getPlotsCount ( ) ; const plot = chart . plot ( plotIndex ) ; if ( type . toLowerCase ( ) . includes ( 'stochastic' ) ) { plot [ 'stochastic' ] . apply ( plot , [ mapping , ... settings ] ) ; } else { plot [ type ] . apply ( plot , [ mapping , ... settings ] ) ; } plot . yAxis ( 1 ) . orientation ( 'right' ) ; } $indicatorTypeSelect . val ( app . state . indicators . map ( item => item . type ) ) . selectpicker ( 'refresh' ) ; }
Draw Indicators using settings from app state
 @param {Array} indicators array with indicators settings
Draw Indicators using settings from app state @param { Array } indicators array with indicators settings
// get type, settings and plot index of the indicator // if no plot index in the app state item, set plots count as plot index // create new plot // for slow/fast stochastic use 'stochastic' type // adding extra Y axis to the right side // set indicator type select value and refresh selectpicker