Skip to content

IIndicatorsAccessor.SwingIndex

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

Returns the Swing Index indicator instance.

Overloads

SwingIndex(int limitMoveValue)

Returns the Swing Index indicator instance.

SwingIndex SwingIndex(int limitMoveValue)
api.Indicators.SwingIndex(limitMoveValue: int) -> SwingIndex

Parameters

Name C# type Python type Description
limitMoveValue int int The value of the limit move used for calculation.

Returns SwingIndex — Swing Index indicator instance

Examples

var swingIndex = Indicators.SwingIndex(12);
Print("Swing Index of the last closed bar: {0}", swingIndex.Result.Last(1));
swingIndex = api.Indicators.SwingIndex(12)
api.Print(f"Swing Index of the last closed bar: {swingIndex.Result.Last(1)}")

SwingIndex(Bars bars, int limitMoveValue)

Returns the Swing Index indicator instance.

SwingIndex SwingIndex(Bars bars, int limitMoveValue)
api.Indicators.SwingIndex(bars: Bars, limitMoveValue: int) -> SwingIndex

Parameters

Name C# type Python type Description
bars Bars Bars The Bars that will be used by indicator, you can pass another timeframe/symbol bars
limitMoveValue int int The value of the limit move used for calculation.

Returns SwingIndex — Swing Index indicator instance

Examples

var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailySwingIndex = Indicators.SwingIndex(dailyBars, 12);
Print("Daily Swing Index: {0}", dailySwingIndex.Result.Last(1));
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailySwingIndex = api.Indicators.SwingIndex(dailyBars, 12)
api.Print(f"Daily Swing Index: {dailySwingIndex.Result.Last(1)}")