AutoGraf Series 4 - MQL features. - page 32

 
Integer писал(а) >>
What script?

Found it and took a look. Everyone here must be acting on the "don't stand under the arrow" principle, the author's self-confidence just blows you away, no way to go there.

 
ForexTools >> :
I deleted all my posts not related to AG discussion. I call other "free riders" to do the same - let's respect other's work: it's not clean where (moderators) clean, but where (users) don't litter ;)

Thanks to sabluk for understanding and support my "initiative". Maybe others will follow our example?

 

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

Changes have been made:
1. Added option to mute ticks.
2. fixed the error of managing instruments 17 and 20 (when AG or AT mode was disabled, when the market price of the instrument reached the strike price, the instrument was not deleted; now it is deleted automatically).
Download the new version here http://autograf.dp.ua/Pages/4/421.htm.

 

AutoGraf 4 has stood up decently to the innovation of the 5th sign.(http://forum.alpari-idc.ru/thread44876.html)


It simply works as it did before. No modifications are required (it is because it is written correctly - the program does not use variable values, defined numerically - everything is built on variables, updated as they change on server, in particular, Point, Digits, StopLevel etc.). )

The natural changes that have to be made in the Expert Advisor settings concern the preset values of price parameters. For example, SL (StopLoss in pips) = 25, now it must be set to 250 or any value at the user's discretion, but not less than 100 (namely, not less than the current value of StopLevel). Proceed in the same way with other parameters.

After parameters setting (in expert settings window) it is recommended to save (there) settings. Besides, it is recommended to create a new template: button Templates - Save as.

===

Movie people once filmed an old house being blown up.
They put the explosives in... Boom! The house stands. They planted more. Boom! The ground floor collapses. The whole upper part (4 floors) didn't collapse, the house just sagged by 1 floor. It was finally managed to blow up at the 5th attempt.

The construction company bought the footage for a lot of money and advertised their quality of work by showing the film:)

 

Ladies and Gentlemen!

Please answer the question.

How does the application distinguish that the AT function is giving instructions (e.g. referring to the terminal) to it and not trading itself?

Исполнение функции АТ связано с двумя основными возможностями.

The first one is that the AT function can trade by itself - it forms trade orders and sends them to the server. In this case the function cannot process any data received from the application (or handle some of them), but it can perform its own calculations using all the features of the MQL4 language, including addressing the terminal for processing orders, getting current quotes, calculating trading criteria, managing graphical objects, etc.

The second feature is directly connected with the AutoGraf 4 application. This function can instruct the AutoGraf 4 application to install any necessary tools with preset settings on specific orders or a price chart, change the application's general settings, delete tools, display messages to the user, etc. (output parameters). (output parameters).

 

Ladies and Gentlemen!

Please answer a question.

In the above example of the Custom Auto Trade function in "Example 2. Opening and closing of market orders." market orders are opened, but I think pending orders are closed.

//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж
// AG_AT.mq4                                             Пример 0 (инструментов нет)
// Пользовательская функция Автоматической Торговли.
// Используется при построении функции автоматической торговли для приложения AutoGraf 4
// Сергей Ковалёв, Днепропетровск, sk@autograf.dp.ua, ICQ 64015987, http://autograf.dp.ua
//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж 0 жж
#property library   
 
#import "AG_Lib.ex4"
   int AG_Magic_Number();                          // Вычисление MN 
   int AG_Message(string& Message[], string _Text);// Запись сообщений в массив Message[]
#import "AG_Trade_Criterion.ex4"
   int AG_Trade_Criterion_1();                     // Ф-ия определен. торгов. критериев 1
   int AG_Trade_Criterion_2();                     // Ф-ия определен. торгов. критериев 2
#import
//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж 1 жж
.......
//================================================================================== 7 ==
/*
                                       // Cнять блок комментариев с Примера 2
                                       // и закомментировать Пример 1
                                       // Пример 2. Открытие и закрытие рыночных ордеров.
   int Crit = AG_Trade_Criterion_2();  // Вызов функции вычисления торговых критериев
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   if (OrdersTotal()==0)               // Если нет ордеров, то интересуемся ..
      {                                // .. критериями открытия
      switch(Crit)                     // В этом блоке рассматриваются критерии открытия
         { 
         case 10:                      // Торговый критерий = Открыть_Buy
            MN = AG_Magic_Number();    // Вычисление MagicNumber (рекомендуется)
                                       // Открытие ордера Buy:
            OrderSend(Symbol(),OP_BUY, 0.1,Ask,2,Bid-100*Point,Bid+40*Point,Comm,MN); 
            break;
         case 20:                      // Торговый критерий = Открыть_Sell
            MN = AG_Magic_Number();    // Вычисление MagicNumber (рекомендуется)
                                       // Открытие ордера Sell:
            OrderSend(Symbol(),OP_SELL,0.1,Bid,2,Ask+100*Point,Ask-40*Point,Comm,MN);
         }
      }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   if (OrdersTotal()==1)               // По стратегии возможен только 1 рыночный ордер
      {
      switch(Crit)                     // В этом блоке рассматриваются критерии закрытия
         {
         case 11:                      // Торговый критерий = Закрыть_Buy
            if (NormalizeDouble(Order[1][6],0) == 0.0)            // Если тип ордера Buy
               {                                      
               int _Ord_Ticket = NormalizeDouble(Order[1][4],0);  // Номер ордера
               double _Ord_Lots = NormalizeDouble(Order[1][5],2); // Полное закрытие
               OrderClose(_Ord_Ticket, _Ord_Lots, Bid, 2);        // Закрыть ордер Buy
               }
            break;
         case 21:                      // Торговый критерий = Закрыть_Sell
            if (NormalizeDouble(Order[1][6],0) == 1.0)      // Если тип ордера Sell
               {
               _Ord_Ticket = NormalizeDouble(Order[1][4],0);// Номер ордера
               _Ord_Lots = NormalizeDouble(Order[1][5],2);  // Будем закр.ордер полностью
               OrderClose(_Ord_Ticket, _Ord_Lots, Ask, 2);  // Закрыть ордер Sell
               }
         }
      }
*/
//================================================================================== 8 ==
   return(1);
   }
//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж Конец модуля жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж 10 жж
if (NormalizeDouble(Order[1][6],0) == 0.0)            // Если тип ордера Buy
и
if (NormalizeDouble(Order[1][6],0) == 1.0)            // Если тип ордера Sell 

Or maybe I am misunderstanding something?

Общее количество ордеров в приложении AutoGraf 4 не должно превышать 30. Нумерация ордеров в приложении AutoGraf 4 начинается с 1. Нулевой индекс в первом измерении массива Order[][] для учёта параметров ордеров не используется. Поэтому массив Order[][] в первом измерении имеет размерность 31. Каждая строка в массиве соответствует одному ордеру и содержит значения следующих параметров ордеров:

[0][0] - total number of orders;

[][0] - not used;

[1][1] - OpenPrice - price of opening (setting) of an order (absolute price value);

[][2] - StopLoss of the order (absolute price value);

[][3] - TakeProfit order (absolute price value);

[][4] - NumberOrders number of the order;

[][5] - Number of lots of the order;

[][6] - Type of order (0=B, 1=S, 2=BL, 3=SL, 4=BS, 5=SS,Trades);

[][7] - MagicNumber - The magic number of the order;

[][8] - 0/1 comment fact;

[][9] - PrOld- initial price of the order opening (absolute price value).


From the manual:

Type of operation for the OrderSend() function. It can be any of the following values:

Constant Value Description
OP_BUY0Buy
OP_SELL1Sell
OP_BUYLIMIT2BUY LIMIT pending order
OP_SELLLIMIT3Pending SELL LIMIT order
OP_BUYSTOP4Pending BUY STOP order
OP_SELLSTOP5Pending SELL STOP order

I.e. should be:

if (NormalizeDouble(Order[1][0],0) == 0.0)            // Если тип ордера Buy
и
if (NormalizeDouble(Order[1][1],0) == 1.0)            // Если тип ордера Sell 
 

Ladies and Gentlemen!

Please answer my question.

Why in the EA properties my strategy name "L_1" is not remembered?


When installing AG_exp. I wrote it down, it is displayed in the line, but it is not remembered in the properties?

 

Ladies and Gentlemen!

Please answer a question.

When terminating an application or after uninstalling it, how to delete graphical objects not supported by the application. For example like OBJ_ARROW?

 
LeonidSB писал(а) >>

I.e., it should be:

if (NormalizeDouble(Order[1][0],0) == 0.0)            // Если тип ордера Buy
и
if (NormalizeDouble(Order[1][1],0) == 1.0)            // Если тип ордера Sell 

No, not right. Look again at the table (order set example) on http://autograf.dp.ua/Pages/2/26/267/2674.htm

This page also describes how the array indexes correspond to the parameters contained in the array. Please note that we are talking here of an index in the second array dimension Order[][].

[0][0] - total number of orders;

[][0] - not used;

[][1] - OpenPrice - price at which the order is opened (set) (absolute price value);

[][2] - StopLoss of the order (absolute price value);

[][3] - TakeProfit order (absolute price value);

[][4] - NumberOrders number of the order;

[][5] - Number of lots of the order;

[][6] - Type of order (0=B, 1=S, 2=BL, 3=SL, 4=BS, 5=SS, Trades);

[][7] - MagicNumber - The magic number of the order;

[][8] - 0/1 comment fact;

[][9] - PrOld- initial price of opening of the order (absolute price value).

---------------

Parameter "Order type" corresponds to the 6th index in the second dimension of the array Order[][].

if (NormalizeDouble(Order[1][6],0) == 0.0)            // Если тип ордера Buy
и
if (NormalizeDouble(Order[1][6],0) == 1.0)            // Если тип ордера Sell 
 
LeonidSB писал(а) >>

Ladies and Gentlemen!

Please answer my question.

Why in the EA properties my strategy name "L_1" is not remembered?

When I set AG_exp. I wrote it down, it is displayed in the line, but it is not remembered in the properties?

If you are doing everything correctly, it should be remembered.

And it will be remembered until you unload the Expert Advisor from the window.

You can do one of two things, if you don't want to re-enter it next time:

1. Save the Expert Advisor you have set to templates. Start a new loading from a new template.

2. Save Expert Advisor settings (Save button in Preferences window), and load settings when you load the Expert Advisor next time (Load button in Preferences window).

You can find the order of attachment of strategies here: http://autograf.dp.ua/Pages/2/26/267/26711/26711_2.htm.

LeonidSB wrote :>>

Dear!

Please answer the question.

When terminating an application or after uninstalling it, how to delete graphical objects not supported by the application. Like OBJ_ARROW?

Select the object and delete it (press Delete).
If programmatically, you can use ObjectsDelete() or ObjectsDeleteAll().