Questions from a "dummy" - page 96

 
tol64:

I remembered my question to Renate. Can someone clarify what was meant by:

If I use IndicatorRelease(), then I am making a huge and conceptual mistake.

Why?

Because the comment was given by Renat in relation to the specific situation of using IndicatorRelease(), namely: Carlson created and deleted indicator handles on every tick.

See the discussion here: https://www.mql5.com/ru/forum/1111/81949#comment_81949

 
Yedelkin:

Because the comment was given by Renat in relation to the specific situation of using IndicatorRelease() function , namely: Carlson created and deleted indicator handles on every tick.

Look at the discussion here: https://www.mql5.com/ru/forum/1111/81949#comment_81949

Oh, I see, if that's what you mean. I only create indicator handles once, at the very beginning.
 
At that time, it was a matter of the average period adapting to the market during operation. According to certain criteria, the average period was changed. The old handle was deleted. A new one was created.
 
Karlson:
At that time it was a question of the average period adapting to the market during operation. According to certain criteria the average period was changed. The old handle was deleted. A new one was created.
What solution did you choose?
 
Karlson:
At that time the question was about adapting the averaging period to the market during the operation. According to certain criteria, the period of the average was changed. The old handle was removed. The new one was created.

Due to the specifics of creating our own indicator flow, this solution is unacceptable, this issue has already been discussed in the early days of the language (during beta testing).

In this case, it would be reasonable to transfer the calculation of the indicator to the Expert Advisor and calculate only the latest data, not the entire array of historical data. Of course, there is a complication here, such a solution does not allow to use ex5 indicators without knowing the code and requires understanding of the algorithm of calculation (in order to transfer it and adapt to new requirements).

Or the second option, the averaging period itself should be calculated within the indicator, and then the handle should be changed.

 
tol64:
And what solution did you choose?

In reality, in my case, optimizing more than once a month makes no sense. It is worth it to develop something... For me it is not important. At first I only created handles, but I was prompted to remove them. I started removing them. Renat commented on it :) In general, it is written that unused handles are deleted over time, probably creating a new one once a month is not critical, but never mind:

1.install self-adaptation on the genetics, as in Rich's article

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

But I don't have enough knowledge here and I don't see any particular purpose.

2) Calculations should be done directly in the Expert Advisor without handles, I should thank the SMA.

3.Use AMA or Vidya, that was done in the new versions.

But these are all my private solutions, they do not solve the problem.

Доктор Трейдлав, или Как я перестал беспокоиться и написал самообучающийся эксперт
Доктор Трейдлав, или Как я перестал беспокоиться и написал самообучающийся эксперт
  • 2011.10.27
  • Roman Zamozhnyy
  • www.mql5.com
Чуть более года назад joo дал нам в своей статье "Генетические алгоритмы - это просто!" инструмент для реализации Генетического алгоритма на MQL5. Воспользуемся же этим инструментом и напишем эксперт, который при наступлении каких-то граничных условий произведет Генетическую оптимизацию своих же параметров...
 
Karlson:

But these are all my private solutions.Not decisive.I think Urain has answered the question.

Yes, thank you, for the answers.
 

Afternoon

How to use TimeSeries.mqh library, in particular CiOpen class ....

For example: Chart - H1, instrument - "EURUSD"... get opening price from current - H1 and higher timeframes - H4 and D1 bar #5 .....

Now a thought out loud...

- attach library file

#include <Indicators\TimeSeries.mqh>

- Declare an array:

double Open[];

- create an instance of the class:

CiOpen  iOpen;

(or maybe it's "more correct" this way...?):

CiOpen  * iOpen;

- create an instance of the time series:

iOpen.Create("EURUSD", PERIOD_H4);

.... and then it's not clear.... GetData method returns either -1 or >= 0 - (but I need the open price value of bar 5)

iOpen.GetData(5, 1, Open);

Question 1. Where to look for the (with so much effort) open price data (in what place of the array Open[] )...????

Question 2. For a D1 timeframe I have to declare another array and create my own class instance (or I can do with just one)... ????


Regards, erkov.....



Документация по MQL5: Основы языка / Переменные
Документация по MQL5: Основы языка / Переменные
  • www.mql5.com
Основы языка / Переменные - Документация по MQL5
 

Hello.

Could you please tell me how to set a vertical line on a chart at a certain point?

Thank you.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
 
Alfff:

Hello.

Could you please tell me how to set a vertical line on a chart at a certain point?

Thank you.

Look at the function ObjectCreate().
Reason: