Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with draw.text

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

    #46
    isAutoScale will automatically adjust the scale of the chart so that the object will be visible along with the ChartBars.

    The Anchor time is time stamp of the bar your code is drawing the bar on. So if you want to draw it on another bar, you would need to call Draw.Text on a different bar. Although 1800 is very unexpected, there could be something else going on.

    You could also use the overload that allows you to specify DateTime instead of barsAgo.

    Draw.Text(NinjaScriptBase owner, string tag, bool isAutoScale, string text, DateTime time, double y, int yPixelOffset, Brush textBrush, SimpleFont font, TextAlignment alignment, Brush outlineBrush, Brush areaBrush, int areaOpacity)


    Basically if you are able to see the draw object in the list of drawing objects and when you check 'isAutoScale', there isn't anything wrong going in the code - the script is successfully creating the object where you are specifying the object to be. If you wanted it to be closer to the bars then you would just need to change the y parameter. Because you are passing 10 and 20 this is going to be very far away from the bars, you're saying you want to the object to be drawn at y = 10 or y = 20 which is the price scale. There are likely no instruments are going to have prices that low.

    Comment


      #47
      thanks for explanation.
      BTW, do you know what value do I set for the following properties? are they going to impact the drawing object?

      IsOverlay = false;
      DrawOnPricePanel = true;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      333 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X