Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot labels

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Plot labels

    Hi guys, I'm having some problems changing a plot label as follows:

    Variables

    private string ibh1 = "";


    protected override void Initialize()
    {

    Add(new Plot(new Pen(Color.Gray,1), PlotStyle.Line,ibh1));

    }

    What I'm trying to do is dynamically change that plot label to something in onbarupdate based on a condition.

    Eg: if

    if (Instrument.MasterInstrument.Name == "TF"){ibh1="1-95%";}

    The issue is the "1-95%" doesn't show up on the chart. Any ideas on this one?

    Thanks in advance
    DJ

    #2
    You can change the name of a plot in OnStartUp(). For example, if you want to change the label of the first plot, then you could use the code

    Code:
    protected override void OnStartUp()
    {
         if (Instrument.MasterInstrument.Name == "TF")
               Plots[0].Name = "1-95%";
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    582 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    338 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X