OnShow
What is it?
The OnShow
method is called when the indicator is made visible on the chart.
This includes the moment it’s re-enabled after being hidden.
Syntax
When and Why to Use It
Use OnShow
when you need to:
Re-create or re-draw custom chart objects
Restore visual elements that were removed or hidden earlier
Trigger any logic that should happen only when the indicator is visible
This method is helpful when your indicator includes dynamic elements (like shapes, labels, or highlights) that should appear only when the indicator is active.
Example
Important Notes
This method is not called during every tick or calculation — only when visibility changes.
If your indicator does not rely on custom objects or UI elements, you may not need to implement
OnShow
.
Last updated