CryptoEnv
- class crypto_env.core.CryptoEnv(max_sell, max_buy, min_sell, min_buy, dataloader: crypto_env.dataloader.dataloader.DataLoader, recorder: crypto_env.recorder.Recorder)[source]
Bases:
gym.core.Env,abc.ABCThis is the core module of CrytoEnv. It provide environment for agents to perform buy and sell actions and provide market states.
- __init__(max_sell, max_buy, min_sell, min_buy, dataloader: crypto_env.dataloader.dataloader.DataLoader, recorder: crypto_env.recorder.Recorder)[source]
- Parameters
max_sell (float) – maximum crypto to sell
max_buy (float) – maximum crypto to buy
min_sell (float) – minimum crypto to sell
min_buy (float) – minimum crypto to buy
dataloader (
DataLoader) – thecrypto_env.dataloader.dataloader.DataLoaderinstancerecorder (
Recorder) – theRecorderinstance
- buy(value, verbose=0)[source]
The agent buy some amount of crypto.
- Parameters
value (float) – number of crypto to buy
verbose (int, optional) – whether to print out debug info. Defaults to 0.
- Returns
same return as
step()
- first_observation()[source]
Return the first observation
- Returns
return a dictionary structured dict(features, index)
- Return type
dict
- abstract classmethod get_reward()[source]
- Returns
the reward for agent after taking an action
- Return type
float
- hold(verbose=0)[source]
The agent does not want to do anything in this step
- Parameters
verbose (int, optional) – whether to print out debug info. Defaults to 0.
- Returns
same return as
step()
- meta()[source]
Return the meta information of the environment
- Returns
the meta of the env
- Return type
dict
- render(mode='human')[source]
Placeholder. Not implemented yet.
- Parameters
mode (str, optional) – Defaults to “human”.