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 jxs_xrj, 01-12-2020, 09:49 AM
        5 responses
        3,290 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        7 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        61 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        8 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        24 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X