what is the problem with my trades on daily charts, which could last 23 hours and ending on the same bar?
problem are short trades so with low value of "time in trade" and this could be trades starting on one candle and ending in another - so this check will not catch it
It is also not related to time, but bars in trade.
If your trade ends in the same bar it is counted. If it ends in the next bar (next day for D1, even if it lasts only for 2 hours) it is not counted.
The current threshold is 10%, if you have more than 10% trades that end in the same bar.
I think you simply shouldn't trade daily strategies that close trades at the same day when they were opened, this is a check for that.