difficulties closing an order

 

I been sending the following request to close a position but it the print_statement keeps returning NONE. what can i do please.

 if pos.ticket == ticket:

            request ={

                'action':mt.TRADE_ACTION_DEAL,

                'position':ticket,

                'type':0,

                'price':tick.ask,

                'symbol':pos.symbol,

                'deviation':50,

                'volume':volume,

                'comment':'your position with the ticket has been closed',

                'type_time':mt.ORDER_TIME_DAY,

                'type_filling':mt.ORDER_FILLING_FOK,

                }

            closed_position = mt.order_send(request)

            print( closed_position )

 
This code won't even compile. If you really want help insert your code in Meta Editor, compile, then fix it.

Then press Styler and then use <\> button to post the whole corrected code because nobody will help you like this.