Errors, bugs, questions - page 1545

 
Alexey Volchanskiy:
Youtube accepts all files in avi as long as there are no violent ads, no porn, and the size is < 15 mb if you are not in advanced mode. Also, there should be no ads, including in your signature.
Emailed you in the PM. It's not working for me.
 
Karputov Vladimir:

This is a technical forum and every comment must be confirmed:

  • terminal and operating system information (first three lines from the "Log" tab after restarting the terminal)
  • code
  • detailed description of what you did and what you got.

Pretty detailed description of what I observed. The developers don't owe me anything and I don't owe them anything. If they're interested, we'll talk to them in the Service Desk.

The code for the empty indicator is obvious.

 
comp:

Recorded a video of how the indicator (in standard mode - not debug) updates, but no new bars are drawn. As soon as you take the indicator off the chart, new bars appear immediately.

Hostings do not accept the video file. If needed, I can send it to servicedesk, as is.

Bundle it into an archive and send it. Zip files are supported.
 
Please tell me how to enable/disable the "Precise time scale" in MetaTrader 5 programmatically. I can not find it.
Through CHART_SHOW_DATE_SCALE - this is not it, as I understand.

Manually activate the time of interest via the following path:

Terminal -> Service -> Settings -> Graphics -> Precise timeline


I am attaching the test code below. If "Precise time scale" is manually enabled in the trading terminal, this test indicator draws vertical line segments with tie points between two bars. If not enabled, it is not between the bars.

The screenshot below shows a vertical line segment created by the test code between the bars when "Precise time scale" is enabled



I'll tell you the second thing I'm interested in right away:

If I run this code in the tester, the lines are not drawn with anchor points between the bars. They are not created as in the screenshot above, they are created as in the screenshot below.

MetaTrader 5 Version: 5.00 build 1295

I do not know how to ask more precise question here, as I do not have an answer to the first one.



P./S.:

I have made some clarifications:

  • added screenshots;
  • replaced the test code, removing the variable not used here and displaying a separate window;
  • clarifications I made in the text in dark blue font.
Files:
 

How can I get the terminal to call OnCalculate in MT5? ChartRedraw does not help. The DLL variant is not suitable.

In other words, I need to create a Calculate event: https://www.mql5.com/ru/docs/runtime/event_fire#calculate

Документация по MQL5: Программы MQL5 / События клиентского терминала
Документация по MQL5: Программы MQL5 / События клиентского терминала
  • www.mql5.com
Программы MQL5 / События клиентского терминала - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

From the search results I came to the conclusion that there seems to be no function in MQL5 Help that can be used to programmatically enable/disable the "Precise time scale" in MetaTrader 5.

For some reason, I had the impression that there were some changes in this respect in the recent times. Although of course, I must be wrong.

If so, I'll restate my first question above:

Will there be a function to programmatically enable/disable the "Precise time scale"?


And in either case (will or will not be introduced): how do you do this on/off switch in the tester?

 
comp:

How can I get the terminal to call OnCalculate in MT5? ChartRedraw does not help. DLL-version does not work.

If you find it, please tell me too.)

At the moment as far as I know the answer is "no way".

 
Комбинатор:

If you find it, let me know too.)

At the moment as far as I know the answer is "no way".

If I am an adviser, it is like this

#define  PERIOD_NULL -1

void CallOnCalculates( void )
{
  const string Name = __FUNCTION__;

  if (GlobalVariableCheck(Name))
  {
    const int Value = (int)GlobalVariableGet(Name);

    if (Value == PERIOD_NULL)
    {
      GlobalVariableDel(Name);

      ExpertRemove();
    }
    else if (ChartSetSymbolPeriod(0, Symbol(), (ENUM_TIMEFRAMES)Value))
      GlobalVariableSet(Name, PERIOD_NULL);
  }
  else
  {
    const ENUM_TIMEFRAMES period = Period();

    if (ChartSetSymbolPeriod(0, Symbol(), (period == PERIOD_MN1) ? PERIOD_W1 : PERIOD_MN1))
    {
      GlobalVariableTemp(Name);

      GlobalVariableSet(Name, period);
    }
  }

  return;
}

void OnInit( void )
{
  CallOnCalculates();

  return;
}

But I need it for something else and it does not suit me.

 
comp:

If by an Expert Advisor, then like this

If the script, then we can (the implementation is completely different - without changing the TF)call OnCalculate for a specific indicator on the chart or for all of them at once.

But I need it for something else and this variant is not suitable.

But this (script) variant is also not suitable, if the indicator should make the terminal call its own OnCalculate (MT5).

 
With an indicator, I need an indicator.