Ejemplo n.º 1
0
        //Possible Signal
        public List <PossibleSignal> GetPossibleSiganlAll()
        {
            List <PossibleSignal> lstPsignal = new List <PossibleSignal>();
            PossibleSignal        pSignal;

            using var cmd = new SQLiteCommand(DBSQL.sqlPosSignalAll, GetConnection());
            using SQLiteDataReader rdr = cmd.ExecuteReader();
            while (rdr.Read())
            {
                pSignal = new PossibleSignal
                {
                    ID        = rdr.GetInt32(0),
                    TimeFrame = (TimeFrame)Enum.Parse(typeof(TimeFrame), rdr.GetString(1), true),
                    Pair      = rdr.GetString(2),
                    Pattern   = (ChartPattern)Enum.Parse(typeof(ChartPattern), rdr.GetString(3), true),
                    Action    = (ForexAction)Enum.Parse(typeof(ForexAction), rdr.GetString(4), true),
                    cDate     = rdr.GetString(5),
                    IsActive  = rdr.GetString(6),
                    CreatedBy = rdr.GetString(7),
                    WithTrend = rdr.GetString(8),
                    Notes     = rdr.GetString(9)
                };

                lstPsignal.Add(pSignal);
            }
            return(lstPsignal);
        }
Ejemplo n.º 2
0
        public bool InsertPosSignal(PossibleSignal ps)
        {
            string mainSQL = string.Format(DBSQL.sqlInsertPS, ps.TimeFrame, ps.Pair,
                                           ps.Pattern, ps.Action, ps.cDate, ps.IsActive, ps.CreatedBy, ps.WithTrend, ps.Notes);

            using var cmd = new SQLiteCommand(mainSQL, GetConnection());
            cmd.ExecuteNonQuery();
            return(true);
        }