Situation
You want to know how to colour a price bar and how use colours as an input for an indicator.

Code example

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator
{
    [UpdateOnEveryTick(false)]
    [SameAsSymbol(true)]
    public class Example_ColourPriceBars : IndicatorObject
    {
        [Input]
        public Color UpbarColour { get; set; }

        [Input]
        public Color DownBarColour { get; set; }

        private IPlotObject plotOpen, plotHigh, plotLow, plotClose;

        public Example_ColourPriceBars(object _ctx) : base(_ctx) { }

        protected override void Create()
        {
            // Initialize the IPlotObjects
            plotHigh = AddPlot(new PlotAttributes("High",
                EPlotShapes.BarHigh, Color.Yellow));
            plotLow = AddPlot(new PlotAttributes("Low",
                EPlotShapes.BarLow, Color.Yellow));
            plotOpen = AddPlot(new PlotAttributes("Open",
                EPlotShapes.LeftTick, Color.Yellow));
            plotClose = AddPlot(new PlotAttributes("Close",
                EPlotShapes.RightTick, Color.Yellow));

            // Default values for the inputs
            UpbarColour = Color.Chartreuse;
            DownBarColour = Color.Violet;
        }

        protected override void CalcBar()
        {
            // With a higher close, use UpBarColour
            if (Bars.Close[0] > Bars.Open[0])
            {
                plotOpen.Set(Bars.Open[0], UpbarColour);
                plotHigh.Set(Bars.High[0], UpbarColour);
                plotLow.Set(Bars.Low[0], UpbarColour);
                plotClose.Set(Bars.Close[0], UpbarColour);
            }
            // With a lower close, use DownBarColour
            else if (Bars.Close[0] < Bars.Open[0])
            {
                plotOpen.Set(Bars.Open[0], DownBarColour);
                plotHigh.Set(Bars.High[0], DownBarColour);
                plotLow.Set(Bars.Low[0], DownBarColour);
                plotClose.Set(Bars.Close[0], DownBarColour);
            }
        }
    }
}

Output of the example

Applied to a chart, the indicator looks like:

Example of coloured price bars in MultiCharts .NET

Plotting paint bars in MultiCharts .NET

Several things are needed to paint bars. First, the indicator needs to be set to Same as symbol. This can be set in the indicator properties in the PowerLanguage Editor or with the SameAsSymbol attribute (line 9). To prevent the bar from being coloured on every tick, we also add the UpdateOnEveryTick attribute (line 8).

Two inputs are added to enable the user to specify the colours in the indicator settings:

[Input]
public Color UpbarColour { get; set; }

[Input]
public Color DownBarColour { get; set; }

Creating a plot object in MultiCharts .NET

Next we need to declare four IPlotObject objects: for the open, high, low, and close of a price bar (MultiCharts, 2013):

private IPlotObject plotOpen, plotHigh, plotLow, plotClose;

In the Create() override method we initialise these with the following settings and also give the two inputs a default value:

protected override void Create()
{
    // Initialise the IPlotObjects
    plotHigh = AddPlot(new PlotAttributes("High",
        EPlotShapes.BarHigh, Color.Yellow));
    plotLow = AddPlot(new PlotAttributes("Low",
        EPlotShapes.BarLow, Color.Yellow));
    plotOpen = AddPlot(new PlotAttributes("Open",
        EPlotShapes.LeftTick, Color.Yellow));
    plotClose = AddPlot(new PlotAttributes("Close",
        EPlotShapes.RightTick, Color.Yellow));

    // Default values for the inputs
    UpbarColour = Color.Chartreuse;
    DownBarColour = Color.Violet;
}

To draw a complete bar we need to use four EPlotShapes: BarHigh, BarLow, LeftTick, and RightTick for respectively the high, low, open, and close of a price bar (MultiCharts, 2013).

The names LeftTick and RightTick seem out of place, but these refer to the classical OHLC bars, which have a left tick for the open price and a right tick to signal the close.

Setting plot values in MultiCharts .NET

Finally, in the CalcBar() method the four plots are painted conditionally depending on the relation of the close to the open:

protected override void CalcBar()
{
    // With a higher close, use UpBarColour
    if (Bars.Close[0] > Bars.Open[0])
    {
        plotOpen.Set(Bars.Open[0], UpbarColour);
        plotHigh.Set(Bars.High[0], UpbarColour);
        plotLow.Set(Bars.Low[0], UpbarColour);
        plotClose.Set(Bars.Close[0], UpbarColour);
    }
    // With a lower close, use DownBarColour
    else if (Bars.Close[0] < Bars.Open[0])
    {
        plotOpen.Set(Bars.Open[0], DownBarColour);
        plotHigh.Set(Bars.High[0], DownBarColour);
        plotLow.Set(Bars.Low[0], DownBarColour);
        plotClose.Set(Bars.Close[0], DownBarColour);
    }
}

See the article about painting bars with random colours for another example of colouring price bars.

References

MultiCharts (April 2013). MultiCharts .NET Programming Guide (version 1.0). Retrieved from http://www.multicharts.com/downloads/MultiCharts.NET-ProgrammingGuide-v1.0.pdf