Questions from Beginners MQL5 MT5 MetaTrader 5 - page 749

 

How do I get indicator data (iMA) from prices from the same indicator buffer?

iMAOnArray() in 4 solved this problem. And how to do it here? The buffer of its own indicator is non-zero.

 

Point the finger. Where is it written how to write your own chart on mt5. How to make a standalone chart in mt4. I did some research. I can't find anything.

 
igorbel:

How do I get indicator data (iMA) from prices from the same indicator buffer?

iMAOnArray() in 4 solved this problem. And how to do it here? The buffer of its own indicator is non-zero.

Within the indicator itself only through MovingAverages.mqh

 
igorbel:

How do I get indicator data (iMA) from prices from the same indicator buffer?

iMAOnArray() in 4 solved this problem. And how to do it here? It is a buffer of its own indicator and it is non-zero.

https://www.mql5.com/ru/docs/indicators/ima

https://www.mql5.com/ru/docs/indicators/icustom

Документация по MQL5: Технические индикаторы / iMA
Документация по MQL5: Технические индикаторы / iMA
  • www.mql5.com
Технические индикаторы / iMA - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

How does this solve my problem? Should I pass my own indicator as applied_price? And what will it read the average from? I understand from the zero buffer. I need the average not from the zero buffer.
 
igorbel:

How does this solve my problem? Pass my own indicator as applied_price? And what will it read the average from? I understood from the zero buffer. I need the average not from the zero buffer.
Another variant is to write an "incomplete" indicator and then connect it as a resource to the new indicator. In this new indicator, apply the iMA with specifying of the handle of the incomplete, then CopyBuffer() of all buffers of the incomplete and the buffer of iMA. Thus we get a ready indicator that works as intended.
 
Alexey Viktorov:
Another option is to write an "incomplete" indicator and then connect it as a resource to the new indicator. In this new indicator, apply iMA with indication of the "incomplete" handle, then CopyBuffer() all buffers of the "incomplete" and the buffer of iMA. Thus, we obtain a ready indicator that works as it should be.

How terribly you describe it). You don't have anything ready?
 
igorbel:

How terribly you described it). Don't you have anything ready?

In a very crude version, it's embarrassing to even show. I've been thinking about it for a long time, but just today I decided to check it out.

You know, there is nothing to be afraid of. The resources are quite clear in the documentation at the very end about how to connect the indicators, and "unfinished", as I understand it, is already there.

Well, if only in the main lines

// Подключаем ресурс
#resource "\\Indicators\\подпапка\\test.ex5"

// В OnInit()

   handle = iCustom(_Symbol, PERIOD_CURRENT, "::Indicators\\подпапка\\test.ex5", параметры через запятую);
   handMA = iMA(_Symbol, PERIOD_CURRENT, 21, 0, ENUM_MA_METHOD, handle);

// В OnCalculate
// Для всех буферов "недоделки"
CopyBuffer(handle...
// и для iMA в свой буфер.
CopyBuffer(handMA...

PS; Here's what I found when I got the idea to connect the indicator "unfinished" resource

Forum on trading, automated trading systems and trading strategies testing

Discussing the article "Indicator by Indicator in MQL5"

Alexey Viktorov, 2017.01.31 19:31

Compared to iMAOnArray() from mql4 it's a tambourine dance.



And here's a crazy idea: if the indicator is attached as a resource, is it possible to get its handle? Would it be possible to combine them? In order to avoid carrying two indicators, the indicator itself and the indicator of this indicator. I don't use any resource, that's why it's hard to check, that's why I'm asking.

Документация по MQL5: Программы MQL5 / Ресурсы
Документация по MQL5: Программы MQL5 / Ресурсы
  • www.mql5.com
Программы MQL5 / Ресурсы - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Vladimir Karputov:


How do you access history of someone else's period? What checks do you perform to check access result? What error codes do you get?

In "liquid" indicators, there is the concept of a "base" period on which the indicator is based. This is probably what you call someone else's period, as I understand it.

There are no error codes in "Expert Advisors". The indicators are just not drawn and that's all.


For them to start drawing, I had to open charts of all missing basic periods in each profile. But in the past it all worked for several years

without that. I have no idea how it worked, where it was accessed and how it was checked, because I am not a programmer.


But I'm not the first one in history, I guess. There has to be some kind of procedure, as I understand it. I have no way of knowing if this is the result of some kind of glitch in the update.

Either everything is correct there and my indicators just need to be redone. You have to define it somehow, after all. And you have one principle: it is up to the drowning men to save the drowning men.

 
Agat:

In "liquid" indicators, there is the concept of a "base" period on which the indicator is based. This is probably what you call someone else's period, as I understand it.

There are no error codes in "Expert Advisors". The indicators are just not drawn and that's all.


In order to start drawing them, I had to open charts of all missing basic periods in each profile. But in the past everything was working for several years

without that. I have no idea how it worked, where it was accessed and how it was checked, because I am not a programmer.


But I'm not the first one in history, I guess. There must be some kind of procedure, as I understand it. I can't know if it's the result of some glitch in the update

or if everything is correct and my indicators just need to be redone. Somehow it has to be determined after all. And you have one principle: it is up to the drowning men to save the drowning men.


If they are not your indicators, contact the author and ask for answers to the questions I posed above. Without that you cannot say anything definitively.
Reason: