forked from gofinance/ib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
commission_report.go
43 lines (37 loc) · 915 Bytes
/
commission_report.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ib
import "bufio"
// This file ports IB API CommissionReport.java. Please preserve declaration order.
// CommissionReport .
type CommissionReport struct {
ExecutionID string
Commission float64
Currency string
RealizedPNL float64
Yield float64
YieldRedemptionDate int64
}
func (c *CommissionReport) code() IncomingMessageID {
return mCommissionReport
}
func (c *CommissionReport) read(b *bufio.Reader) error {
var err error
if c.ExecutionID, err = readString(b); err != nil {
return err
}
if c.Commission, err = readFloat(b); err != nil {
return err
}
if c.Currency, err = readString(b); err != nil {
return err
}
if c.RealizedPNL, err = readFloat(b); err != nil {
return err
}
if c.Yield, err = readFloat(b); err != nil {
return err
}
if c.YieldRedemptionDate, err = readInt(b); err != nil {
return err
}
return nil
}