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.2.0.tar.gz
(21.8 kB
view hashes)
Built Distribution
alphagens-0.2.0-py3-none-any.whl
(24.5 kB
view hashes)
Close
Hashes for alphagens-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d755d91453af94c21ca60754f06f37341480cf448345e2053ddccd3b3a52c349 |
|
MD5 | e3e7a7fe4477cae73881302d803c8478 |
|
BLAKE2b-256 | ec50629162adef50a675a2d0c2162e583ec9e2af99a309fb4248ee1c12f9b876 |