Attachments forums

List of attachments posted on this forum.


All files on forums: 159916

Re: Something interesting from Chatgpt/AI please post here

JohnL33, Tue Jul 22, 2025 12:34 am

JohnL33 wrote: Sat Jul 12, 2025 2:17 pm A! ShowPips_Binary
The Fix
The solution is identical to the previous examples: add the object cleanup logic to the very beginning of the OnInit() function. This ensures that every time the indicator loads, it starts with a completely clean slate.
Define Object Prefix: The OnInit() function first defines the unique obj_prefix.
Delete Old Objects: We will add ObjectsDeleteAll(0, obj_prefix); right after the prefix is defined. This command will find and delete all objects from any previous instance of this indicator on the chart.
Redraw Chart: A ChartRedraw() call makes the deletion visually immediate.
This small addition makes your code robust and prevents any "ghost" objects from remaining on the chart.
All files in topic