public static void DoYourThing_absoluut(string Instrument) { var webMinData = HiSat.HistData.GetHistoricalMINUTE_FromWEB(DateTime.Now.AddDays(-10), DateTime.Now, 1, Instrument); var webMinDataOriginal = new List <Price>(); foreach (var t in webMinData) { Price p = (Price)t.Clone(); webMinDataOriginal.Add(p); } //get last price from web var L = webMinData.Last(); Debug.WriteLine("Remove LAST Price from WebData" + L.TimeStamp + " " + L.Close); //remove last price if there was a trade since update started Price pt = (Price)L.Clone(); pt.Close = 33333; pt.TimeStamp = pt.TimeStamp.AddMinutes(1); webMinData.Add(pt); //check price if (GetTimestampForPrice(webMinData.Last())) { webMinData.Remove(L); } var l = webMinData.Last(); Debug.WriteLine("New LAST Price from WebData " + l.TimeStamp + " " + l.Close); var Loriginal = webMinDataOriginal.Last(); Debug.WriteLine("New LAST Price from Original " + Loriginal.TimeStamp + " " + Loriginal.Close); var dc = new AlsiUtils.AlsiDBDataContext(); var TickData = dc.RawTicks.ToList().Where(z => z.Stamp >= webMinData.Last().TimeStamp).ToList(); foreach (var v in convertTickToMinute(TickData)) { if (v.TimeStamp > l.TimeStamp) { // webMinData.Add(v); // Debug.WriteLine("Adding New Price " + v.TimeStamp + " " + l.Close); } } UpdateDB._1MinDataToImportMinute(webMinData); }
public static List <Trade> RunEMAScalpLiveTrade(Parameter_EMA_Scalp Parameter, DateTime StartDate, GlobalObjects.TimeInterval Interval) { // DateTime START = new DateTime(2012,06,02);//NB must be set periodically DateTime e = DateTime.UtcNow.AddHours(5); UpdateDB.MergeTempWithHisto(Interval); GlobalObjects.Points = AlsiUtils.DataBase.readDataFromDataBase(Interval, AlsiUtils.DataBase.dataTable.Temp, StartDate, e, false); var sp = GlobalObjects.Points.First(); var l = GlobalObjects.Points.Last(); return(AlsiUtils.Strategies.EMA_Scalp.EmaScalp(Parameter, GlobalObjects.Points, false)); }