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.5.tar.gz
(30.7 kB
view hashes)
Built Distribution
alphagens-0.3.5-py3-none-any.whl
(37.7 kB
view hashes)
Close
Hashes for alphagens-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d72a4afbfe37b19dad0f85eb3ff6096d01f5d88285d75bd704364a1d791b920 |
|
MD5 | 240893fe3c493add9e74378259037dfb |
|
BLAKE2b-256 | 71e786fff039933c46ca3fbf8d4a8c1bf79aeb4babe197731af03005614e7972 |