• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 jtrading82, Yesterday, 04:05 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by sgordet, Yesterday, 08:07 PM
    1 response
    7 views
    0 likes
    Last Post bltdavid  
    Started by smcllr, Yesterday, 08:04 PM
    0 responses
    5 views
    0 likes
    Last Post smcllr
    by smcllr
     
    Started by 5element, Yesterday, 02:46 PM
    1 response
    26 views
    0 likes
    Last Post Emma1
    by Emma1
     
    Started by jeronymite, Yesterday, 04:47 PM
    0 responses
    13 views
    0 likes
    Last Post jeronymite  
    Working...
    X