-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathexecution.go
More file actions
64 lines (58 loc) · 2.13 KB
/
Copy pathexecution.go
File metadata and controls
64 lines (58 loc) · 2.13 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package ibapi
import (
"fmt"
"strconv"
)
// Execution is the information of an order`s execution.
type Execution struct {
ExecID string
Time string
AcctNumber string
Exchange string
Side string
Shares Decimal //UNSET_DECIMAL
Price float64
PermID int64
ClientID int64
OrderID int64
Liquidation int64
CumQty Decimal // UNSET_DECIMAL
AvgPrice float64
OrderRef string
EVRule string
EVMultiplier float64
ModelCode string
LastLiquidity int64
PendingPriceRevision bool
Submitter string
OptExerciseOrLapseType OptionExerciseType
}
func (e Execution) String() string {
return fmt.Sprintf("ExecId: %s, Time: %s, Account: %s, Exchange: %s, Side: %s, Shares: %s, Price: %s, PermId: %s, ClientId: %s, OrderId: %s, Liquidation: %s, CumQty: %s, AvgPrice: %s, OrderRef: %s, EvRule: %s, EvMultiplier: %s, ModelCode: %s, LastLiquidity: %s, PendingPriceRevision: %s, Submitter: %s, OptionExerciseType: %s",
e.ExecID, e.Time, e.AcctNumber, e.Exchange, e.Side, DecimalMaxString(e.Shares), FloatMaxString(e.Price), LongMaxString(e.PermID), IntMaxString(e.ClientID), IntMaxString(e.OrderID), IntMaxString(e.Liquidation), DecimalMaxString(e.CumQty), FloatMaxString(e.AvgPrice),
e.OrderRef, e.EVRule, FloatMaxString(e.EVMultiplier), e.ModelCode, IntMaxString(e.LastLiquidity), strconv.FormatBool(e.PendingPriceRevision), e.Submitter, e.OptExerciseOrLapseType.String())
}
func NewExecution() *Execution {
e := &Execution{}
e.Shares = UNSET_DECIMAL
e.CumQty = UNSET_DECIMAL
e.OptExerciseOrLapseType = OptionExerciseTypeNone
return e
}
// ExecutionFilter .
type ExecutionFilter struct {
ClientID int64
AcctCode string
Time string
Symbol string
SecType string
Exchange string
Side string
LastNDays int64
SpecificDates []int64
}
func NewExecutionFilter() *ExecutionFilter {
ef := &ExecutionFilter{}
ef.LastNDays = UNSET_INT
return ef
}