Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
0
Tracking Error
0
Treynor Ratio
0
Total Fees
$0.00
namespace QuantConnect.Algorithm.CSharp
{
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
        private Symbol _symbol = QuantConnect.Symbol.Create("ETHEUR", SecurityType.Crypto, Market.GDAX);

	    public override void Initialize()
        {
            SetStartDate(2017, 10, 07);  //Set Start Date
            SetEndDate(2017, 11, 11);    //Set End Date
            
            AddCrypto(_symbol, Resolution.Daily, Market.GDAX);

			SetCash(_symbol.Value.Substring(0, 3), 1, Portfolio.CashBook[_symbol.Value.Substring(0, 3)].ConversionRate);
			SetCash(_symbol.Value.Substring(3, 3), 1000, Portfolio.CashBook[_symbol.Value.Substring(0, 3)].ConversionRate);
			SetCash("USD", 0, Portfolio.CashBook["USD"].ConversionRate);
        
        	decimal myAssets = Portfolio.CashBook[_symbol.Value.Substring(0, 3)].Amount;
            decimal myCash = Portfolio.CashBook[_symbol.Value.Substring(3, 3)].Amount;

			Log("-------------------------- Initialize () ----------------------------------------");
			Log(Portfolio.CashBook[_symbol.Value.Substring(0, 3)] + " > " + myAssets + " ConversionRate: "+Portfolio.CashBook[_symbol.Value.Substring(0, 3)]);
			Log(Portfolio.CashBook[_symbol.Value.Substring(3, 3)] + " > " + myCash  + " ConversionRate: "+Portfolio.CashBook[_symbol.Value.Substring(3, 3)]);
			Log("USD" + " > " + Portfolio.CashBook["USD"].Amount  + " ConversionRate: "+Portfolio.CashBook["USD"]);

        }

        public override void OnData(Slice data)
        {
        	Log("-------------------------- OnData () ----------------------------------------");
        	
       		decimal myAssets = Portfolio.CashBook[_symbol.Value.Substring(0, 3)].Amount;
            decimal myCash = Portfolio.CashBook[_symbol.Value.Substring(3, 3)].Amount;

        	
			Log(Portfolio.CashBook[_symbol.Value.Substring(0, 3)] + " : " + myAssets);
			Log(Portfolio.CashBook[_symbol.Value.Substring(3, 3)] + " : " + myCash);
			Log("USD: " + " : " + Portfolio.CashBook["USD"].Amount);

            if (!Portfolio.Invested)
            {
                SetHoldings(_symbol, 1);
                Debug("Purchased Stock");
            }
        }
    }
}