Objects, Expert and Indicator.

 
Hi Slawa,
I have a custom indicator and have certain OBJECT chart on my screen design by the custom indicator and the final output value in the buffer #1
If I access my custom indicator from the Expert and want expert not to touch these Objects:

1) Do I have to somehow create objects for use by the indicator only and disallow it to be used by the Expert?

My problem is that the indicator is accessed twice:
a) By tick directly to indicator and;
b) By same tick from the Expert iCustom() call in which case some of the objects will get messed up.

When the iCustom() call is initiated, I want to get only a value from the buffer #1 which was generated by the indicator based on its tick.
I do not want Expert to make its own pass over the graphics.
2) Can I do that?

OR

3) Must I design my custom indicator in such way that when the Expert iCustom() call comes it must make pass and make its own output value in the buffer #1 which will be independent from value in the buffer #1 generated by the indicator during its pass in which case I will not generate Objects?

I am sorry but I have somehow a mental block about this and cannot grasp what is exactly going on inside the indicator when the Expert calls via the iCustom() function.
 
You can add one more parameter to your custom indicator, extern bool ObjectFlag (or ExpertFlag) for recognition of calling source.
 
You can add one more parameter to your custom indicator, extern bool ObjectFlag (or ExpertFlag) for recognition of calling source.

Thanks Slawa,
I am aware of it and have done that and it works a OK now with the Objects.
So when the FromExpert=1 no objects are disturb.

However, I am pulling my hair, what is left of it.

It appears that the Expert has mine of its own and I do not know what that mine is.
For example: When I am debugging the indicator it will not execute some section of program same for Expert tick and Indicator tick.
I can clearly set up a trap and under no circumstance it will execute simple task like set o clear a variable.

Slawa is there any detail explanation how the Expert internally interfaces to Indicator?
For example: If I have an Indicator variable, does the Expert create internal a mirror of that variable for Expert tick and Indicator tick.
Somehow the expert is trying to do some sort of internal arbitration and I do not know the principles.
HELP!
HELP!
HELP!
I am desperate!

I need to know what happens when the Expert tick pass is happening and Indicator tick pass is hapenning. inside of the indicator.
 
Tick incomes
Attached indicators are calculated
Then attached expert launched in their own thread.
Expert calls indicators in their own thread. There are independent instances of indicators, but they can work with shared objects on the same chart.
If next tick incomes then attached indicators are calculated. There may be conflict if launched expert still works (in their own thread)
 
Tick incomes
Attached indicators are calculated
Then attached expert launched in their own thread.
Expert calls indicators in their own thread. There are independent instances of indicators, but they can work with shared objects on the same chart.
If next tick incomes then attached indicators are calculated. There may be conflict if launched expert still works (in their own thread)


Slawa,

I need to accomplish very simple task which is to make available a value calculated by the Indicator to the Expert during the same tick as follows.

A tick activate start() indicator and value is stored in the Global Variable of the indicator by GlobalVariableSet()
Same tick as above will activate start() Expert and value is fetched by GlobalVariableGet().

FAQ 1: Can I do that?
FAQ 2: If so can I establish reliable handshake to guarantee that GlobalVariableGet() of the Expert will receive a value from GlobalVariableSet() of the Indicator during the same tick?
 
There may be considered TWO indicators - first attached to the chart, second called from expert.
If You do not call indicator from expert then You may be sure that indicator attached to the chart calculated (and set global variable) before expert will be launched. And your expert can get GlobalVariable value safety.
Reason: