Errors, bugs, questions - page 1065

 
vlad_123:

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:

int arrTemp[5] = {0};  // допускается такая сокращённая форма, вместо {0,0,0,0,0}

There is no default initialization with zeros. This is normal, get used to it.

 
I happen to find that in both MT4 and MT5 on the weekly charts the bars are dated starting on a Sunday. Is it the pro-western style? If so, what's the point if weekly sessions all over the world open on Monday anyway?
 
MetaDriver:

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:

TCP    10.6.XXX.XXX:1744       10.6.YYY.YYY:2000       SYN_SENT

i.e. SYN_SENT doesn't go any further.

Распределенные вычисления в сети MQL5 Cloud Network
Распределенные вычисления в сети MQL5 Cloud Network
  • cloud.mql5.com
Заработать деньги, продавая мощности своего компьютера для сети распределенных вычислений MQL5 Cloud Network
 
vlad_123:

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:

look deeper into the VPN connection settings, the windward brandmauer,
 
vlad_123:

I don't mind, but I wish it would work uniformly. Otherwise the debugger initialises with zeros automatically.

And yes, there is such a letter. I don't know why, but there is. Sometimes it helps, sometimes it interferes with finding the goodies.
 
micle:
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.

 
vlad_123:

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 inbound/outbound 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.
 
micle:
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.

 
vlad_123:
...

Attention - question: how in MQL5 to get data at this address?

make a function in dll that goes to this address and returns the required data ))
 
kazakov.v:
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.