Example #1
0
        //note: as we have "scalping" (intraday) trading
        //use 0.5 of fee it is equal
        //using only OpenedCostHist (and not use ClosedCostHist)
        public decimal CalcTotalFeeHist()
        {
            decimal fee = 0;

            ListOpeningPosChanges.ForEach(a => fee += a.Fee);
            return(fee);
        }
Example #2
0
        /// <summary>
        ///  Add new "position change" fragment to opened positions list.
        ///  2018-03-11 added idDeal
        /// </summary>
        public void AddOpenedCostHist(long idDeal, decimal price, decimal amount,
                                      decimal fee, decimal feeDealing, decimal feeStock, EnmDealDir dir, DateTime moment, long replId)
        {
            long bpDtOpenTimeStampMs = CUtilTime.GetUnixTimestampMillis(DtOpen);

            ListOpeningPosChanges.Add(new CPosChangeFrag
            {
                IdDeal                 = idDeal,
                Dir                    = dir,
                Moment                 = moment,
                ReplId                 = replId,
                Price                  = price,
                Amount                 = amount,
                Fee                    = fee,
                FeeDealing             = feeDealing,               //2018-07-17
                Fee_Stock              = feeStock,
                BP_DtOpen_timestamp_ms = bpDtOpenTimeStampMs
            });


            m_userDealsPosBox.BindDealBotPos(idDeal, bpDtOpenTimeStampMs);
        }