Ejemplo n.º 1
0
        public void bk(int cnt)
        {
            lock (this) {
                float price = data.End;
                float money = tradeFee.calcMoney(true, cnt, price);

                buyHoldInfo.addHold(true, price, cnt);
                KLineTradeDetailInfo trade = new KLineTradeDetailInfo(data.Code, data.Time, true, true, cnt, price, 0);
                details.Add(trade);
                //减掉花掉的钱
                this.money = this.money - money;
            }
        }
Ejemplo n.º 2
0
        private void bp2(int cnt)
        {
            if (buyHoldInfo.mount == 0)
            {
                return;
            }
            float price = data.End;
            float money = tradeFee.calcMoney(false, cnt, buyHoldInfo.cost);
            float earn  = calcEarn(buyHoldInfo);

            buyHoldInfo.removeHold(price, cnt);
            KLineTradeDetailInfo trade = new KLineTradeDetailInfo(data.Code, data.Time, false, true, cnt, price, earn);

            details.Add(trade);
            this.money = this.money + money + earn;
        }