• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnRender can't draw in panel

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

    OnRender can't draw in panel

    The following sample:

    public class Sample1 : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Name =
    "Sample1";
    Calculate =
    Calculate.OnBarClose;
    IsOverlay =
    false;
    DrawOnPricePanel =
    false;
    IsAutoScale =
    true;
    IsSuspendedWhileInactive =
    true;
    }
    }
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
    RenderTarget.DrawRectangle(
    new SharpDX.RectangleF(1, 1, 200, 200), Brushes.Black);
    }
    }

    does not draw in the panel as expected, could the support tell me what's wrong? The DrawRectangle is actually using the price panel coordinates and not the current panel coordinates.

    Thanks,
    dotnet
    Last edited by dotnet; 04-11-2016, 06:07 AM.

    #2
    Hello dotnet,

    Thank you for your post.

    I would recommend taking a look at the SampleCustomPlot indicator and how it handles the ChartPanel.X and ChartPanel.Y in order to draw the objects on the assigned panel. For information on ChartPanel please visit the following link: http://ninjatrader.com/support/helpG...chartpanel.htm

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rwilliam, Today, 01:54 PM
    0 responses
    1 view
    0 likes
    Last Post rwilliam  
    Started by franco12364, Today, 11:27 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by YevhenShynkarenko, Today, 11:48 AM
    3 responses
    18 views
    0 likes
    Last Post YevhenShynkarenko  
    Started by NinjaTrader_ChrisL, Today, 11:21 AM
    0 responses
    21 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by lunardiplomacy, Today, 08:09 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X