Can’t find mistakes in the code most probably the mistake is in the concept
i just ran some statistics and found out the following:
11.6% are exited on the second day due to the index filter switching OFF
these trades caused -15.57% profit
21% of the trades were exited within 4 days from the entry and caused -37.6% profit
using 20/10 for trailing stop didn’t solve the problem