示例#1
0
        private async void button1_Click(object sender, EventArgs e) //get posisiont
        {
            var positions = await FlyerAPI2.getPositionsAsync();

            for (int i = 0; i < positions.Count; i++)
            {
                addListBox(positions[i].side + ":" + positions[i].size + "@" + positions[i].price);
            }
        }
示例#2
0
        private async void buttonGetPositions_Click(object sender, EventArgs e)
        {
            initializeListBox();
            var res = await FlyerAPI2.getPositionsAsync();

            foreach (var v in res)
            {
                addListBox(v.open_date + ", price=" + v.price + ", pnl=" + v.pnl + ", sfd=" + v.sfd + ", size" + v.size);
            }
        }
示例#3
0
        public async Task <string> updateCurrentPositions()
        {
            var res = "";

            holding_price = new List <double>();
            holding_side  = new List <string>();
            holding_size  = new List <double>();

            var positions = await FlyerAPI2.getPositionsAsync();

            foreach (var v in positions)
            {
                addHolding(v.price, v.size, v.side);
            }
            Form1.Form1Instance.Invoke((Action)(() => { Form1.Form1Instance.addListBox2("initialized holding and update positions"); }));
            return(res);
        }