Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Time to express X coordinate is not accurate

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

    Using Time to express X coordinate is not accurate

    Hi
    I develop indicator in NT 8
    The indicator uses SharpDx to draw rectangles, one rectangle per bar.
    The rectangle x coordinate and width need to be very accurate so that the rectangle will reside "inside the bar" and fit the width of the bar.
    This technique worked perfect except the fact that I can not assign zorder to SharpDX draw object in order to draw the rectangle behind the bar.
    To overcome this I decided to draw the rectangle using the draw tool.
    Based on my previous and working calculation of the rectangle location and size
    I calculated Start X loction of rectangle (xstart) and End X loction of rectangle (xend) and
    calculated
    DateTime StartTime = ChartControl.GetTimeByX((int)(xstart ));
    DateTime EndTime = ChartControl.GetTimeByX((int)(xend ));


    As in order to draw the rectangle the X coordinated is expressed in Time .

    Draw.Rectangle(this, Tag, StartTime, LowClusterPrice, EndTime, HighClusterPrice, Brushes.Blue);

    The result of this was not good as the X location of the rectangle were not accurate as before. Probably as the result of working with time and not as I draw with SharpDx
    what can be done to solve it ?

    The interface to build draw object include BarAgo or Time , why it does include X coordinate ? ( while converting from X to time and back to X we probably loss accuracy )


    #2
    Hello,

    Thank you for the question.

    For X,Y precision the OnRender would need to be utilized.

    Regarding the Drawing Objects, they would be locked to the bars as you have noticed so there would not be a way to move these to specific coordinates like OnRender.

    With that being said, I will submit feature requests for both adding overloads for specific coordinates with Drawing Objects if possible, and also for ZOrder while using OnRender if possible.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rocketman7, Today, 09:41 AM
    5 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frslvr, 04-11-2024, 07:26 AM
    9 responses
    124 views
    1 like
    Last Post caryc123  
    Started by selu72, Today, 02:01 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by WHICKED, Today, 02:02 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by f.saeidi, Today, 12:14 PM
    8 responses
    21 views
    0 likes
    Last Post f.saeidi  
    Working...
    X