Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Draw.Text ...Distance Draw ..

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

    Problem Draw.Text ...Distance Draw ..

    hi, look at pics



    i want draw 2 string ..in different time..

    the value's string is egual...it draw in the same line...

    i want to draw the second string under first Draw...

    The level of draw is the same....but in the second Draw i would like to draw under the first...

    To do this i'll know size of First string and to sum value in the second...?

    Or there is another method?

    Draw.Text(NinjaScriptBase owner, string tag, string text, int barsAgo, double y)

    Double Y is a level to draw it....but i can't to change it because every symbols have its own scale
    Last edited by turbofib; 08-26-2016, 07:44 AM.

    #2
    Hello turbofib,

    A few choices you have would be to use math to figure out a distance based on the TickSize value. The lower the tick size (smaller decimal value) the more it spaces the objects out by picking a price further away (increasing the number of ticks the text box will be drawn from the bar).

    Or you could make an input for the user to set for the number of ticks from the bar the text will be drawn.

    Either choice would be for setting the y value.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok..but the problem is when i stretch vertical the chart...

      Look at examples :





      i would to like to fixed it....not depending to stretch

      Comment


        #4
        Hello turbofib,

        If you are trying to have a text box automatically move to a new price level when adjusting the scale so that it stays in view, this is going to require very complicated code.

        You will need to override the Plot method which is not documented in the NinjaTrader help guide. The Plot method provides actual x and y values on the chart. You would need to find a new price level based on the top and bottom of the chart.

        (If you wanted to choose a y value without this being placed to an actual price level, you would no longer be able to use DrawText() and instead you would need to use the graphics library to create your own text.)

        Below is a link to another forum thread where a community member has posted helpful unsupported code for coverting a y value to a price
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by frankthearm, Yesterday, 09:08 AM
        14 responses
        47 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by gentlebenthebear, Today, 01:30 AM
        2 responses
        13 views
        0 likes
        Last Post gentlebenthebear  
        Started by Kaledus, Today, 01:29 PM
        2 responses
        8 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        56 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X