From f612177c647a964bd2e550fa92b48373841aaa9b Mon Sep 17 00:00:00 2001 From: Martin Molinero Date: Tue, 6 Feb 2024 17:25:23 -0300 Subject: [PATCH] Obsolete VAR for V instead --- Algorithm/QCAlgorithm.Indicators.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Algorithm/QCAlgorithm.Indicators.cs b/Algorithm/QCAlgorithm.Indicators.cs index 9451f87b5d69..fc20eb55695b 100644 --- a/Algorithm/QCAlgorithm.Indicators.cs +++ b/Algorithm/QCAlgorithm.Indicators.cs @@ -1953,9 +1953,24 @@ public UltimateOscillator ULTOSC(Symbol symbol, int period1, int period2, int pe /// Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value) /// The Variance indicator for the requested symbol over the specified period [DocumentationAttribute(Indicators)] + [Obsolete("'VAR' is obsolete please use 'V' instead")] public Variance VAR(Symbol symbol, int period, Resolution? resolution = null, Func selector = null) { - var name = CreateIndicatorName(symbol, $"VAR({period})", resolution); + return V(symbol, period, resolution, selector); + } + + /// + /// Creates a new Variance indicator. This will return the population variance of samples over the specified period. + /// + /// The symbol whose variance we want + /// The period over which to compute the variance + /// The resolution + /// Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value) + /// The Variance indicator for the requested symbol over the specified period + [DocumentationAttribute(Indicators)] + public Variance V(Symbol symbol, int period, Resolution? resolution = null, Func selector = null) + { + var name = CreateIndicatorName(symbol, $"V({period})", resolution); var variance = new Variance(name, period); InitializeIndicator(symbol, variance, resolution, selector);