Overall Statistics
namespace QuantConnect
{
	public class cci_test2 : QCAlgorithm
	{
		private string my_secs = "EURUSD,AUDUSD,GBPUSD";
		List<string> symbolList;
		List<StockDataClass> stockDatas = new List<StockDataClass>();
		
		public override void Initialize()
		{
			SetStartDate(2012, 1, 1);
			SetEndDate(2015, 1, 1);
			SetCash(10000);
		
			symbolList = new List<string>(my_secs.Split(new char[] { ',' }));
			foreach (string ticker in symbolList)
			{
				AddSecurity(SecurityType.Forex, ticker, Resolution.Hour,true,50.0m,false);
				StockDataClass stockData = new StockDataClass(ticker);
				stockData.CCI = CCI(ticker, 20, MovingAverageType.Simple, Resolution.Hour);
				stockData.ATR = ATR(ticker, 20, MovingAverageType.Simple, Resolution.Hour);
				stockData.CCI_RW = new RollingWindow<decimal>(2);
				Debug(stockData.CCI_RW.Size);
				stockData.ATR_RW = new RollingWindow<decimal>(2);
				stockDatas.Add(stockData);
			}
		}
		
		public void OnData(TradeBars data)
		{
			for (int i = 0; i < stockDatas.Count; i++)
			{
				//This is where I am attempting to add the bars stockdata indicator values to a rolloing window.
				stockDatas[i].CCI_RW.Add(stockDatas[i].CCI.Current.Value);
				stockDatas[i].ATR_RW.Add(stockDatas[i].CCI.Current.Value);
				
				if (!stockDatas[i].CCI_RW.IsReady || !stockDatas[i].ATR_RW.IsReady) return;
				
				Debug(stockDatas[i].CCI_RW[0] + "  " + stockDatas[i].CCI_RW[1]);
				
				SetHoldings("EURUSD", 5);
			}
		}
		
	}

	class StockDataClass
	{
		public string Ticker;
		public CommodityChannelIndex CCI;
		public AverageTrueRange ATR;
		public RollingWindow<decimal> CCI_RW;
		public RollingWindow<decimal> ATR_RW;
		
		
		public StockDataClass(string ticker)
		{
			Ticker = ticker;
		}
	}
}