Ejemplo n.º 1
0
        public ServerBlackwoodMain()
        {
            TLServer tl;

            if (Properties.Settings.Default.TLClientAddress == string.Empty)
            {
                tl = new TLServer_WM();
            }
            else
            {
                tl = new TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort);
            }
            _con = new ServerBlackwood(tl);
            _con.VerbuseDebugging = Properties.Settings.Default.VerboseDebugging;

            TrackEnabled = Util.TrackUsage();
            Program      = PROGRAM;
            InitializeComponent();
            _con.BWConnectedEvent += new BWConnectedEventHandler(_con_BWConnectedEvent);
            _con.SendDebug        += new DebugDelegate(_dw.GotDebug);

            StatusHandler = new DisplayStatusHandler(DisplayStatus);

            Location = Properties.Settings.Default.wlocation;

            //Avoid painting window off screen.
            Point screen = new Point(SystemInformation.VirtualScreen.Bottom, SystemInformation.VirtualScreen.Right);

            if (this.Top > screen.X - this.Height | this.Left > screen.Y - this.Width)
            {
                this.Location = new Point(300, 300);
            }
        }
Ejemplo n.º 2
0
        public EsignalMain()
        {
            TLServer tls;

            if (Properties.Settings.Default.TLClientAddress == string.Empty)
            {
                tls = new TLServer_WM();
            }
            else
            {
                tls = new TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort);
            }

            TrackEnabled = Util.TrackUsage();
            Program      = PROGRAM;
            InitializeComponent();
            tl = new EsignalServer(tls);
            // set defaults
            tl.isPaperTradeEnabled          = Properties.Settings.Default.PaperTrade;
            tl.isPaperTradeUsingBidAsk      = Properties.Settings.Default.PaperTradeUseBidAsk;
            tl.AllowSendInvalidBars         = Properties.Settings.Default.AllowSendOfInvalidBars;
            tl.DefaultBarsBack              = Properties.Settings.Default.DefaultBarsBack;
            tl.VerboseDebugging             = Properties.Settings.Default.VerboseDebugging;
            tl.ReleaseBarHistoryAfteRequest = Properties.Settings.Default.ReleaseBarHistoryAfterSending;
            tl.ReleaseDeadSymbols           = Properties.Settings.Default.ReleaseDeadSymbols;
            tl.WaitBetweenEvents            = Properties.Settings.Default.WaitBetweenEvents;
            tl.BarRequestsGetAllData        = Properties.Settings.Default.BarRequestsuseAllData;
            // send debug messages to log file
            tl.GotDebug += new DebugDelegate(debug);
            debug("Started " + PROGRAM + Util.TLVersion());
            // attempt to connect to esignal
            _ok_Click(null, null);
            // handle connector exits
            FormClosing += new FormClosingEventHandler(EsignalMain_FormClosing);
        }
Ejemplo n.º 3
0
        string features()
        {
            string s = string.Empty;

            foreach (MessageTypes mt in cfeatures)
            {
                s += mt.ToString() + " ";
            }
            return(s);
        }
Ejemplo n.º 4
0
        void start()
        {
            debug("starting setup...");
            s = new TLServer_IP(IPUtil.LOCALHOST, IPUtil.TLDEFAULTTESTPORT, 0, 100000);
            s.VerboseDebugging = true;
            s.SendDebugEvent  += new DebugDelegate(debug);
            s.newProviderName  = Providers.TradeLink;
            s.Start(5, 200, true);
            Assert.IsTrue(s.isStarted);
            // make sure we select our own loopback, if other servers are running
            c = new TLClient_IP(TLClient_IP.GetEndpoints(s.Port, new string[] { System.Net.IPAddress.Loopback.ToString() }), 0, "tlclient", 0, 0, debugc, true);
            c.VerboseDebugging = true;

            // create a second client to verify order and fill copying work
            //c2 = new TLClient_IP(TLClient_IP.GetEndpoints(IPUtil.TLDEFAULTTESTPORT, new string[] { System.Net.IPAddress.Loopback.ToString() }), 0, "tlclient2", 0, 0, debug);


            // register server events (so server can process orders)
            s.newSendOrderRequest += new OrderDelegateStatus(tl_gotSrvFillRequest);

            // setup client events
            c.gotFill            += new FillDelegate(tlclient_gotFill);
            c.gotOrder           += new OrderDelegate(tlclient_gotOrder);
            c.gotTick            += new TickDelegate(tlclient_gotTick);
            c.gotImbalance       += new ImbalanceDelegate(c_gotImbalance);
            c.gotFeatures        += new MessageTypesMsgDelegate(c_gotFeatures);
            c.GotConnectEvent    += new Int32Delegate(c_GotConnectEvent);
            c.GotDisconnectEvent += new Int32Delegate(c_GotDisconnectEvent);


            // setup second client events to check copying
            //c2.gotFill += new FillDelegate(c2_gotFill);
            //c2.gotOrder += new OrderDelegate(c2_gotOrder);
            //c2.gotTick += new TickDelegate(c2_gotTick);
            debug("ending setup.");
            startt = DateTime.Now;

            // prepare to playback ticks continuously
            bw         = new System.ComponentModel.BackgroundWorker();
            bw.DoWork += new System.ComponentModel.DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerAsync();
            debug("waiting for helper to start...");
            while (!_looping)
            {
                sleep(50);
            }
        }
Ejemplo n.º 5
0
        public ServerDBFXMain()
        {
            TradeLink.API.TLServer tl;
            if (Properties.Settings.Default.TLClientAddress == string.Empty)
            {
                tl = new TLServer_WM();
            }
            else
            {
                tl = new TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort);
            }
            _dbfx = new ServerDBFX(tl);

            TrackEnabled = Util.TrackUsage();
            Program      = PROGRAM;
            InitializeComponent();
            _dbfx.SendDebug += new TradeLink.API.DebugFullDelegate(_dbfx_SendDebug);
            FormClosing     += new FormClosingEventHandler(ServerDBFXMain_FormClosing);
        }