New Electrocardiogram Chart

New Electrocardiogram Chart
New Electrocardiogram Chart

This is an attempt to develop alternative visualisation of financial charts that enables users to visualise intrabar movements along with OHLC values

Link to the Indicator:  New Electrocardiogram Chart

Structure of new chart components

Instead of candles/bars, this type of chart contains Electrocardiogram blocks that resemble the heartbeat signals on an electrocardiogram

  • Body colour of the block is defined by the open and closed prices of the bar. If close is greater than open, the body is green. Otherwise, the body is painted red.
  • Border colour of the block is defined by the close prices of the current and previous bar. If the close of the current bar is greater than that of the last bar, then the border colour is green. Otherwise, the border colour is painted red

Inside each block, there will be 5 connecting lines called signal lines.

  • open-open
  • open-first peak(high or low of the bar whichever comes first)
  • first peak-second peak(high or low of the bar whichever comes last)
  • second peak-close
  • close-close

The colour of the signal lines is determined by which among the high/low bars comes last. If the highest part of the bar is reached after reaching the lowest part of the bar, then signal lines are coloured green signifying bullish sentiment towards the end of the bar. If the lowest part of the bar is reached after reaching the highest part of the bar, then signal lines are coloured red signifying bearish sentiment towards the end of the bar.

Pictorial examples here:

New Electrocardiogram Chart
New Electrocardiogram Chart

 Limitations with Pinescript implementation

  • Since Pinescript can only use a maximum of 500 lines and each block will take 1 box and 5 lines, it is not possible to display more than 100 bars.
  • Each block of the new Electrocardiogram chart will take the space of 7 bars of a candlestick chart. Due to this, the alignment of regular OHLC candles is not inline with the new chart type. Background highlighting is done for the part of the OHLC candles where Electrocardiogram blocks are plotted so that it helps users to map the bars manually

Comments