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 funk10101, Today, 09:43 PM
        0 responses
        6 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        24 views
        0 likes
        Last Post algospoke  
        Working...
        X