Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A few programming questions

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

    A few programming questions

    I have a couple of indicators that I use and they place objects and text onto the chart above and below bars. The problem I'm having is that the text from different indicators collide and so can't be read easily. Is there a technique for making sure that they don't write on top of each other? I woudl prefer them to stack vertically below/above each other.

    Second question. Is there a Z-index parameter i can use when I want to add something like a rectangle to the chart so that i can place it behind the bar?

    #2
    Hello vlc,
    Thanks for your post and I am happy to assist you.

    If you are placing the DrawObjects above the High then try using the x * TickSize to create some gaps between the 2 objects so that they do not overlaps. So if you want to place the Text object “Hello” from indicator 1 and “World” from indicator 2, then use the following.
    In indicator 1
    Code:
    this.DrawText("indicator 1", "Hello", 0, High[0] +  [B]2 * TickSize[/B], Color.Green);
    in indicator 2
    Code:
    this.DrawText("indicator 2", "World", 0, High[0], Color.Blue);
    adjust 2 * TickSize to suit your need.


    Unfortunately, we do not support ZOrder, but some customers have found success using
    Code:
    ZOrder = -1;
    but as a note of caution, the same may conflict if you try using the same across indicators.

    Please do let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      OK, will try those.
      So I can't get any position properties of other unknown text already on the chart.

      Comment


        #4
        Hello vlc,
        Thanks for your post.
        An indicator/strategy can read only DrawObjects drawn by itself or manually drawn by user. However there may be some functions in the ChartControl class, which is unfortunately not supported by us.
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        554 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