Questions from a "dummy" - page 110

 
openlive:
2012.02.26 10:57:51 Tester quality of analyzed history is 100%
2012.02.26 10:57:51 Core 1 EURUSD,H1: testing of experts\pattern10000.ex5 from 2009.12.01 00:00 to 2012.02.10 00:00 started
......

Everything seems to be fine in the logs, but try to look for an error in the Expert Advisor.

On a cursory inspection of the code, for example, I found that the program uses 3 files, but only one is listed in the properties.

  int handle16=FileOpen("signal10000.csv",FILE_WRITE|FILE_CSV,";");
  int handle17=FileOpen("signal10000.dat",FILE_WRITE|FILE_BIN,";"); 

#property tester_file "primer_massivstarihpatternovdlyaraboty.csv"

 

changed the code - now you can see the error

2012.02.26 11:24:56 Core 1 2009.12.01 00:00:00 error = 5004

file opening error - although file is in C:\ProgramData\MetaQuotes\Terminal\Common\Files and #property tester_file "primer_massivstarihpatternovdlyaraboty.csv" and FILE_COMMON flag is checked

Files:
 

Hello! I am writinga simplemulticurrency indicator to display 2 instruments (currency pairs) on the same chart. Tell me which function to use to select and process the data for drawing for a given symbol. If you have a small example will be very grateful. Thank you!

Now my current chart's naked algorithm looks like this

int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[])

{
int i=0;
bool vol=true;

if(i<prev_calculated) i=prev_calculated-1;

while(i<rates_total && !IsStopped())
{
ExtCloseBuffer[i]=close[i];
if(i>0)
{
if(close[i]>close[i-1]) vol=true;
if(close[i]<close[i-1]) vol=false;
}

i++;
}
return(rates_total);
}

Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
  • 2010.05.17
  • Alexey Klenov
  • www.mql5.com
В последнее время возрос интерес к кластерному анализу рынка FOREX. MQL5 открывает новые возможности исследования закономерностей движения валютных пар. Важным преимуществом MQL5, по сравнению с MQL4, является возможность использования неограниченного количества индикаторных буферов. В данной статье описан пример построения мультивалютного индикатора.
 
openlive:

changed the code - now you can see the error

2012.02.26 11:24:56 Core 1 2009.12.01 00:00:00 error = 5004

file opening error - although file is in C:\ProgramData\MetaQuotes\Terminal\Common\Files and #property tester_file "primer_massivstarihpatternovdlyaraboty.csv" and FILE_COMMON flag is checked

If no reply tomorrow, contact Service Desk with file attachment. They should be able to tell you.
 
kandallov:

Hello! I am writinga simplemulticurrency indicator to display 2 instruments (currency pairs) on the same chart. Tell me which function to use to select and process the data for drawing for a given instrument. If you have a small example will be very grateful. Thank you!

Now my algorithm for displaying the current chart looks like this

...

You can receive data through MqlRates structure or separately for each time series in MQL5 Reference / Access to Time Series and Indicators

It is better to use MqlRates, because it stores data about bar time (it's important, because bars for different instruments are unsynchronized), but it is more economical to use timeseries.

But the main problem of multicurrency Expert Advisors is the differences in synchronization - not every bar requested according to the index in one symbol corresponds to the same index in another symbol. And the farther into the forest the thicker the partisans, the shift in indexes accumulates.

Again we will have to solve the problem of different length of arrays (because different amount of data on different tools).

And the third problem, not every bar on the chart indicator can be shown (for example, there is no bar for a native symbol, but for others, where to put it?)

These are the problems we are faced with.

 
openlive:

Looked at it, put the file in Mql5\Tester\Files

but the tester just stands still.


The #property tester_file property is intended to avoid putting anything anywhere by hand .

tester_file

string

File name for the tester, specifying its extension, enclosed in double quotes (as a constant string). The specified file will be passed to the tester for work. Input files for testing, if needed, should always be specified


If some datafile .csv file is required for the program operation, and it is located in terminal_directory\MQL5\Files, the file will be automatically moved by the tester tothe testing_agent\MQL5\Files directory (the #property tester_file datafile.csv must be specified for this purpose).

 
openlive:

changed the code - now the error is visible

2012.02.26 11:24:56 Core 1 2009.12.01 00:00:00 error = 5004

file opening error - although file is in C:\ProgramData\MetaQuotes\Terminal\Common\Files and #property tester_file "primer_massivstarihpatternovdlyaraboty.csv" and FILE_COMMON flag is checked

The error is visible, but it is not clear to which file

#property tester_file "primer_massivstarihpatternovdlyaraboty.csv"
//#property tester_file "signal10000.csv"
//#property tester_file "signal10000.csv"

Why in properties commented out other files? And by the way there is an error: the same extension, although the text is one of them "signal10000.dat".

I don't have your files, so check it yourself.

 

Now, how do we find this unfortunate folder, the_agent_testing_directory\MQL5\Files? Starting with Windows Vista, the security system and security policy have become much more complex and can confuse anyone. The easiest way to find this folder is to ask the tester, he knows exactly where the test agents are located. In the Tester Log at the end of a test, the path to the tester's logs is always written, for example:

2012.02.26 16:31:09     Core 1  connection closed
2012.02.26 16:31:09     Core 1  log file "C:\Program Files\MetaTrader 5 Alpari\Tester\Agent-127.0.0.1-3000\logs\20120226.log" written
2012.02.26 16:31:09     Core 1  EURUSD,H1: 1105951 ticks (4663 bars) generated within 3796 ms (total bars in history 10867, total time 3844 ms)
2012.02.26 16:31:09     Core 1  OnTester result 0

So the testing agent folder is here - C:\Program Files\MetaTrader 5 Alpari\Tester\Agent-127.0.0.1-3000\logs\20120226.log.

 
MetaDriver:

You can't do it head-on. You can't. MetaQuotes Software Corp. is against it. // I think it's wrong, but they might know better.

There is one rather time consuming option - to use math mode. If it's not too much trouble, give it a try.

What is "math mode"?
 
Rosh:

Now, how do we find this unfortunate folder, the_agent_testing_directory\MQL5\Files? Starting with Windows Vista, the security system and security policy have become much more complex and can confuse anyone. The easiest way to find this folder is to ask the tester, he knows exactly where the test agents are located. The path to the tester logs is always written in the Tester Log at the end of the test, for example:

So, testing agent folder is located here - C:\Program Files\MetaTrader 5 Alpari\Tester\Agent-127.0.0.1-3000\logs\20120226.log.

now gives out

2012.02.26 15:47:46 Tester file C:\Users\openlive\AppData\Roaming\MetaQuotes\Terminal\9C3619DDD286B60B1DB9B989A2FFC701\MQL5\Files\signal10000.csv open error [32]