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
  • Candles – independent OHLC candles produced by an indicator
  • 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

Candles

A candles plot lets an indicator draw its own OHLC series without replacing the chart candles. Declare it with @plot.candles() and return a plot.Candles value for every bar:
The decorator defines the default body colors and whether the wick and border are visible. A returned candle can override its body, wick and border colors for one bar and can use an offset. If any OHLC value is NaN, that candle is not drawn. See @candles() and Candles for all options.

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

Colors

Every plot style above takes a color. There are three ways to get one:
color.hex() is handy when you copy a palette from a design tool or another platform. It takes exactly #RRGGBB, upper or lower case. Shorthand #1E9, eight-digit #1E90FF80, or a string without # compile, but stop the indicator at runtime with invalid hex color: expected #RRGGBB. For transparency, call the color with an alpha value from 0.0 to 1.0, as in the last line. A hex color works anywhere a color does — in a plot decorator and as the default of a color input, which users can then change in the indicator settings:
All built-in constants and functions are listed in the indie.color reference. 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!