AutoGraf Series 4 - MQL features. - page 35

 

Не очень понятно что Вы называете "строка кода для учёта в приложении".

Fragment from AG_Srtategy_Channal_Inside.mq4

//================================================================================== 6 ==
   if ( Channal == false)                           // Если объекта заданного типа нет
      {
      ObjectCreate ( My_Chan_Name, OBJ_STDDEVCHANNEL,0,0,0); // Создаём его.. 
      int Сoor_X2 = Time[0];                                // 1я точка СПРАВА, 2я СЛЕВА
      int Сoor_X1 = Сoor_X2 - With*60;                      // Канал длиной 3 часа
      ObjectSet( My_Chan_Name, OBJPROP_TIME1, Сoor_X1);      // Устанавливаем координаты
      ObjectSet( My_Chan_Name, OBJPROP_TIME2, Сoor_X2);      // Устанавливаем координаты 
      ObjectSet( My_Chan_Name, OBJPROP_COLOR, Orange);       // Устанавливаем координаты 
      AG_Message( Message, "АТ: Устанавливаем объект OBJ_STDDEVCHANNEL.");// Сообщение

      return(1);                 // Это необходимо, чтоб установл. канал был учтён AG 4    Имелась ввиду эта строка

      }
//---------------------------------------------------------------------------------- 7 --

I was confused by this line:

The first is that the AT function can trade on its own - generate trade orders and send them to the server

It seems that the AT function can ignore the application and send them to the server by itself ......

Apparently this is my problem due to lack of experience. My brain is not sharpened for programming yet.

 
LeonidSB писал(а) >>

.. Your brain has not yet been sharpened for programming.

You should write some simple programs on your own.

 

You are absolutely right. I am striving for it and hope to do it soon, but first I want to understand what, how and why is written by people who already have experience. Roughly speaking, to gain knowledge so that it translates into quality of experience, on the basis of which I can write something myself.

In essence, any "complex" programme is an interconnected set of simple programmes. It is like a house and bricks (I am a former builder by training and profession), i.e. programming is like a construction set for me.

By the way, take the time to look at my indicator in work. It draws and leaves the target line on the chart, the line of profitable and loss-making trades, using them you can visually analyze the strategy implementation on the chart in the tester, and in real life. In addition, when activating the appropriate options, you can see and apply for further processing the results of the session in your own (not general) Log file.

extern bool   PrDeal=false;                                      // Выключатель. Печатать отчет по каждой сделке
extern bool   PrCol=false;                                       // Выключатель. Печатать отчет в колонку
extern bool   PrTab=true;                                        // Выключатель. Печатать отчет в таблицу

So far, three types of reports are created simultaneously in one file. I have already mentioned that I based my report on the indicator developed by Vladislav Goshkov. It was 280 lines. I have improved it up to 2300 lines. As the saying goes, it was something to build upon. Obviously, the code was written in such a way that it could not be described in a nutshell. But these are my first lines of code and they work, which is the most important thing! So I'm moving in the right direction (though not in the right way), and with your help in explaining the issues that arise, it's all a matter of time.

Thank you very much for your participation.


Taking the opportunity, another question.

It's written in the tutorial:

Если в результате исполнения торгового приказа функция OrderClose() вернула значение false, то это значит, что ордер не закрыт. Чтобы выяснить причину неудачи выполняется анализ последней ошибки, возникшей при попытке осуществления торговой операции. Для этого вызывается функция Errors() (см. раздел Функция обработки ошибок). Если при исполнении этой функции обнаруживается, что ошибка является непреодолимой (например, торговля запрещена), то функция Close_All() заканчивает работу и возвращает управление в управляющую торговую функцию Trade(), что в конечном счёте приводит к завершению исполнения специальной функции start() эксперта. На следующем тике торговый терминал снова запустит на исполнение функцию start(), и если критерий закрытия на тот момент будет ещё актуален, то это снова приведёт к вызову на исполнение функции закрытия всех ордеров Close_All().

Question:

There are two open orders BUY-1 and BUY-2 with lots 3 and 5 respectively. There is a trade order using Close_All() function. Orders' order: first there is BUY-2 (5 lots), then BUY-1 (3 lots). At the same time, BUY-2 (5 lots) cannot be closed - the error is irreversible - we leave - the BUY-1 order (3 lots) is not closed - the loss is increasing - the same thing happens at the next tick (the loss is increasing), etc. I.e. if we cannot close the first order in the list that cannot be closed because of some compelling reason, all following orders on the list will remain open and remain open for some time, it is not clear. This should not be allowed. This must not be allowed by the program algorithm but I tried my best to analyze it and failed to understand.

      //--------------------------------------------------------- 4 --
      if ( Ans==false)                     // Не получилось :( 
        {                                // Поинтересуемся ошибками:
         if( Errors(GetLastError())==false)// Если ошибка непреодолимая
            return;                       // .. то уходим.
        }
      //--------------------------------------------------------- 5 --
      Terminal();                         // Функция учёта ордеров 
      Events();                           // Отслеживание событий
     }
   return;                                // Выход из пользов. функции
  }
//--------------------------------------------------------------- 6 --

Please explain in more detail.

Thank you in advance, with respect and best wishes, Leonid.

 
LeonidSB писал(а) >>

Question:

There are two open orders BUY-1 and BUY-2 with lots 3 and 5 respectively. There is a trade order using Close_All() function. Orders close order: first, BUY-2 (5 lots), then BUY-1 (3 lots). At the same time, BUY-2 (5 lots) cannot be closed - the error is irreversible - we leave - the BUY-1 order (3 lots) is not closed - the loss is increasing - the same thing happens at the next tick (the loss is increasing), etc. I.e. if we cannot close the first order in the list that cannot be closed because of some compelling reason, all following orders on the list will remain open and remain open for some time, it is not clear. This should not be allowed. This must not be allowed by the program algorithm but I tried my best to analyze it and failed to understand.

Please explain in more detail.

Thank you in advance and respectfully and with best wishes, Leonid.

An insurmountable error is an error that cannot be overcome. For example, Market_closed.

From this point of view, it does not matter which order you close or open. The market is closed anyway:).

But if you try to execute a trade, it should be the one that has the highest (from the strategy's point of view) priority.

 

Hello ladies and gentlemen!

Please answer my question.

Which of the indicators most reliably displays the change of trend - flat?

I want to add this indicator to the AG_Srtategy_Channal_Inside and AG_Srtategy_Channal_Outside strategies as a switch from one strategy to another.

 
SK. писал(а) >>

........The task was to enable the user to attach to the AutoGraf 4 application his/her own trading algorithms written in MQL4 and executed as .ex4 strategy files. To solve this problem, the Expert Advisor AG_exp.ex4 includes a code that imports into the Expert Advisor the function of automatic trading AG_AT that is available both as .ex4 and mq4 files. Further, the user can decide on his or her own how to arrange the codes. The most convenient is to use one of two variants....

This variant has not been considered: main module with open source code, the main one, which is now with closed source code, is called via import, trading strategy via an incluid (or first via the incluid, and then import into the incluid)... The point is this - an intermediate link in the form of an inluder to make external variables visible. It seems to me, if you think carefully, it should work. Don't tell me at once that it's impossible ;)

 
LeonidSB писал(а) >>

Hello ladies and gentlemen!

Please answer my question.

Which of the indicators most reliably displays the change of trend - flat?

I want to add this indicator to AG_Srtategy_Channal_Inside and AG_Srtategy_Channal_Outside strategies as a switch from one strategy to another.

And the choice is not big: STD, ATR, ADX. Also clock and news release calendar.

 

Thank you!

I wonder if there's an option so that when a comment is added to a page, it's automatically updated?

I have to periodically go to the page and update it manually.

 
Integer писал(а) >>

This option has not been considered: open source core module, the core one which is now closed code is called via import, trading strategy via incluid (or first via incluid and then import into incluidnik)... The point is this - an intermediate link in the form of an inluder to make external variables visible. It seems to me, if you think carefully, it should work. Don't tell at once that it is impossible;)

There is no difficulty in doing it. But shipping a commercial open source product... you know, that's not the solution.

The real solution is expected in MT 5. Any application program should be called from the main program. What is needed is the ability to manage the completed EAs. In this case, a customised strategy could consist of an analytical unit and a "subroutine" calling unit. You want - call the script and it will draw a fiba, you want - call the indicator, you want - close everything and pipsqueak in the evening after work:).

AND API. Then you can make a truly modern tool.

The user doesn't care about our frills (all sorts of scripts, Expert Advisors, indistinguishable from experts:). He or she needs a convenient, high-quality, multifunctional service. In MT4 it was possible to do only what has been done - a DOS-like face and limited possibilities.

All hope for MT5.

 

New version of AG series 4 - AutoGraf 4.90714 has been released.

Changes made:
1. the tool control analysis algorithm 14 Close_All has been optimised.
2. A new tool management rule 14 Close_All is introduced: The software setting of the tool at the current moment is allowed. To do this, enter a value of 1 for the tool runtime setting parameter (Instrument [0][2][32][1] = 1).

Download the software here: http://autograf.dp.ua/Pages/4/421.htm