# Plotting candlesticks - is it possible?

**URL:** <https://community.tradovate.com/t/plotting-candlesticks-is-it-possible/269>\
**Category:** Custom Indicators\
**Tags:** complete\
**Created:** [June 11, 2020, 7:45pm UTC](https://community.tradovate.com/t/plotting-candlesticks-is-it-possible/269 "2020-06-11T19:45:40Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![paidtofade](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/paidtofade/32/160_2.png) [@paidtofade](https://community.tradovate.com/u/paidtofade)\
**Post date:** [June 19, 2020, 1:18pm UTC](https://community.tradovate.com/t/plotting-candlesticks-is-it-possible/269/3 "2020-06-19T13:18:52Z")

</div>

Circling back for others who want to see what @nom28 cleverly came up with for his excellent Smoothed Hieken Ashi indicator… combined with setting the base chart colors to transparent, you can simulate drawing candles using two lines, a thick one for the body and a thin one for the wicks… the key limitation that it will only look clean if the same colors are used for body and wicks, and no empty bodies, etc…

```
function candlestickPlotter(canvas, indicatorInstance, history) {
  for(let i=0; i<history.data.length; ++i) {
    const item = history.get(i);
    if (item.haOpen !== undefined
            && item.haHigh !== undefined
            && item.haLow !== undefined
            && item.haClose !== undefined) {
        const x = p.x.get(item);
        
        // candle body
        canvas.drawLine(
            p.offset(x, item.haOpen),
            p.offset(x, item.haClose),
            {
                color: item.haOpen > item.haClose ? indicatorInstance.props.fallingColor : indicatorInstance.props.risingColor,
                relativeWidth: 0.9,
            });
        
        // candle wicks   
        canvas.drawLine(
            p.offset(x, item.haHigh),
            p.offset(x, item.haLow),
            {
                color: item.haOpen > item.haClose ? indicatorInstance.props.fallingColor : indicatorInstance.props.risingColor,
                relativeWidth: 0.2,
            });
    }
}

```

}

---

_[View the full topic](https://community.tradovate.com/t/plotting-candlesticks-is-it-possible/269)._
