Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to print the number of long and short trade when an episode is finished? #6

Open
greg2paris opened this issue Apr 13, 2019 · 0 comments

Comments

@greg2paris
Copy link

greg2paris commented Apr 13, 2019

Hi, thank you again for your work.
I have tried to put the number of trades inside the episode_finished function, but i cant find a good solution to do it. This is what I tried :

def episode_finished(r):
    reward = "%.6f" % (r.episode_rewards[-1])
    print("Finished episode {ep} of {totalep} after {ts} timesteps (reward: {reward})".format(ep=r.episode, ts=r.episode_timestep,
                                                                                 reward=reward, totalep=episodes_number))
    #print("with {l} long position and {s} short".format(l=long, s=short))
    #print("with {l} long position and short".format(l=n_long))
    #print("info:", info)
    
    if np.mean(r.episode_rewards[-1]) > 0 :
        r.agent.save_model(SAVE_DIR, append_timestep=False)
    return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant