Questions from Beginners MQL5 MT5 MetaTrader 5 - page 57

 
The point is that when the function is called, the EA picks up the ! Yes, it doesn't work.
Документация по MQL5: Основы языка / Функции / Вызов функции
Документация по MQL5: Основы языка / Функции / Вызов функции
  • www.mql5.com
Основы языка / Функции / Вызов функции - Документация по MQL5
 
But shouldn't it print PERIOD_M15?
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков - Документация по MQL5
 
My brother is here.
 
Dimka-novitsek: The point is that when you call the function, the Expert Advisor piribles itself ! Yes, it does not work.

OK, I'm going away for a while. If you're interested, you can take another close look at this post: https://www.mql5.com/ru/forum/6343/page55#comment_344431 and point out where it's wrong.

The second question to consider: in the standard iMA indicator the third argument must be of type int. In your code

MA_handle=iMA(symbol,timeframe,periodd(period),mama_shift, mama_method,applied_pricece);Sleep(2000);
 
The third argument is periodd(period). What type is this argument?
 
Dimka-novitsek: But shouldn't PERIOD_M15 be prefixed?
Has this specification been added to the code: https://www.mql5.com/ru/forum/6343/page55#comment_344423 ?
 

Good day to all

In mql4, in ekspert it was enough to write Time[10] and the result was the time of the tenth bar of the current chart. How can i get this bar in mql5.


Thank you

 
teetrinker:

Good day to all

In mql4, in ekspert it was enough to write Time[10] and the result was the time of the tenth bar of the current chart. How to get this bar in mql5.

Via CopyTime
 
teetrinker:

Good day to you all

In mql4, in ekspert it was enough to write Time[10] and the result was the time of the tenth bar of the current chart. How to get this bar in mql5.


Thank you

for the future, there is a very interesting article:

https://www.mql5.com/ru/articles/81

Переход с MQL4 на MQL5
Переход с MQL4 на MQL5
  • 2010.05.11
  • Sergey Pavlov
  • www.mql5.com
Данная статья, построенная в форме справочника по функциям MQL4, призвана помочь переходу с MQL4 на MQL5. Для каждой функции языка MQL4 приведено описание и представлен способ ее реализации на MQL5, что позволит вам значительно ускорить перевод своих программ с MQL4 на MQL5. Для удобства функции разбиты на группы, как в документации по MQL4.
 

I have already rewritten the mql4 indicator and am rewriting the expert.

Question about classes, I can't figure it out.

Let's say we have in the eexpert:

CExpert Myexpert;

int OnInit()
{
//--- Initializing expert
if(!Myexpert.Init(Symbol(),Period(),true,1))
{
//--- failed
printf(__FUNCTION__+": error initializing expert");
Myexpert.Deinit();
return(-1);
}
void OnTick()
{
datetime test=Myexpert.Time(10);
Print("test = ", test);

}

Should Myexpert.Time(10) return the time of the tenth bar on the chart? And how to write it correctly?

Thank you

Документация по MQL5: Стандартные константы, перечисления и структуры / Именованные константы / Предопределенные макроподстановки
Документация по MQL5: Стандартные константы, перечисления и структуры / Именованные константы / Предопределенные макроподстановки
  • www.mql5.com
Стандартные константы, перечисления и структуры / Именованные константы / Предопределенные макроподстановки - Документация по MQL5
 
teetrinker:

Should Myexpert.Time(10) return the time of the tenth bar on the chart? And how to write it correctly?

What kind of function is this? Do you have its code?

if so, look into it and check it.


But I'll tell you a secret - but shhhh, don't tell anyone ... MQL5 has a debugger!

Reason: