Overall Statistics
namespace QuantConnect.Algorithm.CSharp
{
    public class DualSellOrderTest : QCAlgorithm
    {
    	private OrderTicket EntryOrder { get; set; }
    	private bool once = true;
    	    	
        public override void Initialize()
        {
            SetStartDate(2018, 8, 1);  //Set Start Date
            SetEndDate(2018, 9, 1);  //Set Start Date
            SetCash(100000);             //Set Strategy Cash
            SetBrokerageModel(BrokerageName.Bitfinex, AccountType.Margin);
            var btc = AddCrypto("BTCUSD", Resolution.Hour);
        }
        
        public override void OnData(Slice data)
        {
        	if (once)        
        	{
				once = false;
				var usdTotal = Portfolio.CashBook["USD"].Amount;
				var limitPrice = Math.Round(Securities["BTCUSD"].Price, 2);
				var quantity = usdTotal * 0.95m / limitPrice;
	
	            EntryOrder = MarketOrder("BTCUSD", quantity, false, "Entry");
	            var filledPrice = this.EntryOrder.AverageFillPrice;
	            StopMarketOrder("BTCUSD", -quantity, Math.Round(filledPrice * (.90m), 2), "Stop Loss");
        	}
        	
        }
    }
}