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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        27 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X