Added more code for back testing and fixed major candle bug