Skip to main content

Plot Styles in Indie Language

Currently, Indie supports the following plot styles:
  • Line – simple lines
Line
  • Markers – For example, dots, and crosses.
Marker
  • Steps – a line connecting points with horizontal steps
Steps
  • Histogram – bar charts with absolute-width lines
Histogram
  • Columns – bar charts with relative widths (0.0 to 1.0 relative to bar spacing)
Columns
  • Background – coloring the chart background based on indicator conditions
Background
  • Bar Color – changing the color of candlesticks on the chart
Bar Color To use these styles, you need two tools: a decorator for compile-time description and a class representing the plot value returned by the indicator:
All these entities are in the indie.plot package. Using them is easy, let’s look at some examples:
If you don’t need runtime parameter settings (like color or offset), you can return a simple float for most classes (Line, Steps, Histogram, Columns, Marker), and it will be cast automatically:
If your indicator only draws Line plots with default settings, you can skip the decorator for an even simpler code:
This example is a “Hello World” for indicators. If this is your first indicator, try running it on our platform before moving on.

Lines

Lines are the most common plot style and a great starting point. Let’s create a simple SMA Crossing indicator that draws multiple lines. We’ll enhance our previous example by adding two SMA lines:
  • Add @indie.plot.line(...) in the Main function decorator to declare and configure the line.
  • Return two floats with current line values for each bar.
We’ll use the SMA algorithm from Indie’s standard library. More on series data and algorithms can be found in our documentation. Here’s the code:
Let’s move hardcoded constants to indicator parameters for UI adjustments:
SMA cross Great job! Let’s make the indicator even better.

Markers

Let’s add markers for SMA line crosses. Using the logic established above:
  • Add a @plot.marker decorator,
  • Return an indie.plot.Marker object from Main:
Notice the display_options parameter - this allows you to hide the marker values from the “pill” and from the ordinate axis:
SMA cross with markers Now it is much easier to detect line crosses, even if the crosses are very weak.

Columns

We created an SMA Crossing indicator. To highlight crossovers visually, let’s build a supporting indicator with columns in a separate pane. An indicator by mustermann84 on our marketplace is free: Simple Crossover Signal Bars. Here’s its code:
It is much easier to search for line crosses with such an indicator: SMA Cross with columns

Histograms

Histograms in Indie are similar to columns but will gain more features in the future. Use histograms for data distributions or value differences, e.g., SMI Ergodic Oscillator shows the difference between TSI and its smoothed version:
SMI Ergodic Oscillator This built-in indicator is free for all users.

Steps

Steps displays data as step lines, ideal for discrete changes or support/resistance levels:
Support-Resistance with steps

Background

Background allows you to color the chart background based on conditions in your indicator. This is useful for highlighting specific market sessions, zones, or trading conditions. To use background coloring:
  • Add @plot.background(...) decorator
  • Return a plot.Background(...) object from the Main function
  • Set the color parameter to control the background color
  • Optionally use outline_left and outline_right to draw vertical lines at the edges
A great example is the built-in Trading Sessions indicator, which colors the pre-market and after-hours sessions:
In this example:
  • Two background plots are declared for pre-market and after-hours sessions
  • Each session gets its own color with transparency
  • color.TRANSPARENT is used when a bar is outside the session
  • The outline_left property draws a vertical line at session boundaries

Bar Color

Bar color allows you to change the color of candlesticks on the chart based on your indicator’s logic. This is perfect for highlighting unusual market activity or specific conditions. To use bar coloring:
  • Add @plot.bar_color() decorator
  • Return a plot.BarColor(...) object from the Main function
  • Set the color parameter to control the candlestick color
Let’s create an indicator that colors bars with unusually high volume, adapting the “Volume Spike Marker” example:
Bar color example In this example:
  • The indicator calculates a moving average of volume
  • When current volume exceeds the average by spike_coef times, the bar is colored yellow
  • None allows the bar to use default coloring when there’s no spike
  • The colored bars make it easy to spot unusual volume activity at a glance
You can combine bar coloring with other conditions, such as:
  • Price breakouts or breakdowns
  • Overbought/oversold conditions from oscillators
  • Pattern recognition results
  • Trend changes
We hope this guide helps you make the most of Indie’s plot styles when creating indicators. Experiment, build, and share your work with the community!