Errors, bugs, questions - page 1655

 
coderex:
maybe it's the structure constructor? it's there anyway
Why so unsure? Of course it is :)
 
Andrey Barinov:
Why so unsure? Of course it is :)
I'm not so sure because I don't know what to expect, I updated the terminal to 1395 and now I don't know how to roll back to 1375 because the robot stopped doing what it was supposed to do...
 
Andrey Barinov:
Why so unsure? Of course it is :)
OK, where's the destructor?
 
Vladimir Pastushak:
OK, where is the destructor?
Most importantly, where is everything else?
 

The offline tester does not return to its initial state after pressing "Start" - the "Stop" button is permanently lit. This happens when the test interval goes beyond the available history.

2016.08.28 10:19:48     Core 1  RTS-9.16: read container failed
2016.08.28 10:19:48     Core 1  RTS-9.16: ticks synchronization started
2016.08.28 10:19:48     Core 1  RTS-9.16: history synchronized from 2015.06.22 to 2016.08.25
2016.08.28 10:19:48     Core 1  RTS-9.16: load 2651 bytes of history data to synchronize in 0:00:00.016
2016.08.28 10:19:48     Core 1  RTS-9.16: symbol synchronized, 3224 bytes of symbol info received
2016.08.28 10:19:48     Core 1  RTS-9.16: symbol to be synchronized
....
2016.08.28 10:19:41     Tester  RTS-9.16,M1 (BCS-MetaTrader5): testing of Experts\Test.ex5 from 2016.08.01 00:00 to 2016.08.28 00:00

 
Please explain why you can't use the construction that is in the code? And how to change (apparently, a new kind of pointers for MQL) to make such a construct work? And will it slow down?
void f1( int i1, int i2, int i3, int i4, int i5 ) {}
void f2( int i1, int i2, int i3, int i4, int i5 ) {}

void OnStart()
{  
  bool Condition = true;
  
//  (Condition) ? f1(1, 2, 3, 4, 5) : f2(1, 2, 3, 4, 5); // 'f1', 'f2' - expression of 'void' type is illegal

  if (Condition)
    f1(1, 2, 3, 4, 5);
  else
    f2(1, 2, 3, 4, 5);
  
  (Condition ? f1 : f2)(1, 2, 3, 4, 5); // Почему так нельзя? Как сделать, чтобы можно было?
}
 
fxsaber:
Please explain why you can't use the construct that's in the code? And how to change (apparently, a new kind of pointers for MQL) to make such a construct work? And will it cause lags?

Try this

int b = (Condition) ? f1(1, 2, 3, 4, 5) : f2(1, 2, 3, 4, 5);
 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

A100, 2016.08.25 14:49

Error when executing

In a more complex version reproduced as: EX5 loading failed

In build 1398 'EX5 loading failed' error remains (apparently not related to that example)

//Script1.mq5
typedef void (*fn)();
#import "Script2.ex5"
        void g( fn );
#import "Script3.ex5"
        void h();
#import
void OnStart() { g( h ); }
//Script2.mq5
#property library
typedef void (*fn)();
void g( fn f ) export { f(); }
//Script3.mq5
#property library
void h() export {}
 
Vladimir Pastushak:
Do you use Storage yourself?

Replying in four days. But as they say, better late than never.

Rarely, but I use the vault. Mostly to save work I've done from loss. I transfer from computer to computer, too, through storage. I used Yandex-disk earlier. But there to transfer this is how many manipulations should be done.

On the first computer, open Yandex, select the file, upload it.

On the second computer, the receiver: open Yad, choose a file, download, create a new code in the editor, copy the downloaded code, andompile.

And there is no additional confusion with the versions hosted by JD.

I have this question. storage works. I connect different computers, the code is transferred. But I can't view it from my account. There is no "Preview" button. There are files in Projects folder.

 

Hello, I use the ChartSetInteger function (MT5 1395 build) to change the height of the indicator window:

 if(!ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS, 1, subWindowPixels))
    {
        Print(__FUNCTION__+", Error Code = ",GetLastError());
        return;
    } 
After resizing the window this way, the indicator window is locked and cannot be resized manually.
In the next thread https://www.mql5.com/en/forum/59754, the solution of this problem for MT4 was setting indicator window size to 0 pixels, but on MT5 this method doesn't work. Please advise if you can somehow solve this problem? Thank you.