Skip to content

IIndicatorsAccessor.Supertrend

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

Supertrend is one of the most popular trend trading indicators

Definition

Supertrend Supertrend(int periods, double multiplier)
api.Indicators.Supertrend(periods: int, multiplier: float) -> Supertrend

Parameters

Name C# type Python type Description
periods int int Supertrend Period
multiplier double float Supertrend Multiplier

Returns Supertrend — Supertrend

Examples

var supertrend = Indicators.Supertrend(10, 3);
// UpTrend has a value while the trend is up, otherwise it is NaN
var isUpTrend = !double.IsNaN(supertrend.UpTrend.Last(1));
Print("Supertrend up trend: {0}", isUpTrend);
import math
supertrend = api.Indicators.Supertrend(10, 3)
# UpTrend has a value while the trend is up, otherwise it is NaN
isUpTrend = not math.isnan(supertrend.UpTrend.Last(1))
api.Print(f"Supertrend up trend: {isUpTrend}")