Ejemplo n.º 1
0
        private void updateTimer_Tick(object sender, EventArgs e)
        {
            labelInfo.Text = "Bid " + api.getBid(pair)
                             + Environment.NewLine + "Ask " + api.getAsk(pair)
                             + Environment.NewLine + "Long " + (api.getLongPosition(pair) != null ? (api.getBid(pair) - api.getLongPosition(pair).priceOpen) + "" : "NULL")
                             + Environment.NewLine + "Short " + (api.getShortPosition(pair) != null ? (api.getShortPosition(pair).priceOpen) - api.getAsk(pair) + "" : "NULL")
                             + Environment.NewLine + "Uptodate " + api.isUptodate(pair) + " (" + api.getNow() + ")";

            goLongBtn.Enabled    = (api.getLongPosition(pair) == null);
            closeLongBtn.Enabled = (api.getLongPosition(pair) != null);

            goShortBtn.Enabled    = (api.getShortPosition(pair) == null);
            closeShortBtn.Enabled = (api.getShortPosition(pair) != null);
        }