None
Project description
AlphaGens
An agent-environment based backtesting framework.
quick start
class BuyAndHold(BaseAgent):
def __init__(self, data):
super().__init__(data)
self.i = -1
def take_action(self, state, date):
self.buffer.append(state)
self.i += 1
if self.i == 0:
target_positions = np.array([0.2 for i in range(5)])
return target_positions
else:
return NO_ACTION
while True:
try:
print(f"current date is {env.current_date}")
action = agent.take_action(state, env.current_date)
next_state, reward, truncated, terminated, info = env.step(action)
state = next_state
returns.append(reward)
except IndexError:
break
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
alphagens-0.3.2.tar.gz
(25.9 kB
view hashes)
Built Distribution
alphagens-0.3.2-py3-none-any.whl
(29.7 kB
view hashes)
Close
Hashes for alphagens-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e665fd2226559144e590717a205f3c13313b55143e14266304e4265ab5b94106 |
|
MD5 | a8a868683a712d92cece6455ecf318bb |
|
BLAKE2b-256 | fb77d4b02df7aa8110dbc8962ca761caae0bd7385c5ce3dd4c9ea66f4855c2f2 |