Example #1
0
        public double AverageProfit(TradeManager tradeList)
        {
            double sumProfitInSek = 0;

            foreach (var item in tradeList.GetTradeList)
            {
                sumProfitInSek += item.ProfitTrade() / item.Sell * _valuePerPoint;
            }

            if (tradeList.NbrFinishedTrades() == 0)
            {
                return(0);
            }
            else
            {
                return(sumProfitInSek / tradeList.NbrFinishedTrades());
            }
        }
Example #2
0
        public double StandardDeviation(TradeManager tradeList)
        {
            double sumSquaredDevFromMean = 0;

            foreach (var item in tradeList.GetTradeList)
            {
                sumSquaredDevFromMean += Math.Pow(item.ProfitTrade() / item.Sell * _valuePerPoint - AverageProfit(tradeList), 2);
            }

            if (tradeList.NbrFinishedTrades() == 0)
            {
                return(0);
            }
            else
            {
                return(Math.Sqrt(sumSquaredDevFromMean / tradeList.NbrFinishedTrades()));
            }
        }