Exemplo n.º 1
0
        void PST_OnPosition(object sender, TalTrade.Toolkit.Domain.DataEventArgs <PositionRecord> e)
        {
            if (e.Count == 0)
            {
                debug("GOT NO POSITIONS FOR TODAY");
            }
            else
            {
                debug("GOT TODAY'S POSITIONS");
                foreach (PositionRecord pos in e)
                {
                    var p = new PositionImpl(pos.DispName, decimal.Parse(pos.AverageLong.Value.ToString()), Convert.ToInt32(pos.Longpos.GetValueOrDefault()));
                    pt.NewPosition(p);

                    //debug("  --> {0}.{1}.{2}.{3}",
                    //    pos.Bank,
                    //    pos.Branch,
                    //    pos.Customer,
                    //    pos.Deposit);

                    //debug("      Symbol {0}, AcctType {1}",
                    //    pos.DispName, pos.AcctType);
                    //debug("      Intraday Long = {0}@{1}",
                    //    pos.Longpos, pos.AverageLong);
                    //debug("      Intraday Short = {0}@{1}",
                    //    pos.Shortpos, pos.AverageShort);
                }
            }
        }
Exemplo n.º 2
0
 void XPAT_OnXPermsAccounts(object sender, TalTrade.Toolkit.Domain.DataEventArgs <XPermsAccountsRecord> e)
 {
     foreach (var r in e)
     {
         //var acc = string.Format("{0}.{1}.{2}.{3}", r.Bank, r.Branch, r.Customer, r.Deposit);
         if (!accts.Exists(t => t == r.Deposit))
         {
             accts.Add(r.Deposit);
         }
     }
 }
Exemplo n.º 3
0
 void TBL_OnData(object sender, TalTrade.Toolkit.Domain.DataEventArgs <LivequoteRecord> e)
 {
     foreach (var r in e)
     {
         try
         {
             Tick t = new TickImpl(r.DispName);
             if (r.Ask != null)
             {
                 t.ask = r.Ask.Value.DecimalValue;
                 t.os  = r.Asksize.Value;
                 t.oe  = r.Askexid;
             }
             if (r.Bid != null)
             {
                 t.bid = r.Bid.Value.DecimalValue;
                 t.bs  = r.Bidsize.Value;
                 t.be  = r.Bidexid;
             }
             if (r.Trdprc1 != null)
             {
                 t.ex    = r.Exchid;
                 t.trade = r.Trdprc1.Value.DecimalValue;
                 t.size  = r.Trdvol1.Value;
             }
             t.time = Util.DT2FT(r.TrdDate.Value + r.Trdtim1.Value);
             t.date = Util.ToTLDate(r.TrdDate.Value);
             newTick(t);
             _numDisplayed++;
             _done.Set();
         }
         catch (Exception exc)
         {
             debug(exc.Message);
             _numIgnored++;
         }
     }
 }