Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetYByValue

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

    GetYByValue

    Hi,
    I guess this is not supported in Ninja 8

    ChartControl.GetYByValue(this, price);


    So I looked at using

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
      // gets the pixel coordinate of the price value passed to the method
      int     yByValue = chartScale.GetYByValue(Close[0]);
     
      Print("yByValue: " + yByValue); // 207
    }
    the problem is that I have many plots, and when I use this override, even if I have nothing in the brackets, it causes my plots to stop painting.

    Is there an efficient way to get GetYByValue?

    Thanks in advance

    #2
    Hello KhaosTrader,

    Add
    Code:
    base.OnRender(chartControl, chartScale);
    to the first line of OnRender().

    This will allow the other plots to render as well.

    The ChartScale is provided by OnRender. After it is available you could save this to a handle (variable) and use this how you would like. Generally it is most efficient to use a condition to trigger your code only when necessary (instead of on each pass of OnRender().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi There,

      When I override Render, my usercontrolcollection buttons stop showing up. Even with
      base.OnRender(chartControl, chartScale);
      What can I do?

      Comment


        #4
        I figured it out. Thanks

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        16 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,407 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Working...
        X