private ChartPointsPredition Predict(TimeFrame TFrame, string product, int deep, int ahead, int position, List <ChartPoint> LCPoints) { int iDeep = deep; int iAhead = ahead; if (position < iDeep) { return(null); } int iDecimals = int.Parse(OSBlotter.Get(product).DecimalPlaces); int iMinMatches = 1; double dMinResolution = 1; List <ChartPoint> LCPSub = LCPoints.GetRange(0, position); List <ChartPoint> LCPSubSpecified = LCPoints.GetRange(position - iDeep, iDeep); //List<ChartPoint> LCPSubPredicted = LCPoints.GetRange(position, iAhead);//TODO comment ChartPointsPredition CPsP = ANALYSIS.PredictNextSpecified(product, LCPSub, LCPSubSpecified, TFrame, iDecimals, iMinMatches, dMinResolution, iAhead, new double[] { 0, 0, 0, 0, 0 }); CPsP.Prognosis(0); CPsP.Position = position; return(CPsP); }
private void StartConnection() { try { if (SOCMain != null && SOCMain.Connected) { SOCMain.Shutdown(SocketShutdown.Both); Thread.Sleep(100); SOCMain.Close(); } IPAddress[] AIPAdresses = Dns.GetHostEntry(HOST).AddressList; var ADRESS = AIPAdresses[0]; SOCMain = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint IPEPMain = new IPEndPoint(ADRESS, PORT); SOCMain.Blocking = false; AsyncCallback ACallbackConnected = new AsyncCallback(OcConnect); //Thread.Sleep(1000); SOCMain.BeginConnect(IPEPMain, ACallbackConnected, SOCMain); var CEDAA_CreditalsWithBrandCode = CEDA_Authentification.AuthenticateCredentialsWithBrandCode(USERID, PASSWORD, BRANDCODE); //var CEDAA_Creditals = CEDA_Authentification.AuthenticateCredentials(USERID, PASSWORD); //LOGIN FOR TOKEN TOKEN = CEDAA_CreditalsWithBrandCode.token; // TOKEN = CEDAA_Creditals.token; if (ORBlotter != null || PSBlotter != null || ARCHIVE != null || OSBlotter != null) { ODBlotter.Restart(TOKEN); PSBlotter.Restart(TOKEN); ARCHIVE.Restart(TOKEN); OSBlotter.Restart(TOKEN); this.SendString(TOKEN + "\r"); } //this.UpdateDeals(); //this.UpdateAccount(); } catch { try { TsslInfo.Text = "Restart Failed [" + ++iRestartFails + "]x "; } catch { } this.StartConnection(); } }