using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MarketData.Utils; using System.IO; namespace MarketData.CNNProcessing { public class TestCases : List { } public class TestCase { public enum CaseType{Training,Test,Validation}; public enum GenerateType{Price,BollingerBand,BollingerBandWithVIX}; public enum OutputType{OutputFile,OutputStream} private readonly List streams=new List(); private readonly List pathFileNames=new List(); private readonly List responses=new List(); /// /// ProcessData item /// ///Symbol ///The start datee. ///The purchasedate. public TestCase(String symbol,DateTime purchaseDate, int dayCount,TestCase.CaseType caseType,TestCase.GenerateType generateType=TestCase.GenerateType.Price,OutputType outputType=OutputType.OutputFile) { DateGenerator dateGenerator=new DateGenerator(); this.Symbol=symbol; this.HistDate=dateGenerator.GenerateHistoricalDate(purchaseDate,dayCount); this.PurchaseDate=dateGenerator.GetNextBusinessDay(purchaseDate); this.TypeCase=caseType; TypeGenerate=generateType; TypeOutput=outputType; DayCount=dayCount; } public String Symbol{get;set;} public DateTime PurchaseDate{get;set;} public DateTime HistDate{get;set;} public CaseType TypeCase{get;set;} public int DayCount{get;private set;} public GenerateType TypeGenerate{get;set;} public OutputType TypeOutput{get;set;} public List Streams{get{return streams;}} // This will get set automatically depending on OutputType public List PathFileNames{get{return pathFileNames;}} // This will get set automaticall depending on OutputType public List Responses{get{return responses;}} public Stream LastStream{get{return Streams.Count>0?Streams[Streams.Count-1]:null;}} public String LastPathFileName{get{return PathFileNames.Count>0?PathFileNames[PathFileNames.Count-1]:null;}} public String LastResponse{get{return Responses.Count>0?Responses[Responses.Count-1]:null;}} public override String ToString() { StringBuilder sb=new StringBuilder(); if(OutputType.OutputFile.Equals(TypeOutput))return LastPathFileName; sb.Append(String.Format("{0}:P:{1}->H:{2}",Symbol,PurchaseDate.ToShortDateString(),HistDate.ToShortDateString())); return sb.ToString(); } } }