usingcAlgo.API;namespacecAlgo{// This sample indicator shows how to use TextChangedEventArgs[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]publicclassTest:Indicator{protectedoverridevoidInitialize(){varstackPanel=newStackPanel{BackgroundColor=Color.Gold,HorizontalAlignment=HorizontalAlignment.Center,VerticalAlignment=VerticalAlignment.Center,Opacity=0.6,};vartextBox=newTextBox{Text="Enter text here...",FontWeight=FontWeight.ExtraBold,Margin=5,ForegroundColor=Color.White,HorizontalAlignment=HorizontalAlignment.Center,Width=150};textBox.TextChanged+=OnTextBoxTextChanged;stackPanel.AddChild(textBox);Chart.AddControl(stackPanel);}privatevoidOnTextBoxTextChanged(TextChangedEventArgsobj){Print("Text box text changed to: ",obj.TextBox.Text);}publicoverridevoidCalculate(intindex){}}}
1 2 3 4 5 6 7 8 910111213141516171819202122
importclrclr.AddReference("cAlgo.API")fromcAlgo.APIimport*classTest():definitialize(self):stackPanel=StackPanel()stackPanel.BackgroundColor=Color.GoldstackPanel.HorizontalAlignment=HorizontalAlignment.CenterstackPanel.VerticalAlignment=VerticalAlignment.CenterstackPanel.Opacity=0.6textBox=TextBox()textBox.Text="Enter text here..."textBox.FontWeight=FontWeight.ExtraBoldtextBox.Margin=Thickness(5)textBox.ForegroundColor=Color.WhitetextBox.HorizontalAlignment=HorizontalAlignment.CentertextBox.Width=150textBox.TextChanged+=self.on_text_box_changedstackPanel.AddChild(textBox)api.Chart.AddControl(stackPanel)defon_text_box_changed(self,args):print(f"Text box text changed to: {args.TextBox.Text}")