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 AttiM, 02-14-2024, 05:20 PM
      12 responses
      211 views
      0 likes
      Last Post DrakeiJosh  
      Started by cre8able, 02-11-2023, 05:43 PM
      3 responses
      236 views
      0 likes
      Last Post rhubear
      by rhubear
       
      Started by frslvr, 04-11-2024, 07:26 AM
      8 responses
      114 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      10 responses
      47 views
      0 likes
      Last Post stafe
      by stafe
       
      Started by rocketman7, Today, 09:41 AM
      3 responses
      11 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X