Skip to content

Commit

Permalink
Replace product with instrument eveywhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
notadamking committed Nov 10, 2019
1 parent bd9730e commit 48cfbad
Show file tree
Hide file tree
Showing 33 changed files with 296 additions and 312 deletions.
4 changes: 2 additions & 2 deletions docs/source/_static/data/configuration.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"base_instrument": "EURO",
"products": ["BTC", "ETH"],
"instruments": ["BTC", "ETH"],
"actions": {
"n_actions": 24,
"action_type": "discrete"
Expand All @@ -12,4 +12,4 @@
},
"name": "coinbase"
}
}
}
12 changes: 6 additions & 6 deletions docs/source/_static/data/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
base_instrument: "EURO"
products: ["BTC", "ETH"]
base_instrument: 'EURO'
instruments: ['BTC', 'ETH']
actions:
n_actions: 24
action_type: "discrete"
action_type: 'discrete'
exchanges:
credentials:
api_key: "487r63835t4323"
api_secret_key: "do8u43hgiurwfnlveio"
name: "coinbase"
api_key: '487r63835t4323'
api_secret_key: 'do8u43hgiurwfnlveio'
name: 'coinbase'
4 changes: 2 additions & 2 deletions docs/source/components/actions/ContinuousActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Simple continuous scheme, which calculates the trade amount as a fraction of the

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

## Setters & Properties
Expand Down
4 changes: 2 additions & 2 deletions docs/source/components/actions/DiscreteActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Simple discrete scheme, which calculates the trade amount as a fraction of the t

## Key Variables

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

action_scheme = DiscreteActions(n_actions=20, instrument_symbol='BTC')
action_scheme = DiscreteActions(n_actions=20, instrument='BTC')
```

_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…_
4 changes: 2 additions & 2 deletions docs/source/components/actions/MultiDiscreteActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For example, `0 = HOLD`, `1 = LIMIT_BUY|0.25`, `2 = MARKET_BUY|0.25`, `5 = HOLD`

## Key Variables

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

action_scheme = MultiDiscreteActions(n_actions=20, instrument_symbol='BTC')
action_scheme = MultiDiscreteActions(n_actions=20, instrument='BTC')
```

_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…_
2 changes: 1 addition & 1 deletion docs/source/components/component_types/action_scheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Each action scheme has a get_trade method, which will transform the agent's spec
```python
from tensortrade.actions import DiscreteActions

action_scheme = DiscreteActions(n_actions=20, instrument_symbol='BTC')
action_scheme = DiscreteActions(n_actions=20, instrument='BTC')
```

_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…_
16 changes: 8 additions & 8 deletions docs/source/examples/trading_context.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"## Trading Context\n",
"\n",
"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."
"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."
]
},
{
Expand All @@ -21,7 +21,7 @@
"\n",
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"]\n",
" \"instruments\": [\"BTC\", \"ETH\"]\n",
"}\n",
"\n",
"with td.TradingContext(**config):\n",
Expand Down Expand Up @@ -65,7 +65,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions\": 24\n",
" }\n",
Expand All @@ -86,7 +86,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions_per_instrument\": 25,\n",
" 'max_allowed_slippage_percent': 5.0\n",
Expand All @@ -111,7 +111,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions\": 25,\n",
" 'max_allowed_slippage_percent': 5.0\n",
Expand Down Expand Up @@ -141,7 +141,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions\": 25,\n",
" 'max_allowed_slippage_percent': 5.0\n",
Expand All @@ -168,7 +168,7 @@
"### YAML\n",
"```YAML\n",
"base_instrument: \"EURO\"\n",
"products: [\"BTC\", \"ETH\"]\n",
"instruments: [\"BTC\", \"ETH\"]\n",
"actions:\n",
" n_actions: 24\n",
" max_allowed_slippage_percent: 5.0\n",
Expand All @@ -189,7 +189,7 @@
"```JSON\n",
"{\n",
" \"base_instrument\": \"EURO\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"exchanges\": {\n",
" \"commission_percent\": 0.5,\n",
" \"base_precision\": 0.3,\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/train_and_evaluate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"feature_pipeline = FeaturePipeline(steps=[normalize, difference])\n",
"\n",
"reward_scheme = SimpleProfit()\n",
"action_scheme = DiscreteActions(n_actions=20, instrument_symbol='ETH/BTC')\n",
"action_scheme = DiscreteActions(n_actions=20, instrument='ETH/BTC')\n",
"\n",
"exchange = FBMExchange(base_instrument='BTC',\n",
" timeframe='1h',\n",
Expand Down Expand Up @@ -268,7 +268,7 @@
"feature_pipeline = FeaturePipeline(steps=[normalize, difference])\n",
"\n",
"reward_scheme = SimpleProfit()\n",
"action_scheme = DiscreteActions(n_actions=20, instrument_symbol='ETH/BTC')\n",
"action_scheme = DiscreteActions(n_actions=20, instrument='ETH/BTC')\n",
"\n",
"exchange = FBMExchange(base_instrument='BTC',\n",
" timeframe='1h',\n",
Expand Down
16 changes: 8 additions & 8 deletions examples/TensorTrade_TradingContext.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"## Trading Context\n",
"\n",
"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."
"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."
]
},
{
Expand All @@ -21,7 +21,7 @@
"\n",
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"]\n",
" \"instruments\": [\"BTC\", \"ETH\"]\n",
"}\n",
"\n",
"with td.TradingContext(**config):\n",
Expand Down Expand Up @@ -65,7 +65,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions\": 24\n",
" }\n",
Expand All @@ -86,7 +86,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions_per_instrument\": 25,\n",
" 'max_allowed_slippage_percent': 5.0\n",
Expand All @@ -113,7 +113,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions\": 25,\n",
" 'max_allowed_slippage_percent': 5.0\n",
Expand Down Expand Up @@ -143,7 +143,7 @@
"source": [
"config = {\n",
" \"base_instrument\": \"USD\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"actions\": {\n",
" \"n_actions\": 25,\n",
" 'max_allowed_slippage_percent': 5.0\n",
Expand All @@ -170,7 +170,7 @@
"### YAML\n",
"```YAML\n",
"base_instrument: \"EURO\"\n",
"products: [\"BTC\", \"ETH\"]\n",
"instruments: [\"BTC\", \"ETH\"]\n",
"actions:\n",
" n_actions: 24\n",
" max_allowed_slippage_percent: 5.0\n",
Expand All @@ -191,7 +191,7 @@
"```JSON\n",
"{\n",
" \"base_instrument\": \"EURO\",\n",
" \"products\": [\"BTC\", \"ETH\"],\n",
" \"instruments\": [\"BTC\", \"ETH\"],\n",
" \"exchanges\": {\n",
" \"commission_percent\": 0.5,\n",
" \"base_precision\": 0.3,\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/TensorTrade_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@
"source": [
"from tensortrade.actions import DiscreteActions\n",
"\n",
"action_scheme = DiscreteActions(n_actions=20, instrument_symbol='BTC')"
"action_scheme = DiscreteActions(n_actions=20, instrument='BTC')"
]
},
{
Expand Down Expand Up @@ -1921,7 +1921,7 @@
" observation_type='ohlcv',\n",
" timeframe='1h')\n",
"\n",
"btcusd_actions = DiscreteActions(n_actions=20, instrument_symbol='BNB/BTC')\n",
"btcusd_actions = DiscreteActions(n_actions=20, instrument='BNB/BTC')\n",
"\n",
"environment = TradingEnvironment(exchange=exchange,\n",
" feature_pipeline=feature_pipeline,\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/data/configuration.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"base_instrument": "EURO",
"products": ["BTC", "ETH"],
"instruments": ["BTC", "ETH"],
"actions": {
"n_actions": 24,
"action_type": "discrete"
Expand All @@ -12,4 +12,4 @@
},
"name": "coinbase"
}
}
}
12 changes: 6 additions & 6 deletions examples/data/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
base_instrument: "EURO"
products: ["BTC", "ETH"]
base_instrument: 'EURO'
instruments: ['BTC', 'ETH']
actions:
n_actions: 24
action_type: "discrete"
action_type: 'discrete'
exchanges:
credentials:
api_key: "487r63835t4323"
api_secret_key: "do8u43hgiurwfnlveio"
name: "coinbase"
api_key: '487r63835t4323'
api_secret_key: 'do8u43hgiurwfnlveio'
name: 'coinbase'
Loading

0 comments on commit 48cfbad

Please sign in to comment.