Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rocketman7, Today, 02:12 AM
        0 responses
        5 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        1 view
        0 likes
        Last Post dustydbayer  
        Started by inanazsocial, Today, 01:15 AM
        0 responses
        4 views
        0 likes
        Last Post inanazsocial  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Working...
        X