Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
right: yAxisWidth
})
.decorate(function(selection) {
selection.enter()
.selectAll('defs')
.data([0])
.enter()
.append('defs')
.html('');
});
// Create and apply the Moving Average
var movingAverage = fc.indicator.algorithm.movingAverage();
var bollingerAlgorithm = fc.indicator.algorithm.bollingerBands();
function updateMultiSeries() {
var baseChart = [gridlines, currentSeries.option, closeLine];
var indicators = currentIndicators.map(function(indicator) { return indicator.option; });
return baseChart.concat(indicators, crosshair);
}
function updateYValueAccessorUsed() {
movingAverage.value(currentYValueAccessor);
bollingerAlgorithm.value(currentYValueAccessor);
closeLine.value(currentYValueAccessor);
switch (currentSeries.valueString) {
case 'line':
case 'point':
currentSeries.option.yValue(currentYValueAccessor);
})
.decorate(function(selection) {
selection.enter()
.selectAll('defs')
.data([0])
.enter()
.append('defs')
.html('');
});
// Create and apply the Moving Average
var movingAverage = fc.indicator.algorithm.movingAverage();
var bollingerAlgorithm = fc.indicator.algorithm.bollingerBands();
function updateMultiSeries() {
var baseChart = [gridlines, currentSeries.option, closeLine];
var indicators = currentIndicators.map(function(indicator) { return indicator.option; });
return baseChart.concat(indicators, crosshair);
}
function updateYValueAccessorUsed() {
movingAverage.value(currentYValueAccessor);
bollingerAlgorithm.value(currentYValueAccessor);
closeLine.value(currentYValueAccessor);
switch (currentSeries.valueString) {
case 'line':
case 'point':
currentSeries.option.yValue(currentYValueAccessor);
break;
export default function() {
var dispatch = d3.dispatch(event.viewChange);
var renderer = fc.indicator.renderer.relativeStrengthIndex();
var algorithm = fc.indicator.algorithm.relativeStrengthIndex()
.value(function(d) { return d.close; });
var tickValues = [renderer.lowerValue(), 50, renderer.upperValue()];
var chart = base()
.series([renderer])
.yTickValues(tickValues)
.on(event.viewChange, function(domain) {
dispatch[event.viewChange](domain);
});
function rsi(selection) {
var model = selection.datum();
algorithm(model.data);
chart.trackingLatest(model.trackingLatest)
export default function() {
var dispatch = d3.dispatch(event.viewChange);
var renderer = fc.indicator.renderer.relativeStrengthIndex();
var algorithm = fc.indicator.algorithm.relativeStrengthIndex()
.value(function(d) { return d.close; });
var tickValues = [renderer.lowerValue(), 50, renderer.upperValue()];
var chart = base()
.series([renderer])
.yTickValues(tickValues)
.on(event.viewChange, function(domain) {
dispatch[event.viewChange](domain);
});
function rsi(selection) {
var model = selection.datum();
algorithm(model.data);
chart.trackingLatest(model.trackingLatest)
.xDomain(model.viewDomain)
return d.movingAverage;
});
movingAverage.id = util.uid();
var movingAverageOption = model.menu.option(
'Moving Average',
'movingAverage',
movingAverage,
'bf-icon-moving-average-indicator',
true
);
movingAverageOption.option.extentAccessor = function(d) {
return d.movingAverage;
};
var bollingerBands = fc.indicator.renderer.bollingerBands();
bollingerBands.id = util.uid();
var bollingerBandsOption = model.menu.option(
'Bollinger Bands',
'bollinger',
bollingerBands,
'bf-icon-bollinger-bands-indicator',
true
);
bollingerBandsOption.option.extentAccessor = [
function(d) {
return d.bollingerBands.lower;
},
function(d) {
return d.bollingerBands.upper;
}
export default function() {
var dispatch = d3.dispatch(event.viewChange);
var zeroLine = fc.annotation.line()
.value(0)
.label('');
var renderer = fc.indicator.renderer.macd();
var algorithm = fc.indicator.algorithm.macd();
var chart = base()
.series([zeroLine, renderer])
.yTicks(5)
.mapping(function(series) {
return series === zeroLine ? [0] : this;
})
.decorate(function(g) {
g.enter()
.attr('class', function(d, i) {
return ['multi zero', 'multi'][i];
});
})
.on(event.viewChange, function(domain) {
dispatch[event.viewChange](domain);
});
export default function() {
var dispatch = d3.dispatch(event.viewChange);
var zeroLine = fc.annotation.line()
.value(0)
.label('');
var renderer = fc.indicator.renderer.macd();
var algorithm = fc.indicator.algorithm.macd();
var chart = base()
.series([zeroLine, renderer])
.yTicks(5)
.mapping(function(series) {
return series === zeroLine ? [0] : this;
})
.decorate(function(g) {
g.enter()
.attr('class', function(d, i) {
return ['multi zero', 'multi'][i];
});
})
.on(event.viewChange, function(domain) {
dispatch[event.viewChange](domain);