Esempio n. 1
0
        void tl_gotTick(Tick t)
        {
            if (archivetickbox.Checked)
            {
                ta.Save(t);
            }
            if (!barlist.ContainsKey(t.sym))
            {
                barlist.Add(t.sym, new BarList(BarInterval.FiveMin, t.sym));
            }
            else
            {
                barlist[t.sym].newTick(t);
            }

            if (boxlist.ContainsKey(t.sym) && (boxlist[t.sym] != null))
            {
                Box      b  = boxlist[t.sym];
                BoxInfo  bi = new BoxInfo();
                Position p  = new Position(t.sym);
                try
                {
                    p = poslist[t.sym];
                }
                catch (KeyNotFoundException) { }


                Order o = b.Trade(t, barlist[t.sym], p, bi);
                o.Security    = seclist[t.sym].Type;
                o.Exchange    = seclist[t.sym].DestEx;
                o.LocalSymbol = seclist[t.sym].Name;
                tl.SendOrder(o);
            }
        }
Esempio n. 2
0
        void tl_gotTick(Tick t)
        {
            // see if we are tracking this symbol
            int[] idxs = new int[0];
            if (!_symidx.TryGetValue(t.Sec.FullName, out idxs))
            {
                return;
            }

            // see if we should save this tick
            if (archivetickbox.Checked)
            {
                _ta.Save(t);
            }

            // send tick to any valid requesting responses
            foreach (int idx in idxs)
            {
                if (_reslist[idx].isValid)
                {
                    _reslist[idx].GotTick(t);
                }
            }
        }
Esempio n. 3
0
 void tl_gotTick(Tick t)
 {
     ta.Save(t);
 }
Esempio n. 4
0
 void tl_gotIndexTick(Index idx)
 {
     ta.Save(idx);
 }