momentum added to mql5 code and now no longer entering trades when backtesting

 
good afternoon everyone, as you can see from the subject i had a working EA and added momentum to it which now seems to be blocking entries. i have attached my code, any advise is greatly appreciated.
 
John James Holmes:

Traders and coders are working for free:

  • if it is interesting for them personally, or
  • if it is interesting for many members on this forum.

Freelance section of the forum should be used in most of the cases.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2025.05.26
  • www.mql5.com
The largest freelance service with MQL5 application developers