Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 194

 
AndEv:

Hello, could you please tell me how to "scroll" the chart to the desired date programmatically? Maybe there is a script where you can set the desired date and the chart will be instantly "scrolled" to that date?


Press the spacebar and enter the desired date.

If nothing helps, read the documentation.

 
tara:


- read the documentation.

Read the question carefully: how do you "scroll" the timetable to the right date programmatically?
 
sergeev:

No, we do not use that kind of g.

Oh great Moderator, threatening ban, throwing it at all unworthy of it, all about g not knowing. Please have mercy on the newbie and share your invaluable gnom you are referring to in *. If youwant to modify orders in *.mq4, you will have to do it in your own special way.

 
digits:

Oh great Moderator, threatening ban, throwing it at all unworthy of it, all about g not knowing. Please have mercy on the newbie and share your invaluable gnom you are referring to in *. mq4to modify orders.


A great desire to send Mr. Z (I beg your pardon Mr. digits) to the ban, and for a long time
 
AndEv:
Carefully read the question: how to "scroll" the chart to the desired date programmatically?

press the Enter button on the chart programmatically

and send the text with the date (and even currency) to the window that appears programmatically

and then press Enter softly as well

-----

Try to do it all yourself first in the chart. then repeat your movements programmatically

 
AndEv:
Read the question carefully: how do you programmatically "scroll" the timetable to the right date?
Library. It's all there for this. Sections 4.3 and 4.6.
 

There is a header file hoz_Base@Include.mqh for library hoz_Base@Library.ex4. Thevariable bi_Errris declared in the header file hoz_Base@Include.mqh .

There is an INIT function in the library hoz_Base@Library.ex4:

void fInitBase (string fs_SymbolList,
                string fs_MagicList,
                string fs_Delimiter = ",")
{
   bs_ExpertName = StringConcatenate (WindowExpertName(), ":  ", fGet_NameTF (Period()), "_", Symbol());
   bs_SymbolList = fs_SymbolList;
   bs_MagicList = fs_MagicList;
   bs_Delimiter = fs_Delimiter;
   bb_RealTrade = (!IsTesting() && !IsOptimization());
   bb_VirtualTrade = (IsOptimization() || (IsTesting() && !IsVisualMode()));
   if (bd_SymPoint == 0.0)
       {bd_SymPoint = fGet_Point(Symbol());}
   fGet_MarketInfo (Symbol(), -1);
   bd_MAXLOT = MarketInfo(Symbol(), MODE_MAXLOT);
   bd_LOTSTEP = MarketInfo(Symbol(), MODE_LOTSTEP);
   bi_LotPrecision = fLotPrecision ();
   bd_MINLOT = MarketInfo(Symbol(), MODE_MINLOT);
   InitializeArray_STR (bsa_Comment, "");
    //---- Определяем индекс "ошибок" в массиве комментариев (gsa_Comment)
   bi_IndERR = ArraySize (bsa_Comment) - 1;
   bi_Err = GetLastError();
   //---- Контролируем возможные ошибки
   fPrint (StringConcatenate ("fInitBase() => ", fErrorToString (bi_Err)));

   return;
}

Here's the line I'm interested in:

 fPrint (StringConcatenate ("fInitBase() => ", fErrorToString (bi_Err)));

When there are no errors, it should print like this:

13:46:11 2013.08.15 00:00  hoz_LoggingToAnywhere@library EURUSD.GI,M5: Внимание! fInitTradingFunc() => Ошибка № -1 

This is implemented using 2 third party library functions:

// 1.3 Формируем строки из № ошибки и её описания. ========================================================================================
string fErrorToString (int fi_Error)
{
    fi_Error = bi_Err;
    
    return (StringConcatenate ("Ошибка № ", bi_Err, " :: ", fErrorDescription (bi_Err)));
}

// 1.4 Функция преобразует код последней ошибки в текстовую строку, содержащую описание данной ошибки. ====================================
string fErrorDescription (int fi_Error)
{
   string ls_Error = "";

   switch (fi_Error)
   {
      // Коды ошибок, возвращаемые торговым сервером:
      case 0: ls_Error = "Нет ошибки";
      case 1: ls_Error = "Нет ошибки, но результат не известен";
      case 2: ls_Error = "Общая ошибка";
      case 3: ls_Error = "Неправильные параметры";
      case 4: ls_Error = "Торговый сервер занят";
      case 5: ls_Error = "Старая версия клиентского терминала";
      case 6: ls_Error = "Нет связи с торговым сервером";
      case 7: ls_Error = "Недостаточно прав";
      case 8: ls_Error = "Слишком частые запросы";
      case 9: ls_Error = "Недопустимая операция, нарушающая функционирование сервера";
      case 64: ls_Error = "Счёт заблокирован";
/*
Различный варианты возникающих
                                 ошибок
*/
      case 4202: ls_Error = "Объект не существует";
      case 4203: ls_Error = "Неизвестный тип объекта";
      case 4204: ls_Error = "Нет имени объекта";
      case 4205: ls_Error = "Ошибка координат объекта";
      case 4206: ls_Error = "Не найдено указанное подокно";
      case 4207: ls_Error = "Ошибка при работе с объектом";
   }

The question is this. If the above string fErrorToString (int fi_Error) function is used in the way I gave above, everything is printed correctly. But if it is used in the following way:

string fErrorToString (int fi_Error)
{
    return (StringConcatenate ("Ошибка № ", fi_Error, " :: ", fErrorDescription (fi_Error)));
}

Instead of no error, it outputs 0. (Like error - no error). Like this:

13:46:11 2013.08.15 00:00  hoz_LoggingToAnywhere@library EURUSD.GI,M5: Внимание! fInitTradingFunc() => Ошибка № 0

Why?

 
Zhunko:
The library. Everything is there for this purpose. Sections 4.3 and 4.6.
Thank you very much!
 
What function can be used to find out the status of the account at the beginning of the month?
 

Hello!

I'm asking for help from professionals.

Please advise how to implement the function of redrawing the lines after the appearance of a new candle. and for different timeframes.

The idea of the indicator is very simple - it looks at high and low of the previous candle, adding 50 points to high and 50 points to low.

Thank you.

Files:
help.mq4  1 kb