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 cmoran13, Yesterday, 01:02 PM
    0 responses
    25 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    17 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    94 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X