Overall Statistics
using System.Collections.Generic;
using QuantConnect.Data;

namespace QuantConnect.Algorithm.CSharp
{
	public class BasicTemplateForexAlgorithm : QCAlgorithm
	{
		private RollingWindow<Tick> tickWindow;
		
        public override void Initialize()
        {
            SetStartDate(2018, 1, 1);  //Set Start Date
            SetEndDate(2018, 1, 3);    //Set End Date
            SetCash(100000);             //Set Strategy Cash

            AddForex("EURUSD", Resolution.Tick);

     		tickWindow = new RollingWindow<Tick>(2);
        }

         public override void OnData(Slice data)
        {
        	foreach (var i in data["EURUSD"]){
        	tickWindow.Add(i);	
        	}
 		Log(tickWindow[0].AskPrice);
    	
    		
			if (!tickWindow.IsReady) return;
    		
    		var currentTick = tickWindow[0].AskPrice;
	        var lastTick = tickWindow[1].AskPrice;
        	
        	if (currentTick > lastTick) 
        	{
        		Debug(currentTick + " > " + lastTick);	
        	}
        	else
        	{
        		Debug(currentTick + " < " + lastTick);
        	}
        	
            if (!Portfolio.Invested)
            {
                SetHoldings("EURUSD", 1);
                Debug("Purchased Stock");
            }
        }
	}
}