Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fixed Text On chart

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

    Fixed Text On chart

    I am trying to put values on my chart in the lower right hand corner. I would like a s
    string of 3 values.

    When I use drawtextfixed they all populate on top of each other is there a way to spread them out. I was try to concact them into one string but I do not think I was able to get the syntax correct if that is the solutions

    any help would be appreciated


    code below





    double Spread = Close[0] - Close[BarsBack];
    double AdxUp1 = ADX(9)[0];
    double AdxUp2 = ADX(9)[2];

    DrawArrowDown(
    "TopMarker", barsBack, High[barsBack] + 3*TickSize, Color.Yellow);
    DrawArrowUp(
    "BottomMarker", barsBack, Low[barsBack] - 3*TickSize, Color.Yellow);

    DrawTextFixed(
    "barsBack", Spread.ToString("N4"), TextPosition.BottomRight, Color.Blue, new Font("Arial", 12), Color.Empty, Color.Empty, 0);

    DrawTextFixed("ADXstart", AdxUp1.ToString("N4"), TextPosition.BottomRight, Color.Red, new Font("Arial", 12), Color.Empty, Color.Empty, 0);

    DrawTextFixed(
    "ADXsecond", AdxUp2.ToString("N4"), TextPosition.BottomRight, Color.Green, new Font("Arial", 12), Color.Empty, Color.Empty, 0);


    #2
    You can use DrawText() instead to specify an exact location.

    For example
    Code:
    DrawText("tag1u", true, "my text", column2X, 4.5, 0, color1, textFont, StringAlignment.Center, Color.Empty, Color.Empty, 5);
    						
    DrawText("tag2u", true, "my other text", column2X, 3.5, 0, color2, textFont, StringAlignment.Center, Color.Empty, Color.Empty, 5);
    The above would draw text on two different y coordinates but on the same x coordinate.

    You can also set a background color and border color


    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by delta20 View Post
      I am trying to put values on my chart in the lower right hand corner. I would like a s
      string of 3 values.

      When I use drawtextfixed they all populate on top of each other is there a way to spread them out. I was try to concact them into one string but I do not think I was able to get the syntax correct if that is the solutions

      any help would be appreciated


      code below





      double Spread = Close[0] - Close[BarsBack];
      double AdxUp1 = ADX(9)[0];
      double AdxUp2 = ADX(9)[2];

      DrawArrowDown(
      "TopMarker", barsBack, High[barsBack] + 3*TickSize, Color.Yellow);
      DrawArrowUp(
      "BottomMarker", barsBack, Low[barsBack] - 3*TickSize, Color.Yellow);

      DrawTextFixed(
      "barsBack", Spread.ToString("N4"), TextPosition.BottomRight, Color.Blue, new Font("Arial", 12), Color.Empty, Color.Empty, 0);

      DrawTextFixed("ADXstart", AdxUp1.ToString("N4"), TextPosition.BottomRight, Color.Red, new Font("Arial", 12), Color.Empty, Color.Empty, 0);

      DrawTextFixed("ADXsecond", AdxUp2.ToString("N4"), TextPosition.BottomRight, Color.Green, new Font("Arial", 12), Color.Empty, Color.Empty, 0);

      Write it as a single string, with line feeds.
      Code:
      [FONT=Courier New]DrawTextFixed([SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"barsBack"[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2], String1 +  "\n" + String2 +"\n" + String3[/SIZE][/SIZE][SIZE=2][SIZE=2], TextPosition.BottomRight, Color.Blue, [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] Font([/SIZE][/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"Arial"[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2], [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]12[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]), Color.Empty, Color.Empty, [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]);[/SIZE][/SIZE][/FONT]
      Last edited by koganam; 05-06-2013, 02:13 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      108 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      55 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      39 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      75 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X