How to close a selected position with a hotkey press

 

Hi, So I created a simple python scrypt that oppen a trade when I press the key "7" on my keyboard. It work well,

Now I want to create a scrypt that close a position when I press the "8" key on my keyboard. But lets say That I have two open trade on my account, one on EURUSD and the second trade on GBPJPY. When I press "8" I want to close the selected pair on my mt5 terminal (See the attached picture to understand) 

Is that possible to do with python ? or I will need to use the mql5 programming language to do that? Thanks you

Files:
 
discord :

Hi, So I created a simple python scrypt that oppen a trade when I press the key "7" on my keyboard. It work well,

Now I want to create a scrypt that close a position when I press the "8" key on my keyboard. But lets say That I have two open trade on my account, one on EURUSD and the second trade on GBPJPY. When I press "8" I want to close the selected pair on my mt5 terminal (See the picture to understand) 

Is that possible to do with python ? or I will need to use the mql5 programming language to do that? Thanks you

The picture must be inserted using the button Imageor can be attached using the button Attach file...

 
Vladimir Karputov #:

The picture must be inserted using the button or can be attached using the button ...

thank you
 
discord # :

You need to work with MQL5.