Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1241

 
Mihail Marchukajtes:
Good afternoon colleagues, suggest whether there is such a symbol in the form of a horizontal line in a ball, and that I can not find alas :-(
Druzhe take the object OBJ_TREND instead of a symbol and set the same price for two points and get the line of desired length....
 
Mihail Marchukajtes:
Dude, take the OBJ_TREND object instead of the symbol and set the same price for two points and you'll get a line of the right length....
Thanks grey urchin, it worked :-)
 
Jokes aside colleagues, tell me if it is possible to draw a trend line from the current bar and 3 bars into the future without using the line type beam???? I literally need a line three bars ahead. Is this possible?
 
Mihail Marchukajtes:
Jokes aside colleagues, tell me if it is possible to draw a trend line from the current bar and for 3 bars into the future without using the line type beam???? I literally need a line three bars ahead. Is this possible?

The second time coordinate should be the time of the current bar plus 3*PeriodSeconds(PERIOD_H1); Specify chart period.

 

Good afternoon. The debugging in the mqh file has stopped working, I set breakpoints, run the tester, it deletes them and the breakpoints disappear. What can it be related to? Now I can't debug my code, before it was working fine. I'm not sure what may have caused it. I recompiled the Expert Advisor ten times, but it didn't help.

Edit: I have figured it out. Because of editing the parameters of an overridden function, the Expert Advisor had disabled the given file and the debugger could not access it at all. Oh crap, such errors are hard to detect, you may not even notice that the file has stopped turning on and you will have to examine why everything stopped working...

 

Can you tell me how to remove the Ask and Bid lines in the Strategy Tester visualiser?

In the chart properties these bid and ask lines are removed - by changing the colour of these lines to none. But when I run it again in the visualizer, everything repeats. I looked in the terminal, there were these lines on active charts, I removed them - but nothing has changed.

 
Sayberix:

Can you tell me how to remove the Ask and Bid lines in the Strategy Tester visualiser?

In the chart properties these bid and ask lines are removed - by changing the colour of these lines to none. But when you run it again in the visualizer, everything repeats. I looked in the terminal, there were these lines on the active charts, I removed them - but nothing has changed.

Don't use the most accurate"Every tick based on real ticks" mode. Your strategies will not test as well, but you will be happy that the lines are not shown.

 
Vladimir Karputov:

Do not use the most accurate"Every tick based on real ticks" mode. Your strategies will not test as well, but you will be happy that the lines are not showing.

Thank you! Is it a bug, or is it necessary to show bid and ask? )

 
Sayberix:

Thank you! Is it a bug, or should it be - should bid and askk be displayed? )

Please don't ever use the word "bug" - if you don't read the help.

 
Vladimir Karputov:

Please don't ever use the word "bug" - if you don't read the help.

I do. Just probably haven't gotten there yet. I don't think it's easy to get through a 28 MB pdf reference. Or to put it another way - not all parishioners know the whole bible, even though they're devout.

I have another question, please advise - if it's not difficult:

when executing code in the strategy visualiser:

//+------------------------------------------------------------------+
//|                                                            1.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

ulong count, raschet = 1;
int OnInit()
  {
   return(0);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   for(int i=1; i<=10; i++)
     {
      count = GetTickCount();
      raschet *=  i;
      Print("Счетчик i: ", i, " Raschet: ", IntegerToString(raschet)," Время выполнения цикла: ", IntegerToString(GetTickCount() - count));
     }
    return;
  }
//+------------------------------------------------------------------+

1. the program goes into an infinite loop;

2. the results of execution are different:

without breakpoints:

With breakpoint on Print:


All done on debugging historical data. No real data available - it's the weekend.

Reason: