Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1196

 

Hi connoisseurs!

Question about CopyHigh(CopyLow as well): which price do these functions select? Ask or Bid?

 
odyn:

Hi connoisseurs!

Question on CopyHigh(CopyLow as well): which price do these functions select? Ask or Bid?

And open the terminal (any chart) and see at which prices the bar is built - that will be the answer.

 
Vladimir Karputov:

And open the terminal (any chart) and look at what prices the bar is plotted at - that will be the answer.

I know that the chart is based on a bid.

So these functions also use the bid?

For CopyHigh it seems a bit illogical to use Bid, because the Ask price is still higher, so we get incorrect data.

 
odyn:

I know that the graph is based on a bid.

So, do these functions also use bid?

For CopyHigh it seems a bit illogical to use Bid, because the Ask price is still higher, so we get incorrect data.

Everything is absolutely logical: the terminal draws bars by Bid. Therefore all OHLC data is also based on Bid.

But if it is Bid or Ask that is important for you, then you can learn additional functions:

Документация по MQL5: Доступ к таймсериям и индикаторам / CopySpread
Документация по MQL5: Доступ к таймсериям и индикаторам / CopySpread
  • www.mql5.com
Функция получает в массив spread_array исторические данные спредов для указанной пары символ-период в указанном количестве. Необходимо отметить, что отсчет элементов от стартовой позиции ведется от настоящего к прошлому, то есть стартовая позиция, равная 0, означает текущий бар. При копировании заранее неизвестного количества данных...
 
Is there any way to have the warning "You have open positions/pending orders - Continue closing/Cancel" pop up when trying to close the MT5 terminal? Paranoid, of course, but still... Thank you!
 
odyn:

Hello, connoisseurs!

Question about the IndicatorSetString function.

I am trying to set a short indicator name with it.

But the root name is not set and gets the default value.

Why, what have I done wrong?

PS: The printer does not print the value assigned by the IndicatorSetString function (iMA_navch Demo), it prints the default MA(8).

The short indicator name is set in the OnInit() function

And in the OnDeinit() function, it is useless.

 
odyn:

I put it here to make the code more compact.

Of course, the root name was set in OnInit(), BUT the result was the same as described above.

Well, put it somewhere else, and we'll all guess where it should have gone and why it was done that way.

 
Alexey Viktorov:

Well, put it somewhere else, and we'll all keep guessing where it should have gone and why.


The question is closed, thank you for your help.

 

Question about the colour of the technical (NOT custom!) indicator.

Is there a standard method to change the colour of a technical indicator?

To display it on real and demo charts.

Документация по MQL5: Технические индикаторы
Документация по MQL5: Технические индикаторы
  • www.mql5.com
Все функции типа iMA, iAC, iMACD, iIchimoku и т.п., создают в глобальном кеше клиентского терминала копию соответствующего технического индикатора. Если копия индикатора с этими параметрами уже существует, то новая копия не создается, а увеличивается счетчик ссылок на данную копию. Эти функции возвращают хэндл соответствующей копии индикатора...
 
odyn:

Question about the colour of the technical (NOT custom!) indicator.

Is there a standard method to change the colour of a technical indicator?

To be displayed in the tester? Bingo. Create a template with all the indicators you need and save it with EA name or tester name and the test will open with these settings.

Reason: