Overall Statistics Total Trades6Average Win0%Average Loss-0.32%Compounding Annual Return-32.824%Drawdown7.400%Expectancy-1Net Profit-3.217%Sharpe Ratio-0.75Loss Rate100%Win Rate0%Profit-Loss Ratio0Alpha-0.444Beta2.358Annual Standard Deviation0.346Annual Variance0.119Information Ratio-1.285Tracking Error0.262Treynor Ratio-0.11Total Fees\$6.99
```using System.Collections.Generic;
using System.Linq;
using QuantConnect.Data.Fundamental;
using QuantConnect.Data.Market;
using QuantConnect.Data.UniverseSelection;

namespace QuantConnect
{
/// <summary>
/// In this algorithm we demonstrate how to define a universe
/// as a combination of use the coarse fundamental data and fine fundamental data
/// </summary>
public class CoarseFineFundamentalComboAlgorithm : QCAlgorithm
{
private const int NumberOfSymbolsCoarse = 5;
private const int NumberOfSymbolsFine = 2;

// initialize our changes to nothing
private SecurityChanges _changes = SecurityChanges.None;

public override void Initialize()
{
UniverseSettings.Resolution = Resolution.Daily;

SetStartDate(2014, 04, 01);
SetEndDate(2014, 04, 30);
SetCash(50000);

// this add universe method accepts two parameters:
// - coarse selection function: accepts an IEnumerable<CoarseFundamental> and returns an IEnumerable<Symbol>
// - fine selection function: accepts an IEnumerable<FineFundamental> and returns an IEnumerable<Symbol>
}

// sort the data by daily dollar volume and take the top 'NumberOfSymbolsCoarse'
public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)
{
// select only symbols with fundamental data and sort descending by daily dollar volume
var sortedByDollarVolume = coarse
.Where(x => x.HasFundamentalData)
.OrderByDescending(x => x.DollarVolume);

// take the top entries from our sorted collection
var top5 = sortedByDollarVolume.Take(NumberOfSymbolsCoarse);

// we need to return only the symbol objects
}

// sort the data by P/E ratio and take the top 'NumberOfSymbolsFine'
public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)
{
// sort descending by P/E ratio
var sortedByPeRatio = fine.OrderByDescending(x => x.ValuationRatios.PERatio);

// take the top entries from our sorted collection
var topFine = sortedByPeRatio.Take(NumberOfSymbolsFine);

// we need to return only the symbol objects
}

//Data Event Handler: New data arrives here. "TradeBars" type is a dictionary of strings so you can access it by symbol.
{
// if we have no changes, do nothing
if (_changes == SecurityChanges.None) return;

// liquidate removed securities
foreach (var security in _changes.RemovedSecurities)
{
if (security.Invested)
{
Liquidate(security.Symbol);
Debug("Liquidated Stock: " + security.Symbol.Value);
}
}

// we want 50% allocation in each security in our universe
{
SetHoldings(security.Symbol, 0.5m);
Debug("Purchased Stock: " + security.Symbol.Value);
}

_changes = SecurityChanges.None;
}

// this event fires whenever we have changes to our universe
public override void OnSecuritiesChanged(SecurityChanges changes)
{
_changes = changes;