rakuten_trading 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +455 -0
- data/Rakefile +8 -0
- data/docs/CfdOrderBody.md +9 -0
- data/docs/CfdOrderBody1.md +9 -0
- data/docs/CfdTrade.md +28 -0
- data/docs/InlineResponse200.md +22 -0
- data/docs/InlineResponse2001.md +9 -0
- data/docs/InlineResponse2001Candlesticks.md +12 -0
- data/docs/InlineResponse2002.md +14 -0
- data/docs/InlineResponse2003.md +15 -0
- data/docs/InlineResponse2004.md +9 -0
- data/docs/InlineResponse2005.md +8 -0
- data/docs/InlineResponse2006.md +19 -0
- data/docs/InlineResponse2007.md +18 -0
- data/docs/Order.md +9 -0
- data/docs/OrderData.md +18 -0
- data/docs/OrderDetail.md +33 -0
- data/docs/OrderResponse.md +29 -0
- data/docs/PrivateApi.md +518 -0
- data/docs/PublicApi.md +304 -0
- data/docs/Trade.md +12 -0
- data/git_push.sh +55 -0
- data/lib/rakuten_trading/api/private_api.rb +537 -0
- data/lib/rakuten_trading/api/public_api.rb +315 -0
- data/lib/rakuten_trading/api_client.rb +388 -0
- data/lib/rakuten_trading/api_error.rb +57 -0
- data/lib/rakuten_trading/configuration.rb +212 -0
- data/lib/rakuten_trading/models/cfd_order_body.rb +224 -0
- data/lib/rakuten_trading/models/cfd_order_body_1.rb +224 -0
- data/lib/rakuten_trading/models/cfd_trade.rb +417 -0
- data/lib/rakuten_trading/models/inline_response_200.rb +357 -0
- data/lib/rakuten_trading/models/inline_response_200_1.rb +226 -0
- data/lib/rakuten_trading/models/inline_response_200_1_candlesticks.rb +251 -0
- data/lib/rakuten_trading/models/inline_response_200_2.rb +275 -0
- data/lib/rakuten_trading/models/inline_response_200_3.rb +281 -0
- data/lib/rakuten_trading/models/inline_response_200_4.rb +226 -0
- data/lib/rakuten_trading/models/inline_response_200_5.rb +217 -0
- data/lib/rakuten_trading/models/inline_response_200_6.rb +327 -0
- data/lib/rakuten_trading/models/inline_response_200_7.rb +317 -0
- data/lib/rakuten_trading/models/order.rb +224 -0
- data/lib/rakuten_trading/models/order_data.rb +337 -0
- data/lib/rakuten_trading/models/order_detail.rb +440 -0
- data/lib/rakuten_trading/models/order_response.rb +427 -0
- data/lib/rakuten_trading/models/trade.rb +253 -0
- data/lib/rakuten_trading/version.rb +14 -0
- data/lib/rakuten_trading.rb +57 -0
- data/rakuten_trading.gemspec +38 -0
- data/rakuten_trading_api.yml +1256 -0
- data/spec/api/private_api_spec.rb +151 -0
- data/spec/api/public_api_spec.rb +94 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/cfd_order_body_1_spec.rb +52 -0
- data/spec/models/cfd_order_body_spec.rb +52 -0
- data/spec/models/cfd_trade_spec.rb +166 -0
- data/spec/models/inline_response_200_1_candlesticks_spec.rb +70 -0
- data/spec/models/inline_response_200_1_spec.rb +52 -0
- data/spec/models/inline_response_200_2_spec.rb +82 -0
- data/spec/models/inline_response_200_3_spec.rb +88 -0
- data/spec/models/inline_response_200_4_spec.rb +52 -0
- data/spec/models/inline_response_200_5_spec.rb +46 -0
- data/spec/models/inline_response_200_6_spec.rb +112 -0
- data/spec/models/inline_response_200_7_spec.rb +106 -0
- data/spec/models/inline_response_200_spec.rb +130 -0
- data/spec/models/order_data_spec.rb +106 -0
- data/spec/models/order_detail_spec.rb +196 -0
- data/spec/models/order_response_spec.rb +172 -0
- data/spec/models/order_spec.rb +52 -0
- data/spec/models/trade_spec.rb +70 -0
- data/spec/spec_helper.rb +110 -0
- metadata +201 -0
data/docs/Order.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# RakutenTrading::Order
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**price** | **String** | | [optional]
|
7
|
+
**amount** | **String** | | [optional]
|
8
|
+
**asset_amount** | **String** | | [optional]
|
9
|
+
|
data/docs/OrderData.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# RakutenTrading::OrderData
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**order_behavior** | **String** | 注文の種類(新規または決済) |
|
7
|
+
**position_id** | **Integer** | 決済対象の建玉ID。決済注文の場合必須。 | [optional]
|
8
|
+
**order_side** | **String** | 売買方向(BUYまたはSELL) |
|
9
|
+
**order_type** | **String** | 注文タイプ(LIMIT, MARKET, STOP) |
|
10
|
+
**price** | **String** | 注文価格。指値注文や逆指値注文の場合必須。 | [optional]
|
11
|
+
**amount** | **String** | 注文数量 |
|
12
|
+
**order_expire** | **String** | 注文有効期限(GTC, DAY) | [optional]
|
13
|
+
**leverage** | **Float** | レバレッジ倍率。新規注文の場合のみ。 | [optional]
|
14
|
+
**close_behavior** | **String** | 建玉決済の挙動(CROSS, FIFO) | [optional]
|
15
|
+
**post_only** | **BOOLEAN** | メイカー注文のみ許可するかどうか | [optional]
|
16
|
+
**ifd_close_limit_price** | **String** | IFD決済指値注文価格 | [optional]
|
17
|
+
**ifd_close_stop_price** | **String** | IFD決済逆指値注文価格 | [optional]
|
18
|
+
|
data/docs/OrderDetail.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# RakutenTrading::OrderDetail
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**symbol_id** | **Integer** | | [optional]
|
8
|
+
**order_behavior** | **String** | | [optional]
|
9
|
+
**order_side** | **String** | | [optional]
|
10
|
+
**order_pattern** | **String** | | [optional]
|
11
|
+
**order_type** | **String** | | [optional]
|
12
|
+
**close_behavior** | **String** | | [optional]
|
13
|
+
**price** | **String** | | [optional]
|
14
|
+
**average_price** | **String** | | [optional]
|
15
|
+
**amount** | **String** | | [optional]
|
16
|
+
**remaining_amount** | **String** | | [optional]
|
17
|
+
**order_status** | **String** | | [optional]
|
18
|
+
**post_only** | **BOOLEAN** | | [optional]
|
19
|
+
**oco1_order_id** | **Integer** | | [optional]
|
20
|
+
**oco2_order_id** | **Integer** | | [optional]
|
21
|
+
**ifd_open_order_id** | **Integer** | | [optional]
|
22
|
+
**ifd_close_limit_price** | **String** | | [optional]
|
23
|
+
**ifd_close_stop_price** | **String** | | [optional]
|
24
|
+
**position_id** | **Integer** | | [optional]
|
25
|
+
**order_expire** | **String** | | [optional]
|
26
|
+
**expire_business_date** | **Integer** | | [optional]
|
27
|
+
**leverage** | **String** | | [optional]
|
28
|
+
**necessary_margin** | **String** | | [optional]
|
29
|
+
**business_date** | **Integer** | | [optional]
|
30
|
+
**order_created_at** | **Integer** | | [optional]
|
31
|
+
**created_at** | **Integer** | | [optional]
|
32
|
+
**updated_at** | **Integer** | | [optional]
|
33
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# RakutenTrading::OrderResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | 注文ID | [optional]
|
7
|
+
**symbol_id** | **Integer** | シンボルID | [optional]
|
8
|
+
**order_behavior** | **String** | 注文の種類(新規または決済) | [optional]
|
9
|
+
**order_side** | **String** | 売買方向(BUYまたはSELL) | [optional]
|
10
|
+
**order_pattern** | **String** | 注文パターン(NORMAL, OCO, IFD, IFD_OCO) | [optional]
|
11
|
+
**order_type** | **String** | 注文タイプ(LIMIT, MARKET, STOP) | [optional]
|
12
|
+
**price** | **String** | 注文価格 | [optional]
|
13
|
+
**average_price** | **String** | 平均約定価格 | [optional]
|
14
|
+
**amount** | **String** | 注文数量 | [optional]
|
15
|
+
**remaining_amount** | **String** | 未約定数量 | [optional]
|
16
|
+
**order_status** | **String** | 注文ステータス(WORKING_ORDER, PARTIAL_FILL等) | [optional]
|
17
|
+
**post_only** | **BOOLEAN** | メイカー注文のみ許可されたかどうか | [optional]
|
18
|
+
**oco1_order_id** | **Integer** | OCO1注文ID | [optional]
|
19
|
+
**oco2_order_id** | **Integer** | OCO2注文ID | [optional]
|
20
|
+
**ifd_open_order_id** | **Integer** | IFD新規注文ID | [optional]
|
21
|
+
**ifd_close_limit_price** | **String** | IFD決済指値注文価格 | [optional]
|
22
|
+
**ifd_close_stop_price** | **String** | IFD決済逆指値注文価格 | [optional]
|
23
|
+
**position_id** | **Integer** | 決済対象建玉ID | [optional]
|
24
|
+
**order_expire** | **String** | 有効期限タイプ | [optional]
|
25
|
+
**leverage** | **String** | レバレッジ倍率 | [optional]
|
26
|
+
**necessary_margin** | **String** | 注文中証拠金 | [optional]
|
27
|
+
**created_at** | **Integer** | 注文作成日時 | [optional]
|
28
|
+
**updated_at** | **Integer** | 注文更新日時 | [optional]
|
29
|
+
|
data/docs/PrivateApi.md
ADDED
@@ -0,0 +1,518 @@
|
|
1
|
+
# RakutenTrading::PrivateApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://exchange.rakuten-wallet.co.jp/api/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_asset**](PrivateApi.md#get_asset) | **GET** /asset | 残高一覧取得
|
8
|
+
[**get_cfd_trades**](PrivateApi.md#get_cfd_trades) | **GET** /cfd/trade | 約定履歴取得
|
9
|
+
[**get_equitydata**](PrivateApi.md#get_equitydata) | **GET** /cfd/equitydata | 証拠金関連項目取得
|
10
|
+
[**get_order**](PrivateApi.md#get_order) | **GET** /cfd/order | 注文一覧取得
|
11
|
+
[**get_position**](PrivateApi.md#get_position) | **GET** /cfd/position | 建玉一覧取得
|
12
|
+
[**order**](PrivateApi.md#order) | **POST** /cfd/order | 注文
|
13
|
+
[**order_amend**](PrivateApi.md#order_amend) | **PUT** /cfd/order | 注文訂正
|
14
|
+
[**order_cancel**](PrivateApi.md#order_cancel) | **DELETE** /cfd/order | 注文取消
|
15
|
+
|
16
|
+
# **get_asset**
|
17
|
+
> Array<InlineResponse2005> get_asset
|
18
|
+
|
19
|
+
残高一覧取得
|
20
|
+
|
21
|
+
アカウントの資産情報(各通貨の保有量)を取得します。
|
22
|
+
|
23
|
+
### Example
|
24
|
+
```ruby
|
25
|
+
# load the gem
|
26
|
+
require 'rakuten_trading'
|
27
|
+
# setup authorization
|
28
|
+
RakutenTrading.configure do |config|
|
29
|
+
# Configure API key authorization: ApiKeyAuth
|
30
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
31
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
32
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
33
|
+
|
34
|
+
# Configure API key authorization: SignatureAuth
|
35
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
36
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
37
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
38
|
+
end
|
39
|
+
|
40
|
+
api_instance = RakutenTrading::PrivateApi.new
|
41
|
+
|
42
|
+
begin
|
43
|
+
#残高一覧取得
|
44
|
+
result = api_instance.get_asset
|
45
|
+
p result
|
46
|
+
rescue RakutenTrading::ApiError => e
|
47
|
+
puts "Exception when calling PrivateApi->get_asset: #{e}"
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
### Parameters
|
52
|
+
This endpoint does not need any parameter.
|
53
|
+
|
54
|
+
### Return type
|
55
|
+
|
56
|
+
[**Array<InlineResponse2005>**](InlineResponse2005.md)
|
57
|
+
|
58
|
+
### Authorization
|
59
|
+
|
60
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
61
|
+
|
62
|
+
### HTTP request headers
|
63
|
+
|
64
|
+
- **Content-Type**: Not defined
|
65
|
+
- **Accept**: application/json
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
# **get_cfd_trades**
|
70
|
+
> Array<CfdTrade> get_cfd_trades(symbol_id, opts)
|
71
|
+
|
72
|
+
約定履歴取得
|
73
|
+
|
74
|
+
指定された条件に基づくCFD取引の約定履歴(トレード)を取得します。これにより、ユーザーは過去の取引データを分析することができます。
|
75
|
+
|
76
|
+
### Example
|
77
|
+
```ruby
|
78
|
+
# load the gem
|
79
|
+
require 'rakuten_trading'
|
80
|
+
# setup authorization
|
81
|
+
RakutenTrading.configure do |config|
|
82
|
+
# Configure API key authorization: ApiKeyAuth
|
83
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
84
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
85
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
86
|
+
|
87
|
+
# Configure API key authorization: SignatureAuth
|
88
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
89
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
90
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
91
|
+
end
|
92
|
+
|
93
|
+
api_instance = RakutenTrading::PrivateApi.new
|
94
|
+
symbol_id = 789 # Integer | シンボルID
|
95
|
+
opts = {
|
96
|
+
id: [56], # Array<Integer> | 約定IDの配列
|
97
|
+
date_from: 789, # Integer | 取得開始日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。
|
98
|
+
date_to: 789, # Integer | 取得終了日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。
|
99
|
+
order_behavior: 'order_behavior_example', # String | 注文の挙動(OPEN, CLOSE)
|
100
|
+
trade_behavior: 'trade_behavior_example', # String | トレードの挙動(OPEN, CLOSE)
|
101
|
+
order_side: 'order_side_example', # String | 売買方向(SELL, BUY)
|
102
|
+
order_pattern: ['order_pattern_example'], # Array<String> | 注文パターン(NORMAL, OCO, IFD, IFD_OCO, LOSS_CUT, CLOSE_ALL)
|
103
|
+
order_type: ['order_type_example'], # Array<String> | 執行条件(MARKET, LIMIT, STOP)
|
104
|
+
trade_action: 'trade_action_example', # String | 約定アクション(MAKER, TAKER)
|
105
|
+
order_id: [56], # Array<Integer> | 注文IDの配列
|
106
|
+
position_id: [56], # Array<Integer> | 建玉IDの配列
|
107
|
+
size: 30 # Integer | 取得件数。デフォルトは30、最大は500。
|
108
|
+
}
|
109
|
+
|
110
|
+
begin
|
111
|
+
#約定履歴取得
|
112
|
+
result = api_instance.get_cfd_trades(symbol_id, opts)
|
113
|
+
p result
|
114
|
+
rescue RakutenTrading::ApiError => e
|
115
|
+
puts "Exception when calling PrivateApi->get_cfd_trades: #{e}"
|
116
|
+
end
|
117
|
+
```
|
118
|
+
|
119
|
+
### Parameters
|
120
|
+
|
121
|
+
Name | Type | Description | Notes
|
122
|
+
------------- | ------------- | ------------- | -------------
|
123
|
+
**symbol_id** | **Integer**| シンボルID |
|
124
|
+
**id** | [**Array<Integer>**](Integer.md)| 約定IDの配列 | [optional]
|
125
|
+
**date_from** | **Integer**| 取得開始日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。 | [optional]
|
126
|
+
**date_to** | **Integer**| 取得終了日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。 | [optional]
|
127
|
+
**order_behavior** | **String**| 注文の挙動(OPEN, CLOSE) | [optional]
|
128
|
+
**trade_behavior** | **String**| トレードの挙動(OPEN, CLOSE) | [optional]
|
129
|
+
**order_side** | **String**| 売買方向(SELL, BUY) | [optional]
|
130
|
+
**order_pattern** | [**Array<String>**](String.md)| 注文パターン(NORMAL, OCO, IFD, IFD_OCO, LOSS_CUT, CLOSE_ALL) | [optional]
|
131
|
+
**order_type** | [**Array<String>**](String.md)| 執行条件(MARKET, LIMIT, STOP) | [optional]
|
132
|
+
**trade_action** | **String**| 約定アクション(MAKER, TAKER) | [optional]
|
133
|
+
**order_id** | [**Array<Integer>**](Integer.md)| 注文IDの配列 | [optional]
|
134
|
+
**position_id** | [**Array<Integer>**](Integer.md)| 建玉IDの配列 | [optional]
|
135
|
+
**size** | **Integer**| 取得件数。デフォルトは30、最大は500。 | [optional] [default to 30]
|
136
|
+
|
137
|
+
### Return type
|
138
|
+
|
139
|
+
[**Array<CfdTrade>**](CfdTrade.md)
|
140
|
+
|
141
|
+
### Authorization
|
142
|
+
|
143
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
144
|
+
|
145
|
+
### HTTP request headers
|
146
|
+
|
147
|
+
- **Content-Type**: Not defined
|
148
|
+
- **Accept**: application/json
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
# **get_equitydata**
|
153
|
+
> InlineResponse2006 get_equitydata
|
154
|
+
|
155
|
+
証拠金関連項目取得
|
156
|
+
|
157
|
+
口座の証拠金関連情報を取得します。これには建玉評価損益、必要証拠金、証拠金維持率などが含まれます。
|
158
|
+
|
159
|
+
### Example
|
160
|
+
```ruby
|
161
|
+
# load the gem
|
162
|
+
require 'rakuten_trading'
|
163
|
+
# setup authorization
|
164
|
+
RakutenTrading.configure do |config|
|
165
|
+
# Configure API key authorization: ApiKeyAuth
|
166
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
167
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
168
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
169
|
+
|
170
|
+
# Configure API key authorization: SignatureAuth
|
171
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
172
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
173
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
174
|
+
end
|
175
|
+
|
176
|
+
api_instance = RakutenTrading::PrivateApi.new
|
177
|
+
|
178
|
+
begin
|
179
|
+
#証拠金関連項目取得
|
180
|
+
result = api_instance.get_equitydata
|
181
|
+
p result
|
182
|
+
rescue RakutenTrading::ApiError => e
|
183
|
+
puts "Exception when calling PrivateApi->get_equitydata: #{e}"
|
184
|
+
end
|
185
|
+
```
|
186
|
+
|
187
|
+
### Parameters
|
188
|
+
This endpoint does not need any parameter.
|
189
|
+
|
190
|
+
### Return type
|
191
|
+
|
192
|
+
[**InlineResponse2006**](InlineResponse2006.md)
|
193
|
+
|
194
|
+
### Authorization
|
195
|
+
|
196
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
197
|
+
|
198
|
+
### HTTP request headers
|
199
|
+
|
200
|
+
- **Content-Type**: Not defined
|
201
|
+
- **Accept**: application/json
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
# **get_order**
|
206
|
+
> Array<OrderDetail> get_order(symbol_id, opts)
|
207
|
+
|
208
|
+
注文一覧取得
|
209
|
+
|
210
|
+
指定された条件にマッチする注文一覧を取得します。このエンドポイントを通じて、特定のシンボル、注文タイプ、または期間に関する注文の詳細情報を照会することができます。
|
211
|
+
|
212
|
+
### Example
|
213
|
+
```ruby
|
214
|
+
# load the gem
|
215
|
+
require 'rakuten_trading'
|
216
|
+
# setup authorization
|
217
|
+
RakutenTrading.configure do |config|
|
218
|
+
# Configure API key authorization: ApiKeyAuth
|
219
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
220
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
221
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
222
|
+
|
223
|
+
# Configure API key authorization: SignatureAuth
|
224
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
225
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
226
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
227
|
+
end
|
228
|
+
|
229
|
+
api_instance = RakutenTrading::PrivateApi.new
|
230
|
+
symbol_id = 789 # Integer | シンボルID
|
231
|
+
opts = {
|
232
|
+
id: [56], # Array<Integer> | 注文IDの配列
|
233
|
+
date_from: 789, # Integer | 取得開始日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。
|
234
|
+
date_to: 789, # Integer | 取得終了日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。
|
235
|
+
order_behavior: 'order_behavior_example', # String | 注文の挙動(OPEN, CLOSE)
|
236
|
+
order_side: 'order_side_example', # String | 売買方向(SELL, BUY)
|
237
|
+
order_pattern: ['order_pattern_example'], # Array<String> | 注文パターン(NORMAL, OCO, IFD, IFD_OCO)
|
238
|
+
order_type: ['order_type_example'], # Array<String> | 執行条件(MARKET, LIMIT, STOP)
|
239
|
+
close_behavior: ['close_behavior_example'], # Array<String> | 決済挙動(CROSS, FIFO)
|
240
|
+
order_status: ['order_status_example'], # Array<String> | 注文ステータス(WORKING_ORDER, PARTIAL_FILL)
|
241
|
+
post_only: true, # BOOLEAN | メイカー注文のみ許可
|
242
|
+
size: 30 # Integer | 取得件数。デフォルトは30、最大は500。
|
243
|
+
}
|
244
|
+
|
245
|
+
begin
|
246
|
+
#注文一覧取得
|
247
|
+
result = api_instance.get_order(symbol_id, opts)
|
248
|
+
p result
|
249
|
+
rescue RakutenTrading::ApiError => e
|
250
|
+
puts "Exception when calling PrivateApi->get_order: #{e}"
|
251
|
+
end
|
252
|
+
```
|
253
|
+
|
254
|
+
### Parameters
|
255
|
+
|
256
|
+
Name | Type | Description | Notes
|
257
|
+
------------- | ------------- | ------------- | -------------
|
258
|
+
**symbol_id** | **Integer**| シンボルID |
|
259
|
+
**id** | [**Array<Integer>**](Integer.md)| 注文IDの配列 | [optional]
|
260
|
+
**date_from** | **Integer**| 取得開始日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。 | [optional]
|
261
|
+
**date_to** | **Integer**| 取得終了日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。 | [optional]
|
262
|
+
**order_behavior** | **String**| 注文の挙動(OPEN, CLOSE) | [optional]
|
263
|
+
**order_side** | **String**| 売買方向(SELL, BUY) | [optional]
|
264
|
+
**order_pattern** | [**Array<String>**](String.md)| 注文パターン(NORMAL, OCO, IFD, IFD_OCO) | [optional]
|
265
|
+
**order_type** | [**Array<String>**](String.md)| 執行条件(MARKET, LIMIT, STOP) | [optional]
|
266
|
+
**close_behavior** | [**Array<String>**](String.md)| 決済挙動(CROSS, FIFO) | [optional]
|
267
|
+
**order_status** | [**Array<String>**](String.md)| 注文ステータス(WORKING_ORDER, PARTIAL_FILL) | [optional]
|
268
|
+
**post_only** | **BOOLEAN**| メイカー注文のみ許可 | [optional]
|
269
|
+
**size** | **Integer**| 取得件数。デフォルトは30、最大は500。 | [optional] [default to 30]
|
270
|
+
|
271
|
+
### Return type
|
272
|
+
|
273
|
+
[**Array<OrderDetail>**](OrderDetail.md)
|
274
|
+
|
275
|
+
### Authorization
|
276
|
+
|
277
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
278
|
+
|
279
|
+
### HTTP request headers
|
280
|
+
|
281
|
+
- **Content-Type**: Not defined
|
282
|
+
- **Accept**: application/json
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
# **get_position**
|
287
|
+
> Array<InlineResponse2007> get_position(opts)
|
288
|
+
|
289
|
+
建玉一覧取得
|
290
|
+
|
291
|
+
### Example
|
292
|
+
```ruby
|
293
|
+
# load the gem
|
294
|
+
require 'rakuten_trading'
|
295
|
+
# setup authorization
|
296
|
+
RakutenTrading.configure do |config|
|
297
|
+
# Configure API key authorization: ApiKeyAuth
|
298
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
299
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
300
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
301
|
+
|
302
|
+
# Configure API key authorization: SignatureAuth
|
303
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
304
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
305
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
306
|
+
end
|
307
|
+
|
308
|
+
api_instance = RakutenTrading::PrivateApi.new
|
309
|
+
opts = {
|
310
|
+
symbol_id: 789, # Integer | シンボルID。特定の銘柄に対する建玉のみを取得したい場合に指定します。
|
311
|
+
id: [56], # Array<Integer> | 建玉ID。特定の建玉情報のみを取得したい場合に指定します。
|
312
|
+
date_from: 789, # Integer | 取得開始日時。指定日時以上の建玉を検索します。
|
313
|
+
date_to: 789 # Integer | 取得終了日時。指定日時未満の建玉を検索します。
|
314
|
+
}
|
315
|
+
|
316
|
+
begin
|
317
|
+
#建玉一覧取得
|
318
|
+
result = api_instance.get_position(opts)
|
319
|
+
p result
|
320
|
+
rescue RakutenTrading::ApiError => e
|
321
|
+
puts "Exception when calling PrivateApi->get_position: #{e}"
|
322
|
+
end
|
323
|
+
```
|
324
|
+
|
325
|
+
### Parameters
|
326
|
+
|
327
|
+
Name | Type | Description | Notes
|
328
|
+
------------- | ------------- | ------------- | -------------
|
329
|
+
**symbol_id** | **Integer**| シンボルID。特定の銘柄に対する建玉のみを取得したい場合に指定します。 | [optional]
|
330
|
+
**id** | [**Array<Integer>**](Integer.md)| 建玉ID。特定の建玉情報のみを取得したい場合に指定します。 | [optional]
|
331
|
+
**date_from** | **Integer**| 取得開始日時。指定日時以上の建玉を検索します。 | [optional]
|
332
|
+
**date_to** | **Integer**| 取得終了日時。指定日時未満の建玉を検索します。 | [optional]
|
333
|
+
|
334
|
+
### Return type
|
335
|
+
|
336
|
+
[**Array<InlineResponse2007>**](InlineResponse2007.md)
|
337
|
+
|
338
|
+
### Authorization
|
339
|
+
|
340
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
341
|
+
|
342
|
+
### HTTP request headers
|
343
|
+
|
344
|
+
- **Content-Type**: Not defined
|
345
|
+
- **Accept**: application/json
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
# **order**
|
350
|
+
> Array<OrderResponse> order(body)
|
351
|
+
|
352
|
+
注文
|
353
|
+
|
354
|
+
### Example
|
355
|
+
```ruby
|
356
|
+
# load the gem
|
357
|
+
require 'rakuten_trading'
|
358
|
+
# setup authorization
|
359
|
+
RakutenTrading.configure do |config|
|
360
|
+
# Configure API key authorization: ApiKeyAuth
|
361
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
362
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
363
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
364
|
+
|
365
|
+
# Configure API key authorization: SignatureAuth
|
366
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
367
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
368
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
369
|
+
end
|
370
|
+
|
371
|
+
api_instance = RakutenTrading::PrivateApi.new
|
372
|
+
body = RakutenTrading::CfdOrderBody1.new # CfdOrderBody1 |
|
373
|
+
|
374
|
+
|
375
|
+
begin
|
376
|
+
#注文
|
377
|
+
result = api_instance.order(body)
|
378
|
+
p result
|
379
|
+
rescue RakutenTrading::ApiError => e
|
380
|
+
puts "Exception when calling PrivateApi->order: #{e}"
|
381
|
+
end
|
382
|
+
```
|
383
|
+
|
384
|
+
### Parameters
|
385
|
+
|
386
|
+
Name | Type | Description | Notes
|
387
|
+
------------- | ------------- | ------------- | -------------
|
388
|
+
**body** | [**CfdOrderBody1**](CfdOrderBody1.md)| |
|
389
|
+
|
390
|
+
### Return type
|
391
|
+
|
392
|
+
[**Array<OrderResponse>**](OrderResponse.md)
|
393
|
+
|
394
|
+
### Authorization
|
395
|
+
|
396
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
397
|
+
|
398
|
+
### HTTP request headers
|
399
|
+
|
400
|
+
- **Content-Type**: application/json
|
401
|
+
- **Accept**: application/json
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
# **order_amend**
|
406
|
+
> Array<OrderResponse> order_amend(body)
|
407
|
+
|
408
|
+
注文訂正
|
409
|
+
|
410
|
+
### Example
|
411
|
+
```ruby
|
412
|
+
# load the gem
|
413
|
+
require 'rakuten_trading'
|
414
|
+
# setup authorization
|
415
|
+
RakutenTrading.configure do |config|
|
416
|
+
# Configure API key authorization: ApiKeyAuth
|
417
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
418
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
419
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
420
|
+
|
421
|
+
# Configure API key authorization: SignatureAuth
|
422
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
423
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
424
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
425
|
+
end
|
426
|
+
|
427
|
+
api_instance = RakutenTrading::PrivateApi.new
|
428
|
+
body = RakutenTrading::CfdOrderBody.new # CfdOrderBody |
|
429
|
+
|
430
|
+
|
431
|
+
begin
|
432
|
+
#注文訂正
|
433
|
+
result = api_instance.order_amend(body)
|
434
|
+
p result
|
435
|
+
rescue RakutenTrading::ApiError => e
|
436
|
+
puts "Exception when calling PrivateApi->order_amend: #{e}"
|
437
|
+
end
|
438
|
+
```
|
439
|
+
|
440
|
+
### Parameters
|
441
|
+
|
442
|
+
Name | Type | Description | Notes
|
443
|
+
------------- | ------------- | ------------- | -------------
|
444
|
+
**body** | [**CfdOrderBody**](CfdOrderBody.md)| |
|
445
|
+
|
446
|
+
### Return type
|
447
|
+
|
448
|
+
[**Array<OrderResponse>**](OrderResponse.md)
|
449
|
+
|
450
|
+
### Authorization
|
451
|
+
|
452
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
453
|
+
|
454
|
+
### HTTP request headers
|
455
|
+
|
456
|
+
- **Content-Type**: application/json
|
457
|
+
- **Accept**: application/json
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
# **order_cancel**
|
462
|
+
> Array<OrderResponse> order_cancel(symbol_id, id)
|
463
|
+
|
464
|
+
注文取消
|
465
|
+
|
466
|
+
### Example
|
467
|
+
```ruby
|
468
|
+
# load the gem
|
469
|
+
require 'rakuten_trading'
|
470
|
+
# setup authorization
|
471
|
+
RakutenTrading.configure do |config|
|
472
|
+
# Configure API key authorization: ApiKeyAuth
|
473
|
+
config.api_key['API-KEY'] = 'YOUR API KEY'
|
474
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
475
|
+
#config.api_key_prefix['API-KEY'] = 'Bearer'
|
476
|
+
|
477
|
+
# Configure API key authorization: SignatureAuth
|
478
|
+
config.api_key['SIGNATURE'] = 'YOUR API KEY'
|
479
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
480
|
+
#config.api_key_prefix['SIGNATURE'] = 'Bearer'
|
481
|
+
end
|
482
|
+
|
483
|
+
api_instance = RakutenTrading::PrivateApi.new
|
484
|
+
symbol_id = 789 # Integer | シンボルID
|
485
|
+
id = 789 # Integer | 注文ID
|
486
|
+
|
487
|
+
|
488
|
+
begin
|
489
|
+
#注文取消
|
490
|
+
result = api_instance.order_cancel(symbol_id, id)
|
491
|
+
p result
|
492
|
+
rescue RakutenTrading::ApiError => e
|
493
|
+
puts "Exception when calling PrivateApi->order_cancel: #{e}"
|
494
|
+
end
|
495
|
+
```
|
496
|
+
|
497
|
+
### Parameters
|
498
|
+
|
499
|
+
Name | Type | Description | Notes
|
500
|
+
------------- | ------------- | ------------- | -------------
|
501
|
+
**symbol_id** | **Integer**| シンボルID |
|
502
|
+
**id** | **Integer**| 注文ID |
|
503
|
+
|
504
|
+
### Return type
|
505
|
+
|
506
|
+
[**Array<OrderResponse>**](OrderResponse.md)
|
507
|
+
|
508
|
+
### Authorization
|
509
|
+
|
510
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth), [SignatureAuth](../README.md#SignatureAuth)
|
511
|
+
|
512
|
+
### HTTP request headers
|
513
|
+
|
514
|
+
- **Content-Type**: Not defined
|
515
|
+
- **Accept**: application/json
|
516
|
+
|
517
|
+
|
518
|
+
|