Errors, bugs, questions - page 363

 

Where do SymbolsTotal() and SymbolName() take the information from in the tester? I have a mismatch between the i-th symbol in the terminal and the tester.

If in the terminal the 3rd USDJPY then in the tester the 3rd EURGBP.

I am just doing a enumeration of MarketWatch symbols and coding them into Expert Advisor by serial numbers.

 

Good afternoon!

I have a question about theIndicatorSetStringfunction in which you can specify a short name for the indicator, referring to which this indicator can be subsequently removed from the chart.

I think this is a strange situation.

On the office PC this procedure goes well, but on the other, home PC the value of its short name is set automatically in the beginning (that is, without taking into account the input parameters, which I use to form a new name), and the new name appears only after detaching the indicator and its reloading.

The first thing that came to mind was the differences in the software, but after comparing, I realised that everything is basic, identical:

- Expert and indicator codes;

- software version (Build 425);

- OS (WinXP SP3);

- the same settings (specially compared).

In general, the check is as follows:

1. Several buttons are displayed on the screen, each of them has a short and a general name of an indicator

2. When you press the button, the indicator corresponding to it by its common name appears, and when you release it, it is deleted based on the short name.

3. on the office PC the indicators are deleted from the first press, whereas on the home PC only from the second press.

What might be the possible reason for this?

If schematically, excluding the usual things for experts and indicators, as well as other functionalities that are not directly related to the mentioned question, it looks as follows:

1. In indicator My_Indicator:

   input double  Offset  = 0;
   int OnInit()  
   {  
      string NewNameIndicator = OldNameIndicator + Offset;
      IndicatorSetString (INDICATOR_SHORTNAME, NewNameIndicator);
   }

2. In EA:

   void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
   {  
        String ShortNameIndicator1;
        //---При нажатии            
        if (sparam==My_Button1.Name()){
            if(My_Button1.State()==true){
                Int handle = iCustom (_Symbol,_Period, "My_Indicator1 ", "FirstParameter");
                ChartIndicatorAdd(0,0,handle);
                ShortNameIndicator1 = ChartIndicatorName(0,0,ChartIndicatorsTotal(0,0)-1);
                 Alert (“State()=true, IndicatorName()=”,   ShortNameIndicator1);
             }
        }
         //---При отжатии
        if (sparam==My_Button1.Name()){
           if(My_Button1.State()==false){
                  Alert (“State()=false, IndicatorName()=”,   ShortNameIndicator1);
                  ChartIndicatorDelete(0,0,ShortNameIndicator1);  
           }
        }
    }

As a result:

On the office PC,IndicatorName is output as a new name from the first pass, whereas on the home PC only from the second pass.

On the office PC, the IndicatorName is deleted after the first press, while on the home PC it is deleted after the second press.

At the same time, after the first press and release on the home PC the original indicator name (My_Indicator without adding the input parameter to the name) is displayed, though the code of the Expert Advisor and indicator, I repeat, is used in both cases the same.

 

To quote my message to servicedesk here


Версия и битность терминала



MetaEditor 5.00 build 425. Windows 7 ultimate, build 7600.

Описание проблемы

При создании файла скрипта с кодом

void OnStart()
{
}


Attempt to compile leads to error internal error #108

after downloading the latest terminal version and reinstalling it in the same folder, the error has changed to internal error #-3

The sequence of actions
I do not know if it is related to the error, but it started appearing right after I updated MQL5 help files using the corresponding automatic MetaEditor procedure.

The expected result


normal compilation of the script))


The problem disappeared today after an anti-virus cleanup of the computer.

The malware seems to be new, as it was not detected by any of the known antiviruses. The external manifestations were as follows:

  • The presence of a file with a meaningless name and .dat extension in the folder c:\Windows\AppPatch. The file header shows that it is executable, the original name is dd.exe, and the fields "product name" and "copyright" are meaningless sets of capital letters.
  • presence of a modified Userinit entry in the HKLM\Software\Microsoft\Windows NT\Winlogon registry key with the path to the above mentioned file. When the entry is deleted, the latter tends to recreate itself unnoticed if the virus is still in memory.
  • occasional running of several copies of conhost.exe and route.exe processes, and sometimes netsh.exe
  • glitches with MetaEditor 5)) - Metaquotes editor was a pretty good malware detector in addition to all its features)

Cleaned everything in safe mode.

Yes, it was scratched Webmoney local account, but identification data have not disappeared)))).

I recommend everyone to check manually.

 
Urain:

Where do SymbolsTotal() and SymbolName() take the information from in the tester? I have a mismatch between the i-th symbol in the terminal and the tester.

If in the terminal the 3rd USDJPY then in the tester the 3rd EURGBP.

I am just doing a enumeration of MarketWatch symbols and coding them into Expert Advisor by serial numbers.

You cannot rely on the order of symbols in MarketWatch, because it can be any by definition.
 

Files:
Test_X.mq5  1 kb
MyMQL4.mqh  5 kb
 
EvgeTrofi:

what is it?

looks like enum enum_TYPE_MARKET_INFO, in numerical form.

I have the same thing. report it to the SD.

 
Renat:
The order of characters in the marketwatch cannot be based on, because it can be any order by definition.

It's not about the order of symbols or the number of symbols, but the order and number are different in the terminal and the tester at the same time.

I solved the problem by passing the symbol list to the tester through a file. Although sincerely believe that this is a bug.

 
Urain:

It's not about the order of symbols or the number of symbols, but the order and number of symbols at the same time are different in the terminal and in the tester.

In general, I solved the problem by passing the character set to the tester through a file. Although I honestly think it's a bug.

I don't really understand the problem...

And if the user changes the order of characters in the Marketwatch while working, will it also be a bug?

 
AlexSTAL:

I don't really understand the problem...

If the user changes the order of the characters in Marketwatch while it's running, would that also be a bug?

When the tester is running? It is unlikely, after the start of the tester it runs standalone, but in the pre-start mode it is expected that the symbols should match (those between tests of Expert Advisors, for example when changing an EA or when changing a symbol or period, and any change in the tester settings should lead to a symbol match, imho).
 
Urain:

It's not about the order of characters or the number of characters, but the order and number are different in the terminal and the tester at the same time.

In general, I solved the problem by passing a list of characters in the tester through a file. Although sincerely believe that this is a bug.

The symbol database (market watch) is asynchronously and randomly updated from the server. You can not rely on its order in any case.

Tester is a separate program, often remote. In the tester, the symbol base is not completely transferred, and only those symbols that are used in calculations - this is done to save resources. Therefore, the order of symbols (added to the list of active symbols in the tester) is different.

Use symbol names in parameters - this is a more secure option.