Take profit question

 

Hi!

From what I understand, the take profit is use to automatic close the deal when the price reach to the take profit price. but during strategy testing the deal is not close even the price is raise over x times of the take profit price. All my deal was closed at the end of the strategy testing. Why take profit doesn't help me to close the deal? and I need to manually code it to close the deal when it reach to my take profit price? but how to code??

Many thanks

Reason: