Overall Statistics
Total Trades
46
Average Win
0.36%
Average Loss
0%
Compounding Annual Return
2064.705%
Drawdown
0.200%
Expectancy
0
Net Profit
0.563%
Sharpe Ratio
0
Loss Rate
0%
Win Rate
100%
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
$46.20
namespace QuantConnect 
{   

    public class LimitOrderPractice : QCAlgorithm
    {
        private string symbol = "SPY";
        private decimal price;
        private int quantity = 10;

        public override void Initialize()
        {
            SetStartDate(2016, 08, 22);
            SetEndDate(2016, 08, 22); 
            SetCash(25000);
            AddSecurity(SecurityType.Equity, symbol, Resolution.Minute);
        }

        public void OnData(TradeBars data) 
        {
            price = Securities[symbol].Close;

            if (!Portfolio.HoldStock && price > 218.50m )
            {
            	LimitOrder (symbol, quantity, 218.10m);
            }

            if (Portfolio.HoldStock && price >= 218.50m)
		    {
		    	Liquidate();
            }            

        }
    }
}