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.1.0.tar.gz
(20.6 kB
view hashes)
Built Distribution
alphagens-0.1.0-py3-none-any.whl
(22.9 kB
view hashes)
Close
Hashes for alphagens-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21963dad78d0cbb377e06597f96f8af531d9350ccb16981967b5346f7e956624 |
|
MD5 | 968790ea70ecab25a74068344cade65a |
|
BLAKE2b-256 | 2501b537fb39e977e7b1b62e4e523e175f082ba67dad0d307c88641f716a747c |