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 Taddypole, 04-26-2024, 02:47 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by futtrader, 04-21-2024, 01:50 AM
        6 responses
        58 views
        0 likes
        Last Post futtrader  
        Started by sgordet, Today, 11:48 AM
        0 responses
        4 views
        0 likes
        Last Post sgordet
        by sgordet
         
        Started by Trader146, Today, 11:41 AM
        0 responses
        5 views
        0 likes
        Last Post Trader146  
        Started by jpapa, 04-23-2024, 07:22 AM
        2 responses
        19 views
        0 likes
        Last Post rene69851  
        Working...
        X