Esempio n. 1
0
        private void DisconnectEvent(object o, GrayBoxAPI.BBEventArgs e)
        {
            debug("Graybox disconnected. Please restart this application.");
            GrayBoxAPI.BlackBox.instance().DisConnect();
            MessageBox.Show("Graybox disconnected. This application will close.", "Graybox TL Server", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            lst_box.FindForm().Close();

            m_bGrayBoxRunning   = false;
            btn_connect.Enabled = true;
        }
Esempio n. 2
0
        void BlackBox_GrayBoxOrderConfirmEventMy(object ob, GrayBoxAPI.BBEventArgs e)
        {
            UpdateOrderStatus(e);
            Order o = new OrderImpl();

            OrderList.TryGetValue(e.BBXid, out o);
            tl.newOrder(o);
            string orderside = o.side ? "BUY" : "SELL";

            debug("Order confirmed " + o.id + " " + o.symbol + " " + orderside + " " + o.size);
        }
Esempio n. 3
0
        void BlackBox_GrayBoxOrderExecuteEventMy(object ob, GrayBoxAPI.BBEventArgs e)
        {
            UpdateOrderStatus(e);
            Order o = new OrderImpl();

            OrderList.TryGetValue(e.BBXid, out o);

            Position p = new PositionImpl(o.symbol, (decimal)e.Price, e.Quantity, (decimal)e.Price, o.Account);

            string orderside = o.side ? "BUY" : "SELL";

            debug("Order executed " + o.id + " " + o.symbol + " " + orderside + " " + o.size);

            pt.NewPosition(p);
        }
Esempio n. 4
0
 private void UpdateOrderStatus(GrayBoxAPI.BBEventArgs e)
 {
 }
Esempio n. 5
0
 void BlackBox_GrayBoxOrderErrorEvent(object o, GrayBoxAPI.BBEventArgs e)
 {
     UpdateOrderStatus(e);
 }
Esempio n. 6
0
 void BlackBox_GrayBoxOrderCancelExecEvent(object o, GrayBoxAPI.BBEventArgs e)
 {
     UpdateOrderStatus(e);
 }
Esempio n. 7
0
 private void ConnectErrorEvent(object o, GrayBoxAPI.BBEventArgs e)
 {
     debug("Cannot connect to Graybox please check");
 }
Esempio n. 8
0
 private void ConnectEvent(object o, GrayBoxAPI.BBEventArgs e)
 {
     debug("Connected to Graybox");
     btn_connect.Enabled = false;
 }