Unique ID Generator for a Particular Indicator - page 2

 
angevoyageur:
What is the problem with subwindow number ?
I'm not sure what you are thinking of but, when applying a template or reloading, a value such as CHART_WINDOWS_TOTAL is reported as the total indicators on the chart, not the total loaded so far (i.e. doesn't increase one by one as each indicator is initialised).
 
gchrmt4:
I'm not sure what you are thinking of but, when applying a template or reloading, a value such as CHART_WINDOWS_TOTAL is reported as the total indicators on the chart, not the total loaded so far (i.e. doesn't increase one by one as each indicator is initialised).

Ok, subwindow isn't reliable, as it can change.
 
angevoyageur:
What is the problem with subwindow number ?

With the 610/614 it was nearly impossible to retrieve it correctly from the indicator itself, in 616 if is mostly fixed, but still it fails in DeInit().
 
Ovo:

With the 610/614 it was nearly impossible to retrieve it correctly from the indicator itself, in 616 if is mostly fixed, but still it fails in DeInit().
ChartWindowFind() seems working for me. Anyway, it's not reliable, as if you remove an indicator then add an other, subwindow number is changed.
 
angevoyageur:
ChartWindowFind() seems working for me. Anyway, it's not reliable, as if you remove an indicator then add an other, subwindow number is changed.
Same issue with ChartWindowFind() as with the old WindowFind(): it's useless if there's more than one instance of the same indicator, e.g. two RSI windows showing calculations for different periods (or the same period, but changes in other parameters which aren't reflected in any call to IndicatorShortName).
 
gchrmt4:
Same issue with ChartWindowFind() as with the old WindowFind(): it's useless if there's more than one instance of the same indicator, e.g. two RSI windows showing calculations for different periods.

This is what I said, unreliable.

It's an interesting problem. As I think it only make sense to add the same indicator several time when you are using different input parameters, a way would be to form a signature from these parameters. Or of course one of the solution you proposed previously.

 
gchrmt4:
Same issue with ChartWindowFind() as with the old WindowFind(): it's useless if there's more than one instance of the same indicator, e.g. two RSI windows showing calculations for different periods (or the same period, but changes in other parameters which aren't reflected in any call to IndicatorShortName).

In fact ChartWindowFind is already working for indicators in 616, except the OnDeinit. But still too wet to be considered stable, so I like to avoid it in any ID creation.

Thank you for the input, I will pick either the file lock or waiting for the GetTickCount change. I have to trial.

 
angevoyageur:

This is what I said, unreliable.

It's an interesting problem. As I think it only make sense to add the same indicator several time when you are using different input parameters, a way would be to form a signature from these parameters. Or of course one of the solution you proposed previously.


I take advantage from the new MQL4 GUI abilities to set and change parameters on the fly. So the signature at the start is the same, and still it has sense to add it multiple times. Not mentioned, that if it was possible, that it should have behaved correctly.
 
Ovo:

In fact ChartWindowFind is already working for indicators in 616, except the OnDeinit. But still too wet to be considered stable, so I like to avoid it in any ID creation.

Thank you for the input, I will pick either the file lock or waiting for the GetTickCount change. I have to trial.

While reading this, I taught about using time like GetTickCount above.

Then I taught about __DATETIME__ File compilation date and time.

https://docs.mql4.com/constants/namedconstants/compilemacros

What do you guys think about that?

 

Not sure if you meant "taught".

I use a few of them for debugging, but for __DATETIME__ I did not find any use yet... where are you aiming at?