Errors, bugs, questions - page 2910

 
AlexInRush:

Hi all!

Could you please tell me how to debug a robot that trades on a stack of orders on Forts? Is there any tool to play the cup history or work with real data in the execution emulation mode? I can not think of anything but to debug it on a real account using print and comment, which sometimes is not cheap :(

There's one in the marketplace. The kodobase doesn't seem to have any.

 
Stanislav Korotky:

There are some on the market. I don't think there are any on the kodobase.

Good afternoon, Stanislav.

I read the description of OrderBook History Library. If I understood it correctly, when connecting this library to the robot, I can replace the regular events from the tumbler with events from the emulator. When playing the strategy in the tester, the channel history broadcasting will be synchronized with the tester tick history. Accordingly, the emulation of the execution will be based on the tester tick history. If I understand it correctly,it seems that this is what I was looking for. Thanks, I'll give it a try!

 
AlexInRush:

Good afternoon, Stanislav.

I read the description of OrderBook History Library. If I understood it correctly, when I connect this library to my robot, I can replace the events from the tester with events from the emulator. When playing the strategy in the tester, the channel history broadcasting will be synchronized with the tester tick history. Accordingly, the emulation of the execution will be based on the tester tick history. If I understand it correctly,it seems that this is what I was looking for. Thanks, I'll give it a try!

You can't mention or discuss products in the forum. Questions about the product, please write to me in person.

 

I've discovered a strange thing with creating a graphical resource! One and the same code variant written in MQL5 works perfectly, and in MQL4 it does not work at all! Everything is absolutely the same and looks simple:

    string path="::Images\\AAA.bmp";
    string path1="\\Images\\AAA.bmp";

    if(!ResourceCreate(path,path1))
     {
      Print(__FUNCTION__+", Error="+string(GetLastError()));
      return(false);
     }

As a result, when you install the indicator on the chart in Metatrader 4 we have

Where is the problem?

Документация по MQL5: Операции с графиками / ChartIndicatorAdd
Документация по MQL5: Операции с графиками / ChartIndicatorAdd
  • www.mql5.com
//| Expert initialization function                                   |                                                                                       ); "Внимание! %s: Попробуем добавить индикатор MACD(%s/%s) на график %s/%s. Получим ошибку 4114"                         subwindow...
 
Nikolay Kositsin:

I've discovered a strange thing with creating a graphical resource! One and the same code variant written in MQL5 works perfectly, and in MQL4 it does not work at all! Everything is absolutely the same and looks simple:

As a result, when you install the indicator on the chart in Metatrader 4 we have

Where is the problem?

Yes, it does not work in MT4.
But it works for both MT5 and MT4 with this shorter construction:

#resource  "\\Images\\AAA.bmp"
string path="::Images\\AAA.bmp";

uint bmp[], w,h;
ResourceReadImage(path,bmp,w,h);

Files:
Morph.mq4  9 kb
iCanvas.mqh  49 kb
Images.zip  731 kb
 
Nikolai Semko:

Yes, it does not work in MT4.
But it works for both MT5 and MT4 with this shorter design:


I thank you, but alas, this structure loads images only at compilation time and I need to load them into a compiled file at work. So the ResourceCreate() function in MQL4 does not work in any way? Maybe, the developers simply forgot to add the code for it in the busy schedule?

Документация по MQL5: Общие функции / ResourceCreate
Документация по MQL5: Общие функции / ResourceCreate
  • www.mql5.com
[in]  Относительный путь к файлу, содержащему данные для ресурса. Если путь начинается с обратной косой черты "\" (пишется "\\"), то файл ищется относительно папки Если второй вариант функции вызывается для...
 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 
Nikolay Kositsin:

Thank you, but alas, such a construction only loads images at compile time, while it should be loaded into the compiled file at runtime. So the ResourceCreate() function in MQL4 does not work at all? Maybe, the developers simply forgot to add a code for it in the turmoil of events?

Perhaps.
They fixed ResourceReadImage just recently.
 
There is no error message:
class B {
enum E { function };
        void function() {} //нормально ???
        void g() { function(); }
};

but that's the way it is:

class A {
public:
        void function() {}
};
class B : public A {
enum E { function };
        void g() { function(); } //Error: ')' - expression expected
};

What's the fundamental difference?

 
compile fail with ternary operator
compile fail with ternary operator ?

interface A{};
class B:public A{};
class C:public A{};
void OnStart(void)
  {
   A* x=(true)? new B : new C; //invalid cast operation
  }


any suggestions?
why?
Reason: