forked from alpacahq/alpaca-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.ts
183 lines (156 loc) · 3.1 KB
/
params.ts
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import { OrderSide, OrderType, OrderTimeInForce } from './entities.js'
export interface AddToWatchList {
uuid: string
symbol: string
}
export interface CancelOrder {
order_id: string
}
export interface ClosePosition {
symbol: string
qty?: number
percentage?: number
}
export interface CreateWatchList {
name: string
symbols?: string[]
}
export interface DeleteWatchList {
uuid: string
}
export interface GetAccountActivities {
activity_type?: string
activity_types?: string | string[]
date?: string
until?: string
after?: string
direction?: 'asc' | 'desc'
page_size?: number
page_token?: string
}
export interface GetAsset {
asset_id_or_symbol: string
}
export interface GetAssets {
status?: 'active' | 'inactive'
asset_class?: string // i don't know where to find all asset classes
}
export interface GetCalendar {
start?: Date
end?: Date
}
export interface GetTrades {
symbol: string
start: Date
end: Date
limit?: number
page_token?: string
}
export interface GetQuotes {
symbol: string
start: Date
end: Date
limit?: number
page_token?: string
}
export interface GetSnapshot {
symbol: string
}
export interface GetSnapshots {
symbols: string[]
}
export interface GetBars {
symbol: string
start: Date
end: Date
limit?: number
page_token?: string
timeframe: '1Sec' | '1Min' | '1Hour' | '1Day'
adjustment?: 'all' | 'dividend' | 'raw' | 'split'
}
export interface GetBars_v1 {
timeframe: string
symbols: string[]
limit?: number
start?: Date
end?: Date
after?: Date
until?: Date
}
export interface GetLastQuote_v1 {
symbol: string
}
export interface GetLastTrade_v1 {
symbol: string
}
export interface GetOrder {
order_id?: string
client_order_id?: string
nested?: boolean
}
export interface GetOrders {
status?: 'open' | 'closed' | 'all'
limit?: number
after?: Date
until?: Date
direction?: 'asc' | 'desc'
nested?: boolean
symbols?: string[]
}
export interface GetPortfolioHistory {
period?: string
timeframe?: string
date_end?: Date
extended_hours?: boolean
}
export interface GetPosition {
symbol: string
}
export interface GetWatchList {
uuid: string
}
export interface PlaceOrder {
symbol: string
side: OrderSide
type: OrderType
time_in_force: OrderTimeInForce
qty?: number
notional?: number
limit_price?: number
stop_price?: number
extended_hours?: boolean
client_order_id?: string
trail_price?: number
trail_percent?: number
order_class?: 'simple' | 'bracket' | 'oco' | 'oto'
take_profit?: {
limit_price: number
}
stop_loss?: {
stop_price: number
limit_price?: number
}
}
export interface RemoveFromWatchList {
uuid: string
symbol: string
}
export interface ReplaceOrder {
order_id: string
qty?: number
time_in_force?: OrderTimeInForce
limit_price?: number
stop_price?: number
client_order_id?: string
}
export interface UpdateAccountConfigurations {
dtbp_check?: string
no_shorting?: boolean
suspend_trade?: boolean
trade_confirm_email?: string
}
export interface UpdateWatchList {
uuid: string
name?: string
symbols?: string[]
}