Forum

Retrieve type of position [Python]

Hello, When I make a get_position I have the list of my positions opened, and I have a colum with the "type". Type 0 is a Buy position and Type 1 is a sell position. positions=mt5.positions_get(symbol= "GOLDmicro" ) if positions==None: print( "No position on Gold, error code={}"

[Python] Retrieve type of order from "Get position"

Hello, When I make a get_position I have the list of my positions opened, and I have a colum with the "type". Type 0 is a Buy position and Type 1 is a sell position. positions=mt5.positions_get(symbol= "GOLDmicro" ) if positions==None: print( "Aucune position sur GOLD, code d'erreur={}"

How does the Take Profit works on MT5?

Hello, I would like to understand how the TP works... If I open a request to open a trade like this: request = { "action" : mt5. TRADE_ACTION_DEAL , "symbol" : "GOLDmicro" , "volume" : 0.1 , "type" : mt5. ORDER_TYPE_BUY , "price" : mt5.symbol_info_tick(

Python: Modify the TP of an open trade

Hello, I am stuck right now on my script. I can open an order (see first picture attached) but i can not define a Take profit. I tried with a number (like 2000 for exemple), I tried with a variable etc. Everytime my order is opened but the TP is 0.0 So, I tried to open my trade and to modify the TP

Connexion failed on MT5

Hello, I have a XM account on which I trade every day (with my MetaTrader application linked to my XM account). I created a script with Python to automate some actions. The problem is that when I open my MetaTrader application on my computer and I try to connect my XM account it tells me that login