Moment on what margin turns to be free

 

Very specific and sensitive question I have. 

On what moment is considered margin used to cover trade is free allready:

1) on moment order to close trade is sent (despite still not filled);

2) on moment order to close trade is filled;

3) something else.

I'm  about MT5 platform.

 
Any platform transaction needs margin, there is no free.