Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
25.475%
Drawdown
1.800%
Expectancy
0
Net Profit
0%
Sharpe Ratio
1.582
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.235
Beta
0.144
Annual Standard Deviation
0.099
Annual Variance
0.01
Information Ratio
3.785
Tracking Error
0.183
Treynor Ratio
1.089
Total Fees
$2.00
namespace QuantConnect 
{   
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
    	private string ticker = "NZDCHF";
    	private SecurityType type = SecurityType.Forex;
    	private RelativeStrengthIndex _rsi; 
    	
        //Initialize the data and resolution you require for your strategy:
        public override void Initialize() 
        {
        	SetCash(25000);
            SetStartDate(2016, 1, 1);
            SetEndDate(2016, 2, 5);
            
            AddSecurity(type, ticker, Resolution.Daily);
        	_rsi = RSI(Securities[ticker].Symbol, 13, MovingAverageType.Simple, Resolution.Daily);
        }

        public void OnData(TradeBars data) 
        {   
            if(!_rsi.IsReady) return;
            
            if (!Portfolio.HoldStock) 
           	{
               	SetHoldings(ticker, 1);
               	Debug(Time.ToShortDateString() + " -> Purchased " + ticker);
            }
            
            Debug(string.Format("{0:d} -> {1} RSI: {2:0.000000} Price: {3:.000000}", Time, ticker, _rsi, data[ticker].Price));
        }
    }
}