IIndicatorsAccessor.TypicalPrice
method · IIndicatorsAccessor · cAlgo.API.Internals
DesktopCLICloud
The Typical Price indicator is the average of the high, low, and closing prices.
Overloads
| Signature |
|---|
TypicalPrice() |
TypicalPrice(Bars bars) |
TypicalPrice()
The Typical Price indicator is the average of the high, low, and closing prices.
TypicalPrice TypicalPrice()
api.Indicators.TypicalPrice() -> TypicalPrice
Returns TypicalPrice — Typical Price indicator instance.
Examples
var typicalPrice = Indicators.TypicalPrice();
Print("Typical price of the last closed bar: {0}", typicalPrice.Result.Last(1));
typicalPrice = api.Indicators.TypicalPrice()
api.Print(f"Typical price of the last closed bar: {typicalPrice.Result.Last(1)}")
TypicalPrice(Bars bars)
The Typical Price indicator is the average of the high, low, and closing prices.
TypicalPrice TypicalPrice(Bars bars)
api.Indicators.TypicalPrice(bars: Bars) -> TypicalPrice
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 |
Returns TypicalPrice — Typical Price indicator instance.
Examples
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyTypicalPrice = Indicators.TypicalPrice(dailyBars);
Print("Typical price of the last closed daily bar: {0}", dailyTypicalPrice.Result.Last(1));
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyTypicalPrice = api.Indicators.TypicalPrice(dailyBars)
api.Print(f"Typical price of the last closed daily bar: {dailyTypicalPrice.Result.Last(1)}")