Exemple #1
0
        private void SmartComServerUpdateQuote(string symbol, DateTime datetime, double open, double high, double low, double close, double last, double volume, double size, double bid, double ask, double bidsize, double asksize, double open_int, double go_buy, double go_sell, double go_base, double go_base_backed, double high_limit, double low_limit, int trading_status, double volat, double theor_price)
        {
            StrategyAbst foundStrat = Strategies.Find(strat => strat.Symbol == symbol);

            if (foundStrat != null)
            {
                foundStrat.GO = go_buy;
            }
        }
        private void clearStratButton_Click(object sender, EventArgs e)
        {
            Server       server     = Server.GetInstance();
            string       stratName  = stratListBox.Text;
            StrategyAbst stratFound = server.GetStrategies().Find(strat => strat.Name == stratName);

            if (stratFound != null)
            {
                stratFound.ClearCurrentPosition();
                WriteToStatus(stratFound.Symbol + ": Position Cleared");
            }
            else
            {
                WriteToStatus(stratFound.Symbol + ": Strategy Not Found");
            }
        }
        private void testButton_Click(object sender, EventArgs e)
        {
            //WriteToStatus("Test called.");

            /* foreach (StrategyAbst strat in Server.GetInstance().GetStrategies())
             * {
             *  WriteToStatus(strat.CurrentState.ToString());
             * } */
            /* DBInputOutput.DBReader dbReader = new DBInputOutput.DBReader();
             * DateTime dTime = dbReader.SelectDecisionTimes("GAZR-12.18_FT");
             * WriteToStatus("Found time: " + dTime);
             * List<DateTime> dTimes = new List<DateTime>();
             * dTimes.Add(new DateTime(2018, 1, 26, 11, 00, 00));
             * dTimes.Add(new DateTime(2018, 1, 26, 09, 50, 00));
             * dTimes.Add(new DateTime(2018, 1, 26, 18, 40, 00));
             * dTimes.Add(new DateTime(2018, 1, 26, 18, 50, 00));
             * dTimes.Add(new DateTime(2018, 1, 26, 20, 0, 0));
             * dTimes.Add(new DateTime(2018, 1, 26, 23, 54, 00));
             * foreach (DateTime dTime in dTimes)
             * {
             *  DateTime res = Server.GetInstance().GetStrategies()[0].CalcMakeDicisionTime(dTime, 16 * 60 * 60);
             *  WriteToStatus(res.ToString());
             * }*/
            Server       server     = Server.GetInstance();
            string       stratName  = stratListBox.Text;
            StrategyAbst stratFound = server.GetStrategies().Find(strat => strat.Name == stratName);

            if (stratFound == null)
            {
                WriteToStatus("Strategy not found\r\n");
            }
            else
            {
                WriteToStatus("\r\n" + stratFound.ToString());
            }
        }
Exemple #4
0
 private void GiveCookies(StrategyAbst strat)
 {
     strat.CookieDiv  = 100;
     strat.CookieMod  = Strategies.IndexOf(strat) + 1;
     strat.LastCookie = strat.CookieMod;
 }
Exemple #5
0
 public void Unsubscribe(StrategyAbst strat)
 {
     Strategies.Remove(strat);
 }
Exemple #6
0
 public void Subscribe(StrategyAbst strat)
 {
     Strategies.Add(strat);
     GiveCookies(strat);
     Form.WriteToStatus(strat.Name + " subscribed");
 }