Data Science, Reinforcement Learning, Q Learning, S P 500 Index, Finance.
0.1 MAX_REWARD = 10 DISCOUNT_FACTOR = 0.05 return LEARNING_RATE * (reward + DISCOUNT_FACTOR * MAX_REWARD - policy.loc[current_state_value, action]) past_state_value = (0, 0) past_action = 'buy_buy' total_reward = 0 rewards = [] for idx, row in df.iterrows(): current_state_value =