Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Library/Resources

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

    Drawing Library/Resources

    Hi all. I have written a few simple indicators using a combination of the strategy builder and my own coding. I use Draw.Dot and Draw.Diamond a fair bit above and below price bars. If initiating the code in the strategy builder I always select "AutoScale" for their size, but when they render on the chart they appear larger than I like...especially when I zoom out to see a lot of data in one panel. I see other, more custom indicators that have much smaller dots and diamonds...where does one access these types of drawing items? Thanks.

    90

    #2
    Hello 90,

    These drawing objects can't be resized.

    You would have to custom render your own objects if you want that.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by 90bideven View Post
      Hi all. I have written a few simple indicators using a combination of the strategy builder and my own coding. I use Draw.Dot and Draw.Diamond a fair bit above and below price bars. If initiating the code in the strategy builder I always select "AutoScale" for their size, but when they render on the chart they appear larger than I like...especially when I zoom out to see a lot of data in one panel. I see other, more custom indicators that have much smaller dots and diamonds...where does one access these types of drawing items? Thanks.

      90
      The easiest solution is instead of using Draw.Dot and Draw.Diamond simply use the Draw.Text syntax that includes Font group and Font size. Such as bellow:

      Code:
       textFont                 = new SimpleFont("Wingdings",12 );
      
      Draw.Text(NinjaScriptBase owner, string tag, bool isAutoScale, string text, int barsAgo, double y, int yPixelOffset, Brush textBrush, SimpleFont font, TextAlignment alignment, Brush outlineBrush, Brush areaBrush, int areaOpacity)
      
      Example:
      
      Draw.Text(this,"My Obj"+CurrentBar.ToString(), true, "t", 0, middle, 0, Brushes.Red, textFont , TextAlignment.Center, Brushes.Transparent, Brushes.Transparent, 50);
      Simply use characters from Wingdings and Webdings font groups. Use any character that you like (dot, diamonds, triangles, etc. ). Now you can use your custom font size as small or large as you want. If you change your bar size your markers will not change.
      Last edited by aligator; 12-21-2021, 06:09 PM.

      Comment


        #4
        Cool, thanks to the both of you, I will dig into these solutions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X