[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 317

 
kon12 писал(а) >>

Folks, a word of advice to anyone who knows. Let's say I draw a custom indicator on the main chart. Then I use another custom indicator that involves the first indicator via iCustom function. Can we connect them so that the parameter of the first indicator in the chart is automatically changed in the second custom indicator?

I don't quite understand the task, but maybe this will do :

MT Analytics Help - Technical Indicators

- For example, you can create Moving Average indicator from Awesome Oscillator and thus get a signal line in addition to AO. For that you should draw AO indicator first, and then using Drag`n`Drop technique impose MA on AO and select "Previous Indicator Data" in its settings in the "Apply to" field (impose indicator on the previous indicator's data). If you choose "First Indicator Data" then MA will be created, based on data of the first indicator, which not necessarily will be AO.

 
kon12 >> :

Folks, a word of advice to anyone who knows. Let's say I draw a custom indicator on the main chart. Then I use another custom indicator that involves the first indicator via iCustom function. Can I connect them so that the parameter of the first indicator in the chart is automatically changed in the second custom indicator?

If you call the source indicator through iCustom, you will save it somewhere, so mark it as an indicator buffer and output the source and converted indicator as two buffers of one indicator, it will be easier to run and change parameters. If you want to fool around, you may use globolvariables.

 
Urain >> :

You don't have to delete it, you can just change the parameters via ObjectSet.

ps But in general, your case needs to be looked at on a case by case basis.

Thank you!

 
kon12 >> :

Folks, a word of advice to anyone who knows. Let's say I draw a custom indicator on the main chart. Then I use another custom indicator that involves the first indicator via iCustom function. Can I bind them so that when the first indicator's parameter changes on the chart, the parameter in the second custom indicator will automatically change?

I understand that you want to manually change the value of the input parameter of the indicator in the terminal and the other indicators will react on this change?

Then the answer is clear - using iCustom will not work. This function works in the following way - the indicator with the parameters you have specified is "created" in the program memory (not on the chart) ("as if", I mean, it is not plotted), and at the first call it is processed using the init() and start() functions, i.e. if there is a "standard" cycle like for(i=limit;i>=0;i--), all the necessary bars are calculated. Then the next time iCustom is called, the recalculation is not performed (if it is not explicitly specified in the indicator body). There are no separate buffers assigned for such indicators in MQL, so if you need to store the values, it's reasonable to copy them into a separate buffer. There is no direct access to the charts in MQL also (but it would be useful IMHO).

 

Thank you for your replies, I may not have formulated what I want accurately. Let me explain: I use a ZigZag indicator on the main chart. In addition I use my own indicator that shows the wavelengths shown by the zigzag. The indicator accesses the zigzag through iCustom. But at changing of parameters of zigzag, I should enter the second indicator and set same parameters there. How to change parameter in zigzag only. In Metastocke, I just overlay the second indicator on the first one and that's it.

 
Since I seem to have understood the question correctly, I will answer it again: using Metatrader and MQL - no way
 
alsu >> :
Since I seem to have understood the question correctly, I answer it once again: using Metatrader and MQL, no way

No, why. You can pass parameter through global variable, graph object. You will need only a tick to redraw it, but you know about it.

Of course, it would be better to unite the indices.

 
Svinozavr >> :

No, why. You can pass parameter through global variable, graph object. You just need a tick to redraw it, but you can do it, you know.

Of course, it would be better to unite the indices.

Well, to make it "that", it's not a beginner's level... In general, I wondered for a long time whether there is not a universal environment for each indicator to register its real buffers (well, those where "actually" the data is stored) in a shared address space or, at the worst, as global variables. Then it would be possible to apply to charts directly from MQL instead of iCustom... I still haven't got around to it.

 
alsu >> :

well, to make it "that", it's kind of beyond beginner's level... In general, I was wondering for a long time if not to make a universal environment, so that each indicator registers its real buffers (you know, the ones where "real" data is stored) in a shared address space or, at the worst, in the form of global variables. Then it would be possible to apply to charts directly from MQL instead of iCustom... I still haven't got around to it.

That would be cool. Very limiting is the inability to synchronise the indicators normally. I have to either synchronize them as I wrote or combine them.

But the drawing problem cannot be solved using the standard means, except for drawing in different sub-curves from one indicator. And probably, not even with internal means. If we were able to bind the buffer to the window number like a gr.object, or even generate such a window from the indicator, then... Well, it's just off-topic.

===

But the idea of the environment is very practical. Do you have any ideas about it?

 
Maybe a separate thread?
Reason: