public void Clear()
 {
     Profits.Clear();
     BuyQuantities.Clear();
     TradeLog.Clear();
     _tradingResultsRepository.Clear();
 }
        private void ExecuteBuy(ForexTreeData record)
        {
            var tradeUnits  = BidSize / MarginRatio;
            var unitsBought = tradeUnits * record.Bid;

            BuyQuantities.Add(unitsBought);
            SaveLogRecord(unitsBought, 0.0, 0.0, MarketAction.Buy, record.Action);
        }
        private void ExecuteSell(ForexTreeData record)
        {
            if (BuyQuantities.Count < 1)
            {
                throw new BllException("You have no open positions to close for sell.");
            }

            var tradeUnits = BidSize / MarginRatio;
            var unitsSold  = BuyQuantities[0];
            var profit     = MathHelpers.GreedyCurrencyPrecision(unitsSold / record.Ask - tradeUnits);

            Profits.Add(profit);

            BuyQuantities.RemoveAt(0);
            SaveLogRecord(0.0, unitsSold, profit, MarketAction.Sell, record.Action);
        }