Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 735

 
Please tell me how to do it.

There is an indicator and there is a library for it

How to call it from EA (only centre line is interesting). This is a graphical object, respectively no buffer that can be called via icastom, but otherwise I do not know how
Files:
 
xant:
Please tell me how to do it.

There is an indicator and there is a library for it

How do I call it from an EA (only the central line is of interest)? This is a graphical object, respectively no buffer that can be called via icastom, but otherwise I do not know how
I need to either embed it in the EA code, or run the indicator in parallel with the EA and read the position of the required object on the chart from the EA.
 
evillive:
or embed in the EA code, or run the indicator in parallel with the EA to read the position of the desired object in the chart from the EA.

Or add a buffer(s) to the indicator code and output the data of graphic objects in it(them).

SZZ did not look at sources. I just made my suggestion, because I myself have already had to insert the necessary buffers in the bufferless indicator, instead of reading the data of graphical objects.

 
The second way is clearly a dead end. I can't do the first, so I guess I'll have to do something more suited to my level)
 
xant:
The second way is clearly a dead end. I can't do the first one, so I guess I need to do something more appropriate to my level)
What is a dead end? Graphical objects are not drawn from scratch - they all have their own coordinates. At the same time, the coordinates are taken from the calculations within the indicator. It means, instead of using these calculated data for object coordinates, we should use them as data for the added buffer.
 
artmedia70:

Or add a buffer(s) to the indicator code and output graphical object data to it.

I didn't look at the source code. I just made my suggestion, because I already had to insert the necessary buffers into the bufferless indicator myself, not to read the data of graphical objects.

I had to write indicator_separate_window with buffers and graphics. So, when you call the indicator from the Expert Advisor through iCustom(), it shows on the chart the trends that have been registered in the indicator , even if there is no indicator on the chart. I even had to set NONE for colour when calling from the EA. However it was before global changes of MT builds. We have to check how it will work now.
 
AlexeyVik:
I had to write indicator_separate_window with buffers and chart. So, when iCustom() called the indicator from the EA, the trend lines were drawn on the chart, even if there was no indicator on the chart. I even had to set NONE for colour when calling from the EA. However it was before global changes of MT builds. I have to check how it will work now.

The indicator runs and does what it should do.

It's just not convenient to take the data from graphical objects into the EA - there will be no data in the tester, only in visualization mode, which is not convenient. The optimisation in general has gone up in smoke then.

 
xant:
The second way is obviously a dead end. I can't handle the first one, so I guess I need to do something more appropriate to my level)
Make a version of the indicator without objects, specifically for calling from the EA. Output the values used to build the objects to buffers, as Artem advised above.
 
artmedia70:

Well, yes, everything is correct - the indicator runs and does what it is supposed to do.

It's just not convenient to take data from graphical objects into the EA - they won't be in the tester, only in visualization mode, which is not convenient. The optimisation in general has gone to smoke at that time.

Of course you're right, but dialogues about optimization are just as dead-end as dialogues about stops or saving spreads...
 
Thanks for the replies, I have understood the gist, the issue is different for me. My level is close to zero, that is, to do what I want it will take time, and my workload is such that I can sit at most half an hour or an hour with the editor. That's why I say I'll postpone it to a better time.

Another question. I call indicator data into EA and display a comment on the screen

mad5_26=NormalizeDouble(iCustom(Symbol(),5,ind13,0,0),4);

I notice that the indicator changes values with every tick and the EA data does not. How do I fight it?

Reason: