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 sjsj2732, 03-23-2026, 04:31 AM
    0 responses
    42 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    295 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    290 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    135 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    98 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X