Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.Dot object - controlling the brush color and the size simultaneously

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

    Draw.Dot object - controlling the brush color and the size simultaneously

    I am drawing a Dot on the chart.
    How can I control the Dot's color AND the Dot's size?

    When I look at the various syntax for the Draw.Dot object, I don't see one where I can change the Brush color and a string template in the same statement.

    Also, is the string template the way to change the Dot's size? If so, could you provide me with a quick sample.

    Syntax information:


    Thanks,

    #2
    Hello GARZONJ,

    There is actually not a way to change the dots size, this is controlled based on the charts scaling. The dots color can be controlled using the overload which includes a brush, and as you noted there is not a specific overload which allows controlling the brush and template. The templates would contain a brush so that is used instead.

    If you want to later change the color and also load a template, you would need to draw the object and then change its values:

    Code:
    Dot dot = Draw.Dot(NinjaScriptBase owner, string tag, bool isAutoScale, int barsAgo, double y, bool isGlobal, string templateName)
    dot.AreaBrush = Brushes.Gold;
    dot.OutlineBrush = Brushes.Blue;

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    78 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X