Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/austin-starks/Deep-RL-Stocks
/ functions
Functions
92 in github.com/austin-starks/Deep-RL-Stocks
⨍
Functions
92
◇
Types & classes
15
↓ 6 callers
Method
get_date_and_time
Gets current date and time
models/environment.py:142
↓ 5 callers
Method
get_stock_prices
Gets the current stock price at this epoch
models/state.py:111
↓ 5 callers
Method
to_numpy
Returns the numpy array representing the state object Alias for self.get_state()
models/state.py:284
↓ 4 callers
Method
__init__
( self, inchannel, outchannel, activation=nn.PReLU, )
models/model.py:63
↓ 4 callers
Method
get_stock_prices
Gets the current stock price at this epoch
old_results/original/train.py:178
↓ 4 callers
Method
reset
Resets the environment to a random date in the first 33% of the range with a random amount of positions and random amount of buying p
models/environment.py:114
↓ 4 callers
Method
reset
Resets the environment to a random date in the first 33% of the range with a random amount of positions and random amount of buying
old_results/original/train.py:152
↓ 4 callers
Method
step
Takes action in the current state to get to the next state Returns an array [new_state, reward, done] where: - new_state
models/environment.py:69
↓ 4 callers
Method
step
Takes action in the current state to get to the next state Returns an array [new_state, reward, done] where: - new_state
old_results/original/train.py:81
↓ 3 callers
Method
calculate_portfolio_value
Returns: the current portfolio value
models/state.py:156
↓ 3 callers
Function
get_data
(filename)
utility/graph.py:21
↓ 2 callers
Method
__init__
( self, state_dim, action_dim, max_action, discount=0.99, tau=
old_results/original/model.py:68
↓ 2 callers
Function
append_portfolio_value
(df, env)
main.py:137
↓ 2 callers
Function
append_portfolio_value
(df, env)
old_results/original/train.py:319
↓ 2 callers
Method
calculate_portfolio_value
Calculates the current portfolio value
old_results/original/train.py:200
↓ 2 callers
Method
get_date_and_time
Gets current date and time
old_results/original/train.py:189
↓ 2 callers
Method
get_graph_state
(self, current_date, current_time)
models/state.py:66
↓ 2 callers
Method
get_holdings
Returns: the current holdings
models/environment.py:159
↓ 2 callers
Method
get_state
Returns: the internal array representing the state
models/state.py:292
↓ 2 callers
Method
get_stock_df
(self, stock_name)
models/state.py:80
↓ 2 callers
Method
increment_date
Increments the date by one epoch
models/environment.py:89
↓ 2 callers
Method
increment_date
Increments the date by one epoch
old_results/original/train.py:127
↓ 2 callers
Method
sample
(self, batch_size)
models/model.py:319
↓ 2 callers
Method
sample
(self, batch_size)
old_results/original/model.py:206
↓ 2 callers
Method
select_action
(self, state_tup)
models/model.py:202
↓ 2 callers
Method
select_action
(self, state)
old_results/original/model.py:97
↓ 2 callers
Method
train
(self, replay_buffer, batch_size=100)
old_results/original/model.py:101
↓ 1 callers
Method
Q1
(self, state, action)
models/model.py:163
↓ 1 callers
Method
Q1
(self, state, action)
old_results/original/model.py:58
↓ 1 callers
Method
add
(self, state, action, next_state, reward, done)
models/model.py:310
↓ 1 callers
Method
add
(self, state, action, next_state, reward, done)
old_results/original/model.py:197
↓ 1 callers
Method
advance_state
Advances the state to the next state Parameter remaining_money (int): The buing power in the new state Parameter holdings (in
models/state.py:165
↓ 1 callers
Method
calculate_portfolio_value
Calculates the current portfolio value
models/environment.py:153
↓ 1 callers
Method
calculate_reward
(self, holdings, remaining_money, stock_prices_new, action_is_invalid=False)
models/environment.py:54
↓ 1 callers
Method
calculate_reward
(self, holdings, remaining_money, stock_prices_new)
old_results/original/train.py:73
↓ 1 callers
Function
combine
(portfolio, stock)
utility/graph.py:25
↓ 1 callers
Method
copy
Returns a copy of the internal state
models/state.py:341
↓ 1 callers
Method
get_new_holdings
Returns: the new holdings after performing action in the current state
models/state.py:121
↓ 1 callers
Method
get_new_holdings
Gets the new holdingd after taking action
old_results/original/train.py:112
↓ 1 callers
Function
graph
(portfolio_df=None, filename='test_results.png')
utility/graph.py:67
↓ 1 callers
Method
init_weights
(self)
models/model.py:118
↓ 1 callers
Method
initialize_date
Returns: True if start_date and end_date are in the right format. False otherwise
models/environment.py:165
↓ 1 callers
Method
initialize_date
Returns: True if start_date and end_date are in the right format. False otherwise
old_results/original/train.py:209
↓ 1 callers
Method
initialize_graph
(self)
models/state.py:52
↓ 1 callers
Method
initialize_starting_epoch
Gets the starting epoch of a cycle
models/environment.py:190
↓ 1 callers
Method
initialize_starting_epoch
Gets the starting epoch of a cycle
old_results/original/train.py:234
↓ 1 callers
Method
is_done
Returns: True if the episode is done. False otherwise
models/environment.py:108
↓ 1 callers
Method
is_done
Returns: True if the episode is done. False otherwise
old_results/original/train.py:146
↓ 1 callers
Function
is_greedy
(t)
main.py:23
↓ 1 callers
Method
load
(self, filename)
models/model.py:280
↓ 1 callers
Method
load
(self, filename)
old_results/original/model.py:168
↓ 1 callers
Function
normalize_stock_date
(portfolio, stock)
utility/graph.py:4
↓ 1 callers
Function
plot
(portfolio, filename)
utility/graph.py:58
↓ 1 callers
Method
reset
Resets the state to the initial state
models/state.py:322
↓ 1 callers
Function
run
( stock_names, start_date, end_date, random_start=True, save_location="results/initial_pol
main.py:49
↓ 1 callers
Method
save
(self, filename)
models/model.py:274
↓ 1 callers
Method
save
(self, filename)
old_results/original/model.py:161
↓ 1 callers
Function
select_action
(env, state, policy, t)
main.py:31
↓ 1 callers
Function
test
( stock_names, start_date, end_date, policy, replay_buffer, save_location="results/ini
main.py:147
↓ 1 callers
Method
train
(self, replay_buffer, batch_size=100)
models/model.py:213
Method
__getitem__
Returns: get item of the past state
models/state.py:316
Method
__init__
Initializes the State of the environment Parameter stock_name: the name of the stocks for the state. Precondition: stock_name
models/state.py:14
Method
__init__
Initializes the past state
models/state.py:302
Method
__init__
Initializes the environment. Parameter stock_names: the name of the stocks for this environment. Precondition: stock_names mu
models/environment.py:18
Method
__init__
(self, in_channel, out_channel)
models/model.py:16
Method
__init__
(self, in_channel, out_channel, stride=1)
models/model.py:31
Method
__init__
(self, state_dim, action_dim, max_action)
models/model.py:107
Method
__init__
(self, state_dim, action_dim)
models/model.py:134
Method
__init__
( self, state_dim, action_dim, max_action, discount=0.99, tau=
models/model.py:173
Method
__init__
(self, state_dim, action_dim, max_size=int(1e6))
models/model.py:295
Method
__init__
Initializes the environment. Parameter stock_name: the name of the stock for this environment. Precondition: stock_n
old_results/original/train.py:28
Method
__init__
(self, state_dim, action_dim, max_action)
old_results/original/model.py:17
Method
__init__
(self, state_dim, action_dim)
old_results/original/model.py:33
Method
__init__
(self, state_dim, action_dim, max_size=int(1e6))
old_results/original/model.py:181
Method
__len__
Returns: The length of the state
models/state.py:310
Method
add
Adds the state to the past state queue
models/state.py:331
Method
forward
(self, x)
models/model.py:23
Method
forward
(self, x)
models/model.py:51
Method
forward
(self, X, X_immediate=None)
models/model.py:97
Method
forward
(self, state)
models/model.py:123
Method
forward
(self, state, action)
models/model.py:149
Method
forward
(self, state)
old_results/original/model.py:26
Method
forward
(self, state, action)
old_results/original/model.py:46
Method
get_holdings
Returns: the current holdings
models/state.py:150
Method
get_holdings
Returns: the current holdings
old_results/original/train.py:106
Method
get_indicator_state
Returns: The past 'days' of the indicator state
models/state.py:88
Method
get_indicators
Adds indicators to the dataframe
models/state.py:181
Method
get_outside_environment
(self, stocks)
models/state.py:74
Function
log_info
Logs info to the console and to the logs This function prints the message and saves the message to the log
utility/utils.py:3
Method
reset
Resets the state with the new parameters
models/state.py:273
Function
run
(stock_names, start_date, end_date, random_start=True, save_location="init
old_results/original/train.py:249
Function
test
(stock_names, start_date, end_date, policy, replay_buffer, )
old_results/original/train.py:326