Closed davide97l closed 2 years ago
Both start_position
and end_position
are in [-1, 0, 1]. The idea is that if you go from long to short or vice versa, there are 2 trades, if no change then no trades, else 1 trade. You may be concerned about the sign but the cost is based on abs(n_trades)
. Does this make sense?
Closing for now, please let me know if you have further questions.
Hi, I couldn't understand why here: https://github.com/stefan-jansen/machine-learning-for-trading/blob/main/22_deep_reinforcement_learning/trading_env.py#L171, n_trades is computed as
n_trades = end_position - start_position
. I would really appreciate it if you can clarify. Thank you in advance!