Server Error in '/' Application.

Sequence contains no elements

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Sequence contains no elements

Source Error:


Line 3:  	Public Function CalculateVolality(lstStockHistory As List(Of stockValues)) As List(Of clsVolalityAndProjectedHighLow)
Line 4:  		Dim prevPrice As stockValues = Nothing
Line 5:  		Dim AvgLn As Double = lstStockHistory.Average(Function(x) x.LN)
Line 6:  		Dim AvgLnSqure As Double = lstStockHistory.Average(Function(x) x.LNSqure)
Line 7:  		Dim variance As Double = AvgLnSqure - (Math.Pow(AvgLn, 2))

Source File: C:\Inetpub\vhosts\freebsensetips.com\httpdocs\App_Code\Calculator\clsCalculator.vb    Line: 5

Stack Trace:


[InvalidOperationException: Sequence contains no elements]
   System.Linq.Enumerable.Average(IEnumerable`1 source) +251
   clsCalculator.CalculateVolality(List`1 lstStockHistory) in C:\Inetpub\vhosts\freebsensetips.com\httpdocs\App_Code\Calculator\clsCalculator.vb:5
   trading_strategy_camarilla.ShowCamarillaValue() in C:\Inetpub\vhosts\freebsensetips.com\httpdocs\trading-strategy\camarilla.aspx.vb:82
   trading_strategy_camarilla.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\freebsensetips.com\httpdocs\trading-strategy\camarilla.aspx.vb:11
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0