Create file when position on meta trader is opened or closed

 
Hey, any ideas how to set creating new file each time position is opened or closed ? For example with lot size and direction in name.
 
Use onTradeTransaction event handler to trigger a function that creates your desired file per each deal in and deal out.
Reason: