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 Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        30 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        943 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        9 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by rocketman7, Today, 01:00 AM
        0 responses
        5 views
        0 likes
        Last Post rocketman7  
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        28 views
        0 likes
        Last Post wzgy0920  
        Working...
        X