Edit Icon Comment free

by Capt.Z-Fort.Builder in category Other at 04/10/2022
Description

This indicator is to solve the problem ver 4.4.12 removed to access and edit the icon's comments
For problem details, please see: https://ctrader.com/forum/ctrader-support/39021
Usage:
1. Select Icon, Alt + D to popup a ChartText with the icon's comment;
2. Edit ChartText as needed;
3. Alt + D to save revised comments, hit again to hide popup ChartText;

Interested in the currency strength meter in the chart?
Get the free download link at Telegram Group: cTrader FOREX Club

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using cAlgo.API;
namespace cAlgo

//This indicator is to solve the problem ver 4.4.12 removed to access and edit the icon's comments
//Problem details see: https://ctrader.com/forum/ctrader-support/39021
//Usage:
//1. Select Icon, Alt + D to popup a ChartText with the icon's comment;
//2. Edit ChartText as needed;
//3. Alt + D to save revised comments, hit again to hide popup ChartText;
//
//Ver 1.01 Optimise : Short cut key change to only Alt + D, save and hide ChartText;
//    1.02 Optimise : Short cut key change to only Alt + D, unhide, save and hide ChartText;
//                  : Temporarily fill with 'empty...' if Icon has no comment;


{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class EditIconCmmt : Indicator
    {
        string s_objnme, s_objsve, s_objcmt;
        private ChartText tx_Cmmt;

        protected override void Initialize()
        {
            Chart.KeyDown += Chart_KeyDown;                                     //HotKeys to SaveChange;
            Chart.ObjectsSelectionChanged += Chart_ObjectsSelectionChanged;     //Select Icons to popup comments in ChartText;
        }

        private void Chart_ObjectsSelectionChanged(ChartObjectsSelectionChangedEventArgs obj)
        {
            if (obj.ObjectsAddedToSelection.Count>0)
            {   
                s_objnme = obj.ObjectsAddedToSelection[0].Name;                                         //Find LastSelect Icon
                if (obj.ObjectsAddedToSelection[0].ObjectType.ToString() == "Icon" ) 
                {
                    s_objsve = s_objnme; s_objcmt = obj.ObjectsAddedToSelection[0].Comment;             //Remember SelectIconName, Comment
                    var icons = Chart.FindAllObjects(ChartObjectType.Icon);
                    foreach (ChartIcon icon in icons) 
                    { 
                        if ( icon.Name.Equals(s_objnme) ) 
                        { 
                            tx_Cmmt = Chart.DrawText("Cmmt_Tx", " ", Bars.Count, 0, Color.Transparent); //Prepare a ChartText to display select icon comments;
                            tx_Cmmt.FontSize = 14; tx_Cmmt.Time = icon.Time; tx_Cmmt.Y = icon.Y; 
                            tx_Cmmt.Text = icon.Comment == "" ? "empty..." : icon.Comment; tx_Cmmt.Color = icon.Color;
                            tx_Cmmt.IsHidden = true; tx_Cmmt.IsInteractive = false;
                        }
                    }
                }
            }
        }

        private void Chart_KeyDown(ChartKeyboardEventArgs obj)
        {   
            if (obj.AltKey)
            {
                if (obj.Key.Equals(Key.D))  //To Show, Save revised comment in Icon, hit again to Hide ChartText
                {
                    if (tx_Cmmt.IsHidden) { tx_Cmmt.IsHidden = false; tx_Cmmt.IsInteractive = true; }   //First hit to show comment;
                    else 
                    {
                        if ( tx_Cmmt.Text != s_objcmt && tx_Cmmt.Text != "empty...")                    //Hit again to save if comment changed;
                        {
                            var icons = Chart.FindAllObjects(ChartObjectType.Icon);
                            foreach (ChartIcon icon in icons) { if ( icon.Name.Equals(s_objsve) ) { icon.Comment = tx_Cmmt.Text; s_objcmt = tx_Cmmt.Text; } }
                            Chart.DrawStaticText("S&H", string.Format("{0} comment saved...", s_objsve), VerticalAlignment.Bottom, HorizontalAlignment.Right, Color.Red);
                        }
                        else                                                                            //Hit again to hide comment TextBox;
                        {
                            tx_Cmmt.IsHidden = true; tx_Cmmt.IsInteractive = false;
                            Chart.DrawStaticText("S&H", string.Format("{0} comment hidden...", s_objnme), VerticalAlignment.Bottom, HorizontalAlignment.Right, Color.Transparent);
                        }
                    }
                }
            }
        }

        public override void Calculate(int index)
        {
        }
    }
}
Comments

among012a - October 04, 2022 @ 12:56

Prepare for a thrilling journey into the mythical world of fireboy and watergirl. There are deadly traps and enthralling puzzles in store for you!

run3donlineaz - October 07, 2022 @ 11:57

Your comments on the forum are very reasonable, hope you add comments to the play snake website for us to improve further, and thank you for your comments.

seboxi8126 - October 13, 2022 @ 04:50

Your sharing is very reasonable and extremely helpful. I also like how your writing is very easy to read and understand. with wordle hint to find the most correct answer yourself.

offpageseo69 - October 17, 2022 @ 21:13

This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post! Cloudflare Review

offpageseo69 - October 17, 2022 @ 21:16

Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!! Paramount Plus Free Trial

offpageseo69 - October 17, 2022 @ 21:18

I have a mission that I’m just now working on, and I have been at the look out for such information Paramount Plus

offpageseo69 - October 17, 2022 @ 21:20

Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing. Article Rewriter

offpageseo69 - October 17, 2022 @ 21:22

Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! Sling TV free trial

offpageseo69 - October 17, 2022 @ 21:23

I think I have never seen such blogs ever before that has complete things with all details which I want. So kindly update this ever for us. Best Shows on HBO Max

offpageseo69 - October 17, 2022 @ 21:25

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Funny Wi-Fi Names

offpageseo69 - October 17, 2022 @ 21:27

There is definately a great deal to know about this subject. I like all of the points you've made. Jokes for Kids

offpageseo69 - October 17, 2022 @ 21:28

You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog. favorite pages

offpageseo69 - October 17, 2022 @ 21:32

I see some amazingly important and kept up to length of your strength searching for in your on the site Mother’s Day 2023

offpageseo69 - October 17, 2022 @ 21:34

Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! Manga for Free

offpageseo69 - October 17, 2022 @ 21:45

Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! Doodly Reviews

offpageseo69 - October 17, 2022 @ 21:49

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job ! Doodly

offpageseo69 - October 17, 2022 @ 21:50

I see some amazingly important and kept up to length of your strength searching for in your on the site Best Laptops

offpageseo69 - October 17, 2022 @ 21:52

Glad to chat your blog, I seem to be forward to more reliable articles and I think we all wish to thank so many good articles, blog to share with us. Iconic Cartoon Characters

offpageseo69 - October 17, 2022 @ 21:54

I have read your excellent post. This is a great job. I have enjoyed reading your post first time. I want to say thanks for this post. Thank you... GETTR

offpageseo69 - October 17, 2022 @ 21:55

I have express a few of the articles on your website now, and I really like your style of blogging. I added it to my favorite’s blog site list and will be checking back soon… His Secret Obsession

offpageseo69 - October 17, 2022 @ 21:57

This is an awesome motivating article.I am practically satisfied with your great work.You put truly extremely supportive data. Keep it up. Continue blogging. Hoping to perusing your next post Toonly Review

offpageseo69 - October 17, 2022 @ 21:59

Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! Soulmate Drawing

offpageseo69 - October 17, 2022 @ 22:01

A debt of gratitude is in order for sharing the information, keep doing awesome... I truly delighted in investigating your site. great asset... Speechelo

offpageseo69 - October 17, 2022 @ 22:03

You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog. Obsession Method

offpageseo69 - October 17, 2022 @ 22:04

Hi, I log on to your new stuff like every week. Your humoristic style is witty, keep it up HBO Max free trial

offpageseo69 - October 17, 2022 @ 22:05

This is also a very good post which I really enjoyed reading. It is not every day that I have the possibility to see something like this.. Exipure

offpageseo69 - October 17, 2022 @ 22:06

Super site! I am Loving it!! Will return once more, Im taking your food likewise, Thanks. ESPN Plus Free Trial

offpageseo69 - October 17, 2022 @ 22:07

I’m happy I located this blog! From time to time, students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. nice one Discovery Plus Free Trial

5