Thanks. This is an interesting solution. since im plotting the 'signal' series separately right now, i think it would require some looping or map to convert that series as
markers im guessing. What i had so far prior to reading your suggestion was the folloowing:
In code i iterate over my model and build a 'series' array first then build the chart, assign the series to that chart. My model has an 'stype' propertly that tells it what kind of series it is (i.e. Candlestick, ohlc, scatter). In the case of a signal, it is 'signal_buy' or 'signal_sell', but the values are still ohlc values. the code looks like this:
Code: Select all
series.push({
type: s.stype,
id: s.descr,
name: s.descr,
data: s.data.values,
yAxis: (s.y2_axis)? y_axis_idx+1 : y_axis_idx,
dataGrouping: {
enabled: false,
units: groupingUnits
},
color: get_color(s.stype, 'dn', s.color),
upColor: get_color(s.stype, 'up', s.color),
opacity: s.opacity,
tooltip: { valueDecimals: 2 },
});
if (['signal_buy', 'signal_sell'].includes(s.stype)){
var s1 = series[series.length-1];
s1.type = 'scatter';
s1.marker = {
symbol: (s.stype == 'signal_buy')?'triangle':'triangle-down'
}
}
With the above, i am able to get the marker for the 'signal' series. Now i need to just offset it to draw at an offset about the HIGH value or LOW value for.