Questions from a "dummy" - page 165

 
Karlson:

It's not that hard to redo this one .

https://www.mql5.com/ru/code/470

Thanks! :-)

It's the right thing to do.

When you redo it, you start to understand.

 
A follow-up question. What is the difference between an order number and a ticket? How is the numbering of one and the other done? What starts with 1 and what starts with 0? Are the tickets numbered in order or not?
 
kPVT:

There is nothing wrong with the indicators. It is possible to know the number and which indicators are on the chart, to put an indicator or delete an indicator from the chart.

However, for Expert Advisors and scripts it is not implemented, only stop working of Expert Advisor calling ExpertRemove() from the EA itself.

It looks like there is really only fnctional on indices (although I didn't check it to the end).

I have looked in MQL4, there is a function there.

string WindowExpertName()
Возвращает имя выполняющегося эксперта, скрипта, пользовательского индикатора или библиотеки, в зависимости от того,
из какой MQL4-программы вызвана данная функция.
I suggested the developers to add the necessary functionality to the chart information and in such a way that it would be possible to get the ifna from any chart.
 

Since only one EA can work in one chart, this information has probably not been created for determination of indicators only.

But it is really possible to get information from other charts, if someone needs it.

 
Karlson:

Since only one EA can work in one chart, this information has probably not been created for determination of indicators.

But it is really possible to get information from other charts, if someone needs it.

I can still get it with crutches, but I couldn't find any standard functionality.
 

I found out that the indicator can get its short name from itself, but its handle is not and it is probably caused by something.

That's why if you loop through all charts and indicator windows in the indicator, you will reach "itself" and will get stuck if you don't find a workaround.

Of course you can do it in a script or in an Expert Advisor, but I had to do it in an indicator.

But that's not the main thing, it just occurred to me again:

- it would be good to have a special empty "chart" in the terminal without symbol and period and other surroundings, but on which an indicator/script/expert can also be thrown.

A kind of board for various panels and other controls/controls for other conventional charts and programs.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Свойства пользовательских индикаторов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Свойства пользовательских индикаторов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Свойства пользовательских индикаторов - Документация по MQL5
 
kPVT:

But that's not the main point, just a thought again:

- It would be good to have a special blank "chart" in the terminal without symbol and period and other surroundings, but on which an indicator/script/expert can also be thrown.

A kind of board for the various panels and other controls/controls of other conventional charts and programs.

May Allah hear you, Renat.

I think this (not at all new) idea should be actively promoted, and in a much broader context, namely:

  • We need different types of large windows (the standard chart is only one of the options). Blank - for experts, perhaps a spreadsheet, a browser window, and of course different types of charts yet (renko-kagi, tick chart, etc.).
  • Experts and scripts should be separated from charts, the navigator window has a special tab (mql-Space) with a tree-like table of running mql-programs, that would be the main anchor point for experts. The binding to a specific chart is possible (optional), but not obligatory. In the multicurrency terminal the binding to a specific symbol (and chart) is not too absurd just for indicators.

Unfortunately, I am fully aware that this will not be implemented in MT5 (with 99.9% confidence). The architecture of the terminal, in its foundation, does not allow for easy upgrades or even expansion in this particular aspect. But the development of the system will not end with MT5, and by the time MT6 will be found (and perhaps the process is already started), we must make the developers architecturally lay the same scheme, instead of inheriting the usual streamlined ("one chart - one Expert Advisor", "each tab of the main window = chart", etc.).

There are private difficulties in implementing such an architecture, but they are not fundamental and defeatable. But the user friendliness will win by orders of magnitude. In the end, the developers will also get some comfort - for example, specific types of windows can be introduced in stages and gradually, without great stress at the architectural level.

Amen.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Отображение графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Отображение графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Отображение графиков - Документация по MQL5
 
MetaDriver:

May Allah hear you, Renat.

I believe that this (not at all new) idea should be actively promoted, and in a much broader context, namely:

  • We need different types of large windows (the standard chart is only one option). Blank - for experts, perhaps a spreadsheet, a browser window, and of course different types of charts yet (renko-kagi, tick chart, etc.).
  • Experts and scripts should be separated from charts, the navigator window has a special tab (mql-Space) with a tree-like table of running mql-programs, that would be the main anchor point for experts. The binding to a specific chart is possible (optional), but not obligatory. In the multicurrency terminal the binding to a specific symbol (and chart) is not too absurd just for indicators.

Unfortunately, I am fully aware that this will not be implemented in MT5 (with 99.9% confidence). The architecture of the terminal, in its foundation, does not allow for easy upgrades or even expansion in this particular aspect. But the development of the system will not end with MT5, and by the time MT6 will be found (and perhaps the process is already under way), we must make the developers architecturally implement exactly this scheme, instead of inheriting the usual streamlined ("one chart - one Expert Advisor", "each tab of the main window = chart", etc.).

There are private difficulties in implementing such an architecture, but they are not fundamental and defeatable. But the user friendliness will win by orders of magnitude. In the end, the developers will also get some comfort - for example, specific types of windows can be introduced in stages and gradually, without great stress at the architectural level.

Amen.


What is so sad about it?

You make a fake chart and voila brooks turn into elegant shorts, or longs :) Sorry about that wordplay.

 
Urain:

What's so sad about it?

A fake chart is made and voila, the brooks turn into elegant shorts, or longs :) sorry for the play on words.

Unfortunately, mql5 does not allow to remove a funny inscription "USDZAR" from a "pseudo-chart" label and replace it with, for example, "Hello UrainSpreadSheat", and it also can't repaint the label. You can't attach five "background" Expert Advisors that are always needed in all charts (like clock, trading panels, etc.) to fake chart. So... you know the limits of the current implementation, no matter how hard you try. And then, the second item (detaching EAs from symbols) is just as important, and no one will do it in current implementation.
 

What is wrong with the code. Why do the errors"failed cancel order #0 buy 0.00 at market [Invalid request]" keep appearing?


   MqlTradeRequest order_remove_mql_trade_request = {0};
   order_remove_mql_trade_request.action = TRADE_ACTION_REMOVE;

   i = OrdersTotal();
   if(i > 0){
      if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY){
         for(i2 = 0;i2 <= i;i2++){
            ul = OrderGetTicket(i2);
            OrderSelect(ul);
            if(OrderGetInteger(ORDER_TYPE) == ORDER_TYPE_BUY_LIMIT){
               order_remove_mql_trade_request.order = ul;
               OrderSend(order_remove_mql_trade_request,mql_trade_result);}}}
      if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL){
         for(i2 = 0;i2 <= i;i2++){
            ul = OrderGetTicket(i2);
            OrderSelect(ul);
            if(OrderGetInteger(ORDER_TYPE) == ORDER_TYPE_SELL_LIMIT){
               order_remove_mql_trade_request.order = ul;
               OrderSend(order_remove_mql_trade_request,mql_trade_result);}}}}