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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X