Bar indicator

The bar indicator accepts single values as input and produces one value. The number of the bar also comes to the entrance (variable i).

  1. An example of an indicator that takes two numbers and displays the average value:

using TSLab.Script.Handlers;

namespace MyLib
{
    [HandlerCategory("MyLib")]
    [HandlerName("HandlerWithNumber")]
    [InputsCount(2)]
    [Input(0, TemplateTypes.DOUBLE, false, "list1")]
    [Input(1, TemplateTypes.DOUBLE, false, "list2")]
    [OutputsCount(1)]
    [OutputType(TemplateTypes.DOUBLE)]
    public class HandlerWithNumber : IValuesHandlerWithNumber
    {
        public double Execute(double value1, double value2, int i)
        {
            return (value1 + value2) / 2;
        }
    }
}

2. An example of an indicator that accepts a Source and one number. Prints close + number.

3. An example of an indicator that has 2 overloads of the Execute method and accepts a Source and one or two numbers. Prints close + number1 + number2.

Last updated

Was this helpful?