usingcAlgo.API;namespacecAlgo{// This example shows how to use the Chart ColorThemeChangeEventArgs[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]publicclassColorThemeChangeEventArgsSample:Indicator{protectedoverridevoidInitialize(){Application.ColorThemeChanged+=Application_ColorThemeChanged;}privatevoidApplication_ColorThemeChanged(ColorThemeChangeEventArgsobj){vartext=string.Format("Theme Changed To: {0}",obj.ColorTheme);Chart.DrawStaticText("text",text,VerticalAlignment.Top,HorizontalAlignment.Right,Color.Red);}publicoverridevoidCalculate(intindex){}}}
12345678
importclrclr.AddReference("cAlgo.API")fromcAlgo.APIimport*classTest():definitialize(self):api.Application.ColorThemeChanged+=self.on_application_color_theme_changeddefon_application_color_theme_changed(self,args):api.Chart.DrawStaticText("text",f"Theme Changed To: {args.ColorTheme}",VerticalAlignment.Top,HorizontalAlignment.Right,Color.Red)