Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
NaN
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
NaN
Beta
NaN
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
NaN
Tracking Error
NaN
Treynor Ratio
NaN
using System;
using System.Collections;
using System.Collections.Generic; 
using QuantConnect.Securities;  
using QuantConnect.Models;   

namespace QuantConnect { 
    
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
        private string symbol = "TSNG";
        //Initialize the data and resolution you require for your strategy:
        public override void Initialize()
        {
            //Initialize the start, end dates for simulation; cash and data required.
            SetStartDate(2012, 1, 1);         
            // SetEndDate(DateTime.Now.Date.AddDays(-1)); 
             SetStartDate(2013, 1, 1);   
            SetCash(25000); //Starting Cash in USD.
            AddSecurity(SecurityType.Equity, symbol, Resolution.Minute); //Minute,Second - Tick
            SetRunMode(RunMode.Series); //Series or Parallel for intraday strategies.
        }
        //Handle TradeBar Events: a TradeBar occurs on every time-interval
        public override void OnTradeBar(Dictionary<string, TradeBar> data) 
        {   
            float data_diff = (float)(data[symbol].High / data[symbol].Low);

            if ((data_diff > 1.001)) {
                Order(symbol, -1*(int)Math.Floor(Portfolio.Cash / data[symbol].Close) );
            }
            else if ((data_diff < 1.00001)) {
               // Order("VXX", 1*(int)Math.Floor(Portfolio.Cash / data["VXX"].Close));
               Liquidate(symbol);
            }
            /*
            else {
                Liquidate("VXX");
            }
            */
        }
    }
}