Errors, bugs, questions - page 1065
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
One more thing - I've found a 'useful' trick...
Declare an array, for example, 'int arrTemp[5];'.
Under the debugger all its items equal 0, while during testing they don't.
I spent half a day trying to find out why the connect() function from WinSock library ported from MQL4 does not work.
In mql5 all variables must be initialized explicitly, for example:
There is no default initialization with zeros. This is normal, get used to it.
In mql5 all variables should be initialized explicitly.
There is no default initialization with zeros. This is normal, get used to it.
I don't mind, but it would work in the same way. In the debugger initialization with zeros is automatic.
By the way, and no one faced with the fact that during optimization of EA, terminal can't connect to remote agents accessible via VPN?
I'm trying to use the remote agents on my work computer from home connected to the corporate network via a standard Windows VPN. The agents themselves on my work computer are handling tasks from MQL5 Cloud Network quite well, I can connect to my work computer via RDP terminal from home and the terminal on my home computer can use agents from MQL5 Cloud.
The only thing I can't use is using the agents on my work PC from my home PC. I've even tried to run agents on 443 port on the office PC to bypass (in theory) possible filters/firewalls, but it has not worked. The terminal logs 'connecting to agent...' - and that's all.
Tracert from home to work passes. 'netstat -na' on home computer shows:
i.e. SYN_SENT doesn't go any further.
The only thing that won't work is to get agents on the work computer from the home computer. I've even tried running the agent on port 443 on the work computer to bypass (theoretically) possible filters/firewalls, but it didn't work. The terminal logs 'connecting to agent...' - and that's all.
Tracert from home to work passes. 'netstat -na' on home shows:
I don't mind, but I wish it would work uniformly. Otherwise the debugger initialises with zeros automatically.
Look deeper into the VPN connection settings, the Windows Brandmauer,
It's a shamanism thing...
The firewall on the home computer is disabled altogether.
The terminal on the work computer can use the agents on the home computer, but not the other way around.
I didn't find anything wrong with the VPN connection.
It's a shamanism thing...
The firewall on the home computer is disabled altogether.
The terminal on the work computer can use the agents on the home computer, but not the other way around.
I couldn't find anything wrong with the VPN connection.
In case you have win7, add a rule for incoming/outgoing connections. There's a wizard there, add-ons. In the case of win XP there is also an option to add an exception for a program or port. Haven't used XP in a long time.
Hallelujah!
Finally figured it out...
The thing is, there are 2 MetaTrader 5 instances installed in different directories on my work computer (Win7) (where the agents I want to use).
I don't remember the order of agents' installation/removal, but it turned out that agents are started from the instance N1, and the Inbound Rule in Windows Firewall for "MetaTrader 5 Strategy Tester Agent" was pointing to the EXE piece from the instance N2. I added a rule for instance N1 - everything works.
It would be useful when doing uninstall/install of agents in Agent Manager to update the rule in Windows Firewall.
There is still an unresolved issue. It is about host_name -> IP_address resolution using getaddrinfo() function from WinSock. Can someone build a sample code in MQL5?
It's not really questionable to use IP instead of host name ;-). And using host name is a must in my case.
...
Attention - question: how in MQL5 to get data at this address?
I want to create a function in dll that goes to this address and returns the required data ))
Nope, it doesn't fit.
The Expert Advisor is developed for distributed processing of financial information and I don't want to bother with x86/x64 DLL's. I.e. I need to implement it using MQL5 tools.