Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I align text to the left of the chart, but at a particular price?

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

    How do I align text to the left of the chart, but at a particular price?

    I understand that I can use Draw.Text() to specify a particular price and a particular bar, but I want to be aligned to the left (or right) of the chart. Is there a way to determine the left-most, visible bar on the chart?

    I understand that I could use Draw.TextFixed(), but this is mainly for positioning at the corners or edges of the chart and not at a particular price.

    Is there a hybrid way of doing this?

    I've done it before in NT7 using a complicated approach by overriding Plot(), but I was hoping for a more elegant way in NT8. What is the replacement approach in NT8 for tasks we originally accomplished by overriding the Plot()?

    Any help is greatly appreciated!

    #2
    Originally posted by neoikon View Post
    Is there a way to determine the left-most, visible bar on the chart?
    Yes, ChartControl.FirstTimePainted. This is documented as well with NT8.

    I understand that I could use Draw.TextFixed(), but this is mainly for positioning at the corners or edges of the chart and not at a particular price.

    Is there a hybrid way of doing this?
    ChartScale.GetYByValue(), this is documented as well.

    I've done it before in NT7 using a complicated approach by overriding Plot(), but I was hoping for a more elegant way in NT8. What is the replacement approach in NT8 for tasks we originally accomplished by overriding the Plot()?
    NT8 uses OnRender() as the new Plot() method for drawing. There are plenty of Indicators that use this method, best one to start with is the CustomPlotSample

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by JTizz, Today, 03:32 PM
    1 response
    35 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by ebaydan777, Today, 02:41 PM
    1 response
    28 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by aligator, Today, 02:28 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by daniel_weber8, Today, 01:21 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChristopherS  
    Started by jungsoohuh, Today, 12:07 PM
    1 response
    37 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Working...
    X