Questions from Beginners MQL5 MT5 MetaTrader 5 - page 954

 
fxsaber:

There will be no mistake. You still haven't realised what a double slash is.

Thanks for your patience!

Really, I didn't get the whole picture right away, that only the compiler needs double slash to write this character into the string.

Alexey Viktorov, thanks for focusing on the compiler.

 
Vladimir Karputov:

So an example that only works when a new bar is born.

This example uses static variablesPrevBars,prev_ask andprev_bid. The essence of static variables is.

So our three static variables(PrevBars,prev_ask andprev_bid) are local variables declared within OnTick function and they store their values, which they had when they entered OnTick function previously.

PrevBars stores the time of the previous bar. This time is compared totime_0, the time of the current bar. As long asPrevBars is equal totime_0, we are at the current bar and exit the OnTick function. Similarly with the variables that store the prices of the previous bar: first we display the previous and current prices, then we write the current prices into the variablesprev_ask andprev_bid.

Vladimir, thank you very much, everything is clear and understandable.
 

Can you tell me please!

How can I tell if an expert is or is not running in the window with the given ID? And it would be good to know his name.

 
User_mt5:

Please give me a hint!

How to determine the fact that the window with the given ID is or is not running an expert? And it would be good to know his name.

https://www.mql5.com/ru/code/19003

Expert
Expert
  • www.mql5.com
Все остальные файлы на данной странице описания библиотеки являются ее примерами/сценариями применения и не нужны для работы самой библиотеки. Возможности Примеры К описанию прикреплены примеры/сценарии ее использования. ExpertsRemove.mq5 ExpertsReopen.mq5 ChartsClose.mq5 ExpertLoader_Example.mq5 ExpertsChange_Example.mq5 Это...
 

Thank you for your reply. It's close, but I didn't find what I needed there. Maybe I was looking in the wrong place.

I would like to know the function that will answer the question about the presence of expert in the given window.

Thank you.

 
User_mt5:

Thank you for your reply. It's close, but I didn't find what I needed there. Maybe I was looking in the wrong place.

I would like to know the function that will answer the question about the presence of the expert in the given window.

Thank you.

ChartGetString(Chart_ID, CHART_EXPERT_NAME);
 
User_mt5:

Thank you for your reply. It's close, but I didn't find what I needed there. Maybe I was looking in the wrong place.

I would like to know the function that will answer the question about the presence of the expert in the given window.

Thank you.

string  ChartGetString( 
   long  chart_id,          // идентификатор графика 
   int   prop_id            // идентификатор свойства 
   );

Where prop_id = CHART_EXPERT_NAME;

 
fxsaberVasiliy Sokolov

Thank you!

I was looking for this function in Operations with Charts. And here he is, a reindeer!))

 
User_mt5:

Thank you!

I kept looking for this function in the Chart Operations section. And there he is, a reindeer!))

So that's what chart operations are all about.

Forum on trading, automated trading systems & strategy testing

FAQ from Beginners MQL5 MT5 MetaTrader 5

Vasiliy Sokolov, 2018.12.05 15:31

string  ChartGetString( 
   long  chart_id,          // идентификатор графика 
   int   prop_id            // идентификатор свойства 
   );

Where prop_id = CHART_EXPERT_NAME;


 
Alexey Viktorov:

So that's what graph operations are all about.

Heh)) That's what I thought too.

Turns out it's Environment State.