Skip to content

Commit f612177

Browse files
Obsolete VAR for V instead
1 parent 379e2d3 commit f612177

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Algorithm/QCAlgorithm.Indicators.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,9 +1953,24 @@ public UltimateOscillator ULTOSC(Symbol symbol, int period1, int period2, int pe
19531953
/// <param name="selector">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>
19541954
/// <returns>The Variance indicator for the requested symbol over the specified period</returns>
19551955
[DocumentationAttribute(Indicators)]
1956+
[Obsolete("'VAR' is obsolete please use 'V' instead")]
19561957
public Variance VAR(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)
19571958
{
1958-
var name = CreateIndicatorName(symbol, $"VAR({period})", resolution);
1959+
return V(symbol, period, resolution, selector);
1960+
}
1961+
1962+
/// <summary>
1963+
/// Creates a new Variance indicator. This will return the population variance of samples over the specified period.
1964+
/// </summary>
1965+
/// <param name="symbol">The symbol whose variance we want</param>
1966+
/// <param name="period">The period over which to compute the variance</param>
1967+
/// <param name="resolution">The resolution</param>
1968+
/// <param name="selector">Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)</param>
1969+
/// <returns>The Variance indicator for the requested symbol over the specified period</returns>
1970+
[DocumentationAttribute(Indicators)]
1971+
public Variance V(Symbol symbol, int period, Resolution? resolution = null, Func<IBaseData, decimal> selector = null)
1972+
{
1973+
var name = CreateIndicatorName(symbol, $"V({period})", resolution);
19591974
var variance = new Variance(name, period);
19601975
InitializeIndicator(symbol, variance, resolution, selector);
19611976

0 commit comments

Comments
 (0)