Errors, bugs, questions - page 2124

 
Relevant

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2018.02.07 15:48

To summarise the question. What is the point of CAccountInfo, COrderInfo, CSymbolInfo, CPositionInfo and CTerminalInfo?

Looked at their source code. What is the good of using them?


CDealInfo and CHistoryOrderInfo - these are also written with logical errors. What is the purpose of using them?


Well, we have CTrade. Everything is clear with it; it can be useful where and so on. But what about Info-classes?

Forum on trading, automated trading systems and strategy testing

Errors, bugs, questions

fxsaber, 2018.02.07 15:53

Almost all methods in Info-classes should be static. What is the reason why it is not?
 
That's a cool trick!
2018.02.08 10:59:53.209 Network '8491779': no connection to MetaQuotes-Demo
2018.02.08 10:59:53.329 Network '8491779': authorization on MetaQuotes-Demo failed (Invalid account)
2018.02.08 10:59:53.904 Network current demo account '8491779' was deleted on trade server, new demo will be allocated
2018.02.08 10:59:53.904 Network demo account '8782677' was allocated on MetaQuotes-Demo


Only I had a Netting account and created Hedge. Could you recreate the account with the same settings?

 
Comments not relevant to this topic have been moved to "Off-topic".
 
fxsaber:
That's a cool trick!


Only I had a Netting account and created Hedge. Could you recreate the account with the same settings?

They won't see your message here - you have to write to Service Desk. Don't know if it can be restored

 
Rashid Umarov:

Your message will not be seen here - you have to write to Service Desk. I don't know if it can be restored

I have an obscene number of applications in the SR. Created another one, but it's not critical though.

 

Error 4109 does not disappear over time

Expert test code

//Test1.mq5
void OnInit() { if ( f() != ERR_SUCCESS ) EventSetTimer( 10 ); }
void OnTimer()
{
        int   last_error = f();
        if (  last_error == ERR_SUCCESS ) EventKillTimer();
static int count = 1;
        Print( "Повтор (", count++, ")… результат: ", last_error );
}
int f( long value=-1 ) { return ChartGetInteger(0,CHART_FIRST_VISIBLE_BAR,0,value) ? ERR_SUCCESS : GetLastError(); }

When launching the terminal, the following result is returned in some cases (*): Error 4109 does not disappear at all

2018.02.09 00:25:24.200 Test1 (ETHUSD,W1) Repeat (1)... result: 0
2018.02.09 00:25:24.204 Test1 (EURUSD,D1) Repeat (1)... result: 0
2018.02.09 00:25:24.204 Test1 (BTCUSD,M15) Repeat (1)... result: 4109
2018.02.09 00:25:24.204 Test1 (BTCUSD,H1) Repeat (1)... result: 4109
2018.02.09 00:25:24.205 Test1 (ZECUSD,D1) Repeat (1)... result: 0
2018.02.09 00:25:24.205 Test1 (BTCUSD,M15) Repeat (1)... result: 0
2018.02.09 00:25:24.343 Test1 (BTCUSD,D1) Repeat (1)... result: 4109
2018.02.09 00:25:24.439 Test1 (BTCUSD,W1) Repeat (1)... result: 4109
2018.02.09 00:25:34.195 Test1 (BTCUSD,H1) Repeat (2)... result: 4109
2018.02.09 00:25:34.195 Test1 (BTCUSD,M15) Repeat (2)... result: 4109
2018.02.09 00:25:34.348 Test1 (BTCUSD,D1) Repeat (2)... result: 4109
2018.02.09 00:25:34.444 Test1 (BTCUSD,W1) Repeat (2)... result: 4109
2018.02.09 00:25:44.203 Test1 (BTCUSD,M15) Repeat (3)... result: 4109
2018.02.09 00:25:44.204 Test1 (BTCUSD,H1) Repeat (3)... result: 4109
2018.02.09 00:25:44.367 Test1 (BTCUSD,D1) Repeat (3)... result: 4109
2018.02.09 00:25:44.452 Test1 (BTCUSD,W1) Repeat (3)... result: 4109
2018.02.09 00:25:54.214 Test1 (BTCUSD,M15) Repeat (4)... result: 4109
2018.02.09 00:25:54.214 Test1 (BTCUSD,H1) Repeat (4)... result: 4109
2018.02.09 00:25:54.381 Test1 (BTCUSD,D1) Repeat (4)... result: 4109
2018.02.09 00:25:54.467 Test1 (BTCUSD,W1) Repeat (4)... result: 4109
2018.02.09 00:26:04.221 Test1 (BTCUSD,M15) Repeat (5)... result: 4109
2018.02.09 00:26:04.221 Test1 (BTCUSD,H1) Repeat (5)... result: 4109
2018.02.09 00:26:04.395 Test1 (BTCUSD,D1) Repeat (5)... result: 4109
2018.02.09 00:26:04.459 Test1 (BTCUSD,W1) Repeat (5)... result: 4109
2018.02.09 00:26:14.247 Test1 (BTCUSD,M15) Repeat (6)... result: 4109
2018.02.09 00:26:14.247 Test1 (BTCUSD,H1) Repeat (6)... result: 4109
2018.02.09 00:26:14.402 Test1 (BTCUSD,D1) Repeat (6)... result: 4109
2018.02.09 00:26:14.464 Test1 (BTCUSD,W1) Repeat (6)... result: 4109
2018.02.09 00:26:24.265 Test1 (BTCUSD,M15) Repeat (7)... result: 4109
2018.02.09 00:26:24.267 Test1 (BTCUSD,H1) Repeat (7)... result: 4109
2018.02.09 00:26:24.399 Test1 (BTCUSD,D1) Repeat (7)... result: 4109
2018.02.09 00:26:24.468 Test1 (BTCUSD,W1) Repeat (7)... result: 4109 etc. to infinity

But in many cases, the result is quite good (**): The error disappears at the 2nd iteration

2018.02.09 00:29:45.470 Test1 (BTCUSD,D1) Repeat (1)... result: 0
2018.02.09 00:30:14.215 Test1 (BTCUSD,M15) Repeat (1)... result: 4109
2018.02.09 00:30:14.215 Test1 (BTCUSD,D1) Repeat (1)... result: 0
2018.02.09 00:30:24.209 Test1 (BTCUSD,M15) Repeat (2)... result: 0

But it disappeared only in a simple test example, the error in a real Expert Advisor will not change anything even if you make a delay with EventSetTimer( 100 ). The error may disappear if you select the corresponding tab of the problematic chart and click on it (why does it have an effect???), for example, selecting BTCUSD,W1 and clicking on it will give a successful result at the next iteration:

Test1 (BTCUSD,W1) Repeat (8)... result: 0

The test profile looked like this:


Max bars in window 100000.

To get a result (*), it is usually enough to add a couple of new charts with attached Expert Advisor to a profile and restart the terminal

Запуск платформы - Для продвинутых пользователей - MetaTrader 5
Запуск платформы - Для продвинутых пользователей - MetaTrader 5
  • www.metatrader5.com
По завершении установки в меню "Пуск" создается группа программ торговой платформы, а на рабочем столе дополнительно помещается ярлык программы. Используйте их для запуска. Нельзя запускать одновременно две копии платформы из одной директории. Чтобы одновременно запустить несколько копий, установите соответствующее количество программ в разные...
 

Hi all!

Has anyone wondered : how to get a list of external variables inside the EA? so as not to enumerate them repeatedly in the array? i.e. when you install it on a chart, the EA reads itself and looks at its external settings.

only through a template?

 

Build 1755 MT5

When using ROBOTO font and size 9 - half of the text is not drawn.


at size 8 - no problem at all.


Arial is less, but the font is horrible.

 

Duplicate transactions when using a third-party UPU

Session problem. When previous one was not closed and a new one is opened. old terminal works and new terminal works. get duplicate. :-)

@fxsaber somewhere you wrote about how to track this. can't find

 
Vladislav Andruschenko:

Hi all!

Has anyone wondered : how to get a list of external variables inside the EA? so as not to enumerate them repeatedly in the array? i.e. when you install it on a chart, the EA reads itself and looks at its external settings.

Only through a template?

Yes, using the template.

#include <fxsaber\Expert.mqh> // https://www.mql5.com/ru/code/19003

input string Input1 = "Hello World!";
input int Input2 = 123;

string GetExpertData( const ulong Chart = 0 ) 
{ 
  string Str = NULL; 

  MqlParam Parameters[]; 
  string Names[]; 

  if (EXPERT::Parameters(Chart, Parameters, Names)) 
  { 
    Str += "\n" + ChartSymbol(Chart) + " " + EnumToString(ChartPeriod(Chart)) + " " + Parameters[0].string_value + "\n"; 

    const int Amount = ArraySize(Names); 

    for (int i = 0; i < Amount; i++) 
      Str += (string)i + ": "+ Names[i] + " = " + Parameters[i + 1].string_value + "\n"; 
  } 

  return(Str); 
}

void OnInit()
{
  Print(GetExpertData());
}


The result is

0: Input1 = Hello World!
1: Input2 = 123


or as follows

#include <fxsaber\Expert.mqh> // https://www.mql5.com/ru/code/19003

input string Input1 = "Hello World!";
input int Input2 = 123;

void OnInit()
{
  MqlParam Parameters[];
  string Names[];   
  
  if (EXPERT::Parameters(0, Parameters, Names))
    ArrayPrint(Parameters);
}


Result

    [type] [integer_value] [double_value]      [string_value]
[0]    ...               0        0.00000 "Experts\Test2.ex5"
[1]    ...               0        0.00000 "Hello World!"     
[2]    ...             123      123.00000 "123"