IIndicatorsAccessor.WeightedClose
method · IIndicatorsAccessor · cAlgo.API.Internals
DesktopCLICloud
The WeightedClose indicator is an average of each day's price with extra weight given to the closing price.
Overloads
| Signature |
|---|
WeightedClose() |
WeightedClose(Bars bars) |
WeightedClose()
The WeightedClose indicator is an average of each day's price with extra weight given to the closing price.
WeightedClose WeightedClose()
api.Indicators.WeightedClose() -> WeightedClose
Returns WeightedClose — WeightedClose indicator instance
Examples
var weightedClose = Indicators.WeightedClose();
Print("Weighted close of the last closed bar: {0}", weightedClose.Result.Last(1));
weightedClose = api.Indicators.WeightedClose()
api.Print(f"Weighted close of the last closed bar: {weightedClose.Result.Last(1)}")
WeightedClose(Bars bars)
The WeightedClose indicator is an average of each day's price with extra weight given to the closing price.
WeightedClose WeightedClose(Bars bars)
api.Indicators.WeightedClose(bars: Bars) -> WeightedClose
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 WeightedClose — WeightedClose indicator instance
Examples
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyWeightedClose = Indicators.WeightedClose(dailyBars);
Print("Weighted close of the last closed daily bar: {0}", dailyWeightedClose.Result.Last(1));
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyWeightedClose = api.Indicators.WeightedClose(dailyBars)
api.Print(f"Weighted close of the last closed daily bar: {dailyWeightedClose.Result.Last(1)}")