Forum

Why is this simple Python code not working?

if mt5.initialize(path=path, login=login, password=password, server=server, timeout=timeout, portable=portable):
 print ( "Initialization successful" )

 request = {
 "action" : mt5. TRADE_ACTION_DEAL ,
 "symbol" : "6S_M" ,
 "volume" : 3 ,
 "type" :mt5. ORDER_TYPE_SELL ,
 "sl"

Why can't I connect to my MT5 via python?

import MetaTrader5 as mt5 

 # display data on the MetaTrader 5 package 
print( "MetaTrader5 package author: " , mt5.__author__)
 print( "MetaTrader5 package version: " , mt5.__version__)

 # establish connection to the MetaTrader 5 terminal 
 if not mt5.initialize(path= "C:\\Program Files\\FTMO

Help needed with invalid stops

It works when I use case #2 but any of the other cases it gives me error invalid stops . Any suggestions? // ---- Open Buy Orders bool OpenBuy( int mode, int orders) { string error_desc = "" ; double BuyPrice = 0 , BuyStop = 0 , BuyProfit = 0 , Stop, Profit, maxloss = 0 ;

Static VPS IP banned somehow

Never happened before. Cannot access market from platform. Also cannot access MQL5 from server browser either. This IP address is static, provided by VPS company. Im writing this message from home computer. I can login to mql5 with home computer with no issues. IP address from VPS is the problem