Errors, bugs, questions - page 2317

 
Evgeniytre:

not saved ((

I'm saving:


 
Greetings all. Actually, when I run some scripts, the terminal gives me this error "216655stringsleft". The search doesn't really describe this problem. As I understand it, it may be due to memory loss. I've attached a simplified version of the script I'm using. The idea of the script is that it should take data from file(s) (file FileWithDATA.txt), convert them according to certain conditions and write them to the final file. This option converts numbers 1 and 2 to 3 and 7 respectively, but produces an error.
Files:
ForTest.mq5  7 kb
FileWithDATA.txt  635 kb
 

How do I delete a pending order on an expired futures?

There are three orders stuck.

When I try to delete it replies - trading is disabled.

 
fxsaber:

Decided to write my own code entirely, rather than edit someone else's.

It seems to be on an equal footing. The first iterations are very different from each other. Then it aligns.

string is an array, and arrays, structure type variables and class objects are always passed by reference.

 

In the example, string is passed without reference.

 
fxsaber:

In the example, the string is passed without reference.

Checked it out, so yes, string is a simple type and can be passed by value, even though it's an array too. It seems)
 

Hello dear MT developers, I want to report an error in the algorithm for calculating the Sharpe Ratio. The attachment contains a report by Mr.Aleksey Vyazmikin where SR=0.29 however according to my calculations it is about 3.7-3.8 (depending on whether zero PnL is considered). I think that the error is in the lack of scaling factor for the standard deviation (sqrt(length)) because the average retour does not depend on the series length, it converges and the RMS increases as sqrt(length)

C++

double SharpRatio(vector<double> pnl)

{

double avret = 0;

for (int i = 0; i < pnl.size(); ++i) avret += pnl[i];

avret /= pnl.size();


double var = 0;

for (int i = 0; i < pnl.size(); ++i) var += pow(pnl[i] - avret, 2);

var = sqrt(var / pnl.size()) / sqrt(pnl.size());


return  avret / var;

}

 
Is the warning here correct?
class CLASSNAME {};

void ChangePointer( const CLASSNAME* &Pointer ) { Pointer = NULL; } // Если const убрать, то предупреждения не будет

void OnStart()
{
  CLASSNAME* Pointers[1]; // = {0};
  
  ChangePointer(Pointers[0]); // possible use of uninitialized variable 'Pointers'
}
 

Hello.

In MT5 Version: 5.00 build 1932 x64 dated 29.10.2018 memory leaks when working with dynamic arrays.

class Test
{
public:
  Test(){}
};

void OnStart()
{
  Test t[];
  ArrayResize(t, 10);
}

ArrayFree does not help in this case, but ArrayResize(t, 0) clears everything.

 

In optimisation mode"Mathematical Computing" agents are given 1 job each, both local and remote, which results in not working fast - the cost of waiting, I guess.

Build 1940.

Added: After speeding up calculations in the code, 2 or 3 tasks are issued, which of course is already good.
Распределенные вычисления в сети MQL5 Cloud Network
Распределенные вычисления в сети MQL5 Cloud Network
  • cloud.mql5.com
Большую часть времени современные компьютеры простаивают и не используют всех возможностей процессора. Мы предлагаем задействовать их с пользой. Вы можете сдавать мощности вашего компьютера другим участникам нашей сети для выполнения разнообразных...
Reason: