Errors, bugs, questions - page 295

 
Voodoo_King:


And then... in software development, it is considered a good tone to have no crash screens.


And that's what we're dealing with.

 
stringo:
You have to reproduce the error to fix it. I would like to see your agents logs. It would be good if you could send your expert. And describe the input testing parameters.

It must be the minute timeframe instead of the other selections when"every tick" is on.

I just have minute timeframe everywhere and everything seems ok.

P.S. I wrote above.

 

If the FILE_SHARE_READ flag is an open flag and not the open flag itself, why does the file open anyway?

2011.02.07 18:18:14    Лист18 (EURUSD,H1)    Файл открыт с флагом FILE_SHARE_READ нормально Templates\Example.txt
2011.02.07 18:18:14    Лист18 (EURUSD,H1)    SHARE_READ  
void SHARE_ReadFile()
  {
   string subfolder="Templates";
   int han=FileOpen(subfolder+"\\"+folder+".txt",FILE_SHARE_READ|FILE_TXT|FILE_ANSI,"\r");
   if(han!=INVALID_HANDLE)
     {
      Print("SHARE_READ  ",FileReadString(han));           

      Print("Файл открыт с флагом FILE_SHARE_READ нормально "+subfolder+"\\"+folder+".txt"); 
      FileClose(han);
     }
   else
     {
      Print("Ошибка открытия файла с флагом FILE_SHARE_READ "+subfolder+"\\"+folder+".txt, error",GetLastError());
     }
  }

It seems to me that the result should be a file opening error.

And in fact it is, because nothing is printed, but checking the handle shows that the file is open.

 
mql5:
The picture is added to EX5 resource by
#resource "<path to file relative to folder MQl5\Images>".

Example

#resource "res\\test.bmp";

Is everything in place? I'm looking for path if #resource in EA's file, relative to EA's source directory.

cannot open resource file 'C:\Program Files\MetaTrader 5 DEV\MQL5\Experts\myexpert\res\\test.bmp' (3) 0 0

If #resource is in the file of the injection, everything goes in one place and gets into folders of other inludes.

cannot open resource file 'C:\Program Files\MetaTrader 5 DEV\MQL5\include\Arrays\res\test.bmp' (3) 0 0

The next variant searches from the "root" of MQL5

#resource "\\res\\test.bmp";

cannot open resource file 'C:\Program Files\MetaTrader 5 DEV\MQL5\res\test.bmp' (3) 0 0

I also see that things that used to work do not work either (the file lying in MQL5/Images/res/test.bmp).

ObjectSetString(0,pname,OBJPROP_BMPFILE,0,"\\res\\test.bmp");

Did I miss something?

 
Vigor:

Example

Is everything in place? I'm looking for path if #resource in EA's file, relative to EA's source directory.

cannot open resource file 'C:\Program Files\MetaTrader 5 DEV\MQL5\Experts\myexpert\res\\test.bmp' (3) 0 0

If #resource is in the_include file, everything goes in one place and gets into folders of other inludes.

cannot open resource file 'C:\Program Files\MetaTrader 5 DEV\MQL5\include\Arrays\res\test.bmp' (3) 0 0

The next variant searches from the "root" of MQL5

cannot open resource file 'C:\Program Files\MetaTrader 5 DEV\MQL5\res\test.bmp' (3) 0 0

I have also noticed that something that used to work does not work either (file is MQL5/Images/res/test.bmp).

Did I miss something?



I think it should be

MetaTrader 5 Client Terminal build 384

  1. Terminal: Added wizard for adding remote testing agents. In addition to manual input and import from *.mt5 file, added possibility to scan a local network for finding a working agent.
  2. MQL5: Added possibility to store resources in *.ex5 files. To add a resource to *.ex5, use the #resource directive specifying the path to the file relative to the MQL5\Images directory of the client terminal. For example:#resource myexpert\button.bmp
    Files in the resource can be referred to by a string like: "script_name::resource_name". The file name (without an extension) passed in the #resource directive is used as the resource name.
If understood correctly, the files can be located here - MQL5\Images\Directory name/file name.
 
Interesting:

It looks like this

MetaTrader 5 Client Terminal build 384

relative to the MQL5\Images directory of the client terminal. For example:#resource myexpert\button.bmp

This is relative and does not work. and without quotes. and backslash is double.
 
Vigor:
This is relative and it doesn't work. and you can't do it without quotes. and backslash is double.

Let's check it out.

That's how #resource "\\Images\\\\Phoenix\\Logo.bmp" seems to work;

Although it looks strange (according to the idea, it should search relatively for MQL5\Images, i.e. at least it should look like this - #resource "\\\\Phoenix\\\Logo.bmp").

Either make it relative to the Images directory or correct the release description (to make everything logical and understandable)...

 
I've provided an example of MQL5 folder in the comments. By the way, I've got the log messages there and it clearly shows WHERE the compiler searches for files.

And, as I wrote, OBJPROP_BMPFILE with relative path from the Images folder doesn't work either. In general, according to the latest experiments, everything works when the full path is specified starting from \ from MQL5.

The question was whether this innovation is valid? Or is it a temporary phenomenon?

 
Vigor:
I had an example in my comment about MQL5 folder. By the way, I have log messages there and it clearly shows WHERE the compiler searches for files.

But it looks everywhere but not where it's supposed to :(
 

Hello !

Code:

if (NormalizeDouble(Prices_Flow[0].Price_Position,4) != 0)
{
double Position_In_Percentage = Prices_Flow[0].Indicator_Position * 100 / Prices_Flow[0].Price_Position;
//further code irrelevant to the question
}


When testing in the Strategy Tester at the same time on one of the tools the division by zero occurs (2011.02.08 01:40:23 Core 2 2010.08.02 00:00:00 Zero divide in 'almirlib.mqh' (535,102))

How with the above code is this possible ?

Reason: