Help TS MA

 
Hello I have a problem with the TS. the closing of the position, the TS should not open another position until the two moving averages are not touching. How can I do ? Thanks for your help
 
helpmql:
Hello I have a problem with the TS. the closing of the position, the TS should not open another position until the two moving averages are not touching. How can I do ? Thanks for your help

Set a flag and raise it once the order is opened, no more orders can be opened if the flag is raised.

When the two moving averages cross, lower the flag and orders can be placed again.

Reason: