Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sample Label Trim

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

    Sample Label Trim

    can I put these 2 forward slashs here to bypass this code and have it work correctly? It seems to work ok but not sure if there may be some problems that I'm not aware of....Thank You

    //DrawTextFixed Period", "Period: " + Period + "\nInterval:" + Interval + "\nSmooth:" + Smooth + "\nStdDev: " + NumStdDev, TextPosition.BottomRight);



    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#008000]/* Print a string at the bottom right showing all the values of our user-definable parameters.[/COLOR][/SIZE][/FONT]
    [SIZE=2][FONT=Courier New][COLOR=#008000]The use of "\n" creates a new line in our output. */[/COLOR][/FONT][/SIZE]
    [COLOR=red][B][FONT=Courier New][SIZE=2]DrawTextFixed([/SIZE][/FONT][FONT=Courier New][SIZE=2]"Period"[/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2]"Period: "[/SIZE][/FONT][FONT=Courier New][SIZE=2] + Period + [/SIZE][/FONT][FONT=Courier New][SIZE=2]"\nInterval: "[/SIZE][/FONT][FONT=Courier New][SIZE=2] + Interval + [/SIZE][/FONT][FONT=Courier New][SIZE=2]"\nSmooth: "[/SIZE][/FONT][FONT=Courier New][SIZE=2] + Smooth + [/SIZE][/FONT][FONT=Courier New][SIZE=2]"\nStdDev: "[/SIZE][/FONT][FONT=Courier New][SIZE=2] + NumStdDev, TextPosition.BottomRight);[/SIZE][/FONT][/B][/COLOR]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#008000]// In order to trim the indicator's label we need to override the ToString() method.[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ToString()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#008000]/* We return a label consisting of only the parameters we want to include. If we did not[/COLOR][/SIZE][/FONT]
    [SIZE=2][FONT=Courier New][COLOR=#008000]override this method we would have a label with all four parameters. In this example we will[/COLOR][/FONT][/SIZE]
    [SIZE=2][FONT=Courier New][COLOR=#008000]be left with only the parameters "Period" and "Interval". */[/COLOR][/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Name + [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"("[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] + Period + [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]","[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] + Interval + [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]")"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

    #2
    Sure, by this you will comment out that code section.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    578 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X