Looking at the more detailed log, I can see that exitLong(0,-TP)- where TP is price distance- determines the limit level relative to the current price(!), not TradePriceOpen.
This is not reasonable/practical/expected at all. (while the manual does not explicitly state this detail).