Skip to content

Commit 48cfbad

Browse files
committed
Replace product with instrument eveywhere.
1 parent bd9730e commit 48cfbad

33 files changed

+296
-312
lines changed

docs/source/_static/data/configuration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"base_instrument": "EURO",
3-
"products": ["BTC", "ETH"],
3+
"instruments": ["BTC", "ETH"],
44
"actions": {
55
"n_actions": 24,
66
"action_type": "discrete"
@@ -12,4 +12,4 @@
1212
},
1313
"name": "coinbase"
1414
}
15-
}
15+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
base_instrument: "EURO"
2-
products: ["BTC", "ETH"]
1+
base_instrument: 'EURO'
2+
instruments: ['BTC', 'ETH']
33
actions:
44
n_actions: 24
5-
action_type: "discrete"
5+
action_type: 'discrete'
66
exchanges:
77
credentials:
8-
api_key: "487r63835t4323"
9-
api_secret_key: "do8u43hgiurwfnlveio"
10-
name: "coinbase"
8+
api_key: '487r63835t4323'
9+
api_secret_key: 'do8u43hgiurwfnlveio'
10+
name: 'coinbase'

docs/source/components/actions/ContinuousActions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Simple continuous scheme, which calculates the trade amount as a fraction of the
66

77
- `max_allowed_slippage`
88
- The exchange symbols of the instruments being traded.
9-
- `instrument_symbol`
9+
- `instrument`
1010
- The number of bins to divide the total balance by. Defaults to 20 (i.e. 1/20, 2/20, ..., 20/20).
11-
- `instrument_symbol`
11+
- `instrument`
1212
- The maximum amount above the current price the scheme will pay for an instrument. Defaults to 1.0 (i.e. 1%).
1313

1414
## Setters & Properties

docs/source/components/actions/DiscreteActions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Simple discrete scheme, which calculates the trade amount as a fraction of the t
44

55
## Key Variables
66

7-
- `instrument_symbols`
7+
- `instruments`
88
- The exchange symbols of the instruments being traded.
99
- `actions_per_instrument`
1010
- The number of bins to divide the total balance by. Defaults to 20 (i.e. 1/20, 2/20, ..., 20/20).
@@ -37,7 +37,7 @@ Each property and property setter.
3737
```py
3838
from tensortrade.actions import DiscreteActions
3939

40-
action_scheme = DiscreteActions(n_actions=20, instrument_symbol='BTC')
40+
action_scheme = DiscreteActions(n_actions=20, instrument='BTC')
4141
```
4242

4343
_This discrete action scheme uses 20 discrete actions, which equates to 4 discrete amounts for each of the 5 trade types (market buy/sell, limit buy/sell, and hold). E.g. [0,5,10,15]=hold, 1=market buy 25%, 2=market sell 25%, 3=limit buy 25%, 4=limit sell 25%, 6=market buy 50%, 7=market sell 50%, etc…_

docs/source/components/actions/MultiDiscreteActions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ For example, `0 = HOLD`, `1 = LIMIT_BUY|0.25`, `2 = MARKET_BUY|0.25`, `5 = HOLD`
77

88
## Key Variables
99

10-
- `_instrument_symbols`
10+
- `_instruments`
1111
- The exchange symbols of the instruments being traded.
1212
- `_actions_per_instrument`
1313
- The number of bins to divide the total balance by. Defaults to 20 (i.e. 1/20, 2/20, ..., 20/20).
@@ -39,7 +39,7 @@ Each property and property setter.
3939
```py
4040
from tensortrade.actions import MultiDiscreteActions
4141

42-
action_scheme = MultiDiscreteActions(n_actions=20, instrument_symbol='BTC')
42+
action_scheme = MultiDiscreteActions(n_actions=20, instrument='BTC')
4343
```
4444

4545
_This discrete action scheme uses 20 discrete actions, which equates to 4 discrete amounts for each of the 5 trade types (market buy/sell, limit buy/sell, and hold). E.g. [0,5,10,15]=hold, 1=market buy 25%, 2=market sell 25%, 3=limit buy 25%, 4=limit sell 25%, 6=market buy 50%, 7=market sell 50%, etc…_

docs/source/components/component_types/action_scheme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Each action scheme has a get_trade method, which will transform the agent's spec
99
```python
1010
from tensortrade.actions import DiscreteActions
1111

12-
action_scheme = DiscreteActions(n_actions=20, instrument_symbol='BTC')
12+
action_scheme = DiscreteActions(n_actions=20, instrument='BTC')
1313
```
1414

1515
_This discrete action scheme uses 20 discrete actions, which equates to 4 discrete amounts for each of the 5 trade types (market buy/sell, limit buy/sell, and hold). E.g. [0,5,10,15]=hold, 1=market buy 25%, 2=market sell 25%, 3=limit buy 25%, 4=limit sell 25%, 6=market buy 50%, 7=market sell 50%, etc…_

docs/source/examples/trading_context.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"## Trading Context\n",
88
"\n",
9-
"In this notebook we will explain how to use a TensorTrade `TradingContext`. In addition we will also explain the backbone behind TensorTrade's major components and how they are used inside the framework. We will begin with an easy example of how to use the most basic context, this involves specifying what `base_intrument` we are using and what `products` we are exchanging. By default, the framework sets these as `USD` and `BTC`, however, we would like to specify our products as `BTC` and `ETH`. We also don't want to have to put them as parameters to every component we make because we know it will be the same for all components. Therefore, we use a trading context to set these parameters across the entire framework."
9+
"In this notebook we will explain how to use a TensorTrade `TradingContext`. In addition we will also explain the backbone behind TensorTrade's major components and how they are used inside the framework. We will begin with an easy example of how to use the most basic context, this involves specifying what `base_intrument` we are using and what `instruments` we are exchanging. By default, the framework sets these as `USD` and `BTC`, however, we would like to specify our instruments as `BTC` and `ETH`. We also don't want to have to put them as parameters to every component we make because we know it will be the same for all components. Therefore, we use a trading context to set these parameters across the entire framework."
1010
]
1111
},
1212
{
@@ -21,7 +21,7 @@
2121
"\n",
2222
"config = {\n",
2323
" \"base_instrument\": \"USD\",\n",
24-
" \"products\": [\"BTC\", \"ETH\"]\n",
24+
" \"instruments\": [\"BTC\", \"ETH\"]\n",
2525
"}\n",
2626
"\n",
2727
"with td.TradingContext(**config):\n",
@@ -65,7 +65,7 @@
6565
"source": [
6666
"config = {\n",
6767
" \"base_instrument\": \"USD\",\n",
68-
" \"products\": [\"BTC\", \"ETH\"],\n",
68+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
6969
" \"actions\": {\n",
7070
" \"n_actions\": 24\n",
7171
" }\n",
@@ -86,7 +86,7 @@
8686
"source": [
8787
"config = {\n",
8888
" \"base_instrument\": \"USD\",\n",
89-
" \"products\": [\"BTC\", \"ETH\"],\n",
89+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
9090
" \"actions\": {\n",
9191
" \"n_actions_per_instrument\": 25,\n",
9292
" 'max_allowed_slippage_percent': 5.0\n",
@@ -111,7 +111,7 @@
111111
"source": [
112112
"config = {\n",
113113
" \"base_instrument\": \"USD\",\n",
114-
" \"products\": [\"BTC\", \"ETH\"],\n",
114+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
115115
" \"actions\": {\n",
116116
" \"n_actions\": 25,\n",
117117
" 'max_allowed_slippage_percent': 5.0\n",
@@ -141,7 +141,7 @@
141141
"source": [
142142
"config = {\n",
143143
" \"base_instrument\": \"USD\",\n",
144-
" \"products\": [\"BTC\", \"ETH\"],\n",
144+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
145145
" \"actions\": {\n",
146146
" \"n_actions\": 25,\n",
147147
" 'max_allowed_slippage_percent': 5.0\n",
@@ -168,7 +168,7 @@
168168
"### YAML\n",
169169
"```YAML\n",
170170
"base_instrument: \"EURO\"\n",
171-
"products: [\"BTC\", \"ETH\"]\n",
171+
"instruments: [\"BTC\", \"ETH\"]\n",
172172
"actions:\n",
173173
" n_actions: 24\n",
174174
" max_allowed_slippage_percent: 5.0\n",
@@ -189,7 +189,7 @@
189189
"```JSON\n",
190190
"{\n",
191191
" \"base_instrument\": \"EURO\",\n",
192-
" \"products\": [\"BTC\", \"ETH\"],\n",
192+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
193193
" \"exchanges\": {\n",
194194
" \"commission_percent\": 0.5,\n",
195195
" \"base_precision\": 0.3,\n",

docs/source/examples/train_and_evaluate.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"feature_pipeline = FeaturePipeline(steps=[normalize, difference])\n",
137137
"\n",
138138
"reward_scheme = SimpleProfit()\n",
139-
"action_scheme = DiscreteActions(n_actions=20, instrument_symbol='ETH/BTC')\n",
139+
"action_scheme = DiscreteActions(n_actions=20, instrument='ETH/BTC')\n",
140140
"\n",
141141
"exchange = FBMExchange(base_instrument='BTC',\n",
142142
" timeframe='1h',\n",
@@ -268,7 +268,7 @@
268268
"feature_pipeline = FeaturePipeline(steps=[normalize, difference])\n",
269269
"\n",
270270
"reward_scheme = SimpleProfit()\n",
271-
"action_scheme = DiscreteActions(n_actions=20, instrument_symbol='ETH/BTC')\n",
271+
"action_scheme = DiscreteActions(n_actions=20, instrument='ETH/BTC')\n",
272272
"\n",
273273
"exchange = FBMExchange(base_instrument='BTC',\n",
274274
" timeframe='1h',\n",

examples/TensorTrade_TradingContext.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"## Trading Context\n",
88
"\n",
9-
"In this notebook we will explain how to use a TensorTrade `TradingContext`. In addition we will also explain the backbone behind TensorTrade's major components and how they are used inside the framework. We will begin with an easy example of how to use the most basic context, this involves specifying what `base_intrument` we are using and what `products` we are exchanging. By default, the framework sets these as `USD` and `BTC`, however, we would like to specify our products as `BTC` and `ETH`. We also don't want to have to put them as parameters to every component we make because we know it will be the same for all components. Therefore, we use a trading context to set these parameters across the entire framework."
9+
"In this notebook we will explain how to use a TensorTrade `TradingContext`. In addition we will also explain the backbone behind TensorTrade's major components and how they are used inside the framework. We will begin with an easy example of how to use the most basic context, this involves specifying what `base_intrument` we are using and what `instruments` we are exchanging. By default, the framework sets these as `USD` and `BTC`, however, we would like to specify our instruments as `BTC` and `ETH`. We also don't want to have to put them as parameters to every component we make because we know it will be the same for all components. Therefore, we use a trading context to set these parameters across the entire framework."
1010
]
1111
},
1212
{
@@ -21,7 +21,7 @@
2121
"\n",
2222
"config = {\n",
2323
" \"base_instrument\": \"USD\",\n",
24-
" \"products\": [\"BTC\", \"ETH\"]\n",
24+
" \"instruments\": [\"BTC\", \"ETH\"]\n",
2525
"}\n",
2626
"\n",
2727
"with td.TradingContext(**config):\n",
@@ -65,7 +65,7 @@
6565
"source": [
6666
"config = {\n",
6767
" \"base_instrument\": \"USD\",\n",
68-
" \"products\": [\"BTC\", \"ETH\"],\n",
68+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
6969
" \"actions\": {\n",
7070
" \"n_actions\": 24\n",
7171
" }\n",
@@ -86,7 +86,7 @@
8686
"source": [
8787
"config = {\n",
8888
" \"base_instrument\": \"USD\",\n",
89-
" \"products\": [\"BTC\", \"ETH\"],\n",
89+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
9090
" \"actions\": {\n",
9191
" \"n_actions_per_instrument\": 25,\n",
9292
" 'max_allowed_slippage_percent': 5.0\n",
@@ -113,7 +113,7 @@
113113
"source": [
114114
"config = {\n",
115115
" \"base_instrument\": \"USD\",\n",
116-
" \"products\": [\"BTC\", \"ETH\"],\n",
116+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
117117
" \"actions\": {\n",
118118
" \"n_actions\": 25,\n",
119119
" 'max_allowed_slippage_percent': 5.0\n",
@@ -143,7 +143,7 @@
143143
"source": [
144144
"config = {\n",
145145
" \"base_instrument\": \"USD\",\n",
146-
" \"products\": [\"BTC\", \"ETH\"],\n",
146+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
147147
" \"actions\": {\n",
148148
" \"n_actions\": 25,\n",
149149
" 'max_allowed_slippage_percent': 5.0\n",
@@ -170,7 +170,7 @@
170170
"### YAML\n",
171171
"```YAML\n",
172172
"base_instrument: \"EURO\"\n",
173-
"products: [\"BTC\", \"ETH\"]\n",
173+
"instruments: [\"BTC\", \"ETH\"]\n",
174174
"actions:\n",
175175
" n_actions: 24\n",
176176
" max_allowed_slippage_percent: 5.0\n",
@@ -191,7 +191,7 @@
191191
"```JSON\n",
192192
"{\n",
193193
" \"base_instrument\": \"EURO\",\n",
194-
" \"products\": [\"BTC\", \"ETH\"],\n",
194+
" \"instruments\": [\"BTC\", \"ETH\"],\n",
195195
" \"exchanges\": {\n",
196196
" \"commission_percent\": 0.5,\n",
197197
" \"base_precision\": 0.3,\n",

examples/TensorTrade_Tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@
14361436
"source": [
14371437
"from tensortrade.actions import DiscreteActions\n",
14381438
"\n",
1439-
"action_scheme = DiscreteActions(n_actions=20, instrument_symbol='BTC')"
1439+
"action_scheme = DiscreteActions(n_actions=20, instrument='BTC')"
14401440
]
14411441
},
14421442
{
@@ -1921,7 +1921,7 @@
19211921
" observation_type='ohlcv',\n",
19221922
" timeframe='1h')\n",
19231923
"\n",
1924-
"btcusd_actions = DiscreteActions(n_actions=20, instrument_symbol='BNB/BTC')\n",
1924+
"btcusd_actions = DiscreteActions(n_actions=20, instrument='BNB/BTC')\n",
19251925
"\n",
19261926
"environment = TradingEnvironment(exchange=exchange,\n",
19271927
" feature_pipeline=feature_pipeline,\n",

0 commit comments

Comments
 (0)