Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing object at the bottom of the price panel chart

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

    Drawing object at the bottom of the price panel chart

    Hello
    I was adding 3 array to build colored bar at the bottom of the price panel chart.

    AddPlot(new Stroke(Brushes.Red, DashStyleHelper.Solid, 20), PlotStyle.Square, "RTDownTrend");
    AddPlot(new Stroke(Brushes.Gold, DashStyleHelper.Solid, 20), PlotStyle.Square, "RTNoWhere");
    AddPlot(new Stroke(Brushes.Green, DashStyleHelper.Solid, 20), PlotStyle.Square, "RTUpTrend");

    RTUpTrend[0] = 1; ...

    but when it draws the object it drwas on Price 0 and distroy the scale of the chart.
    How can i position the built bar on the bottom of the chart without changing the chart scale?


    Click image for larger version

Name:	bad.png
Views:	360
Size:	61.8 KB
ID:	1147729

    Click image for larger version

Name:	good.png
Views:	246
Size:	92.9 KB
ID:	1147730 ​​​​​​​

    Thanks
    Oren


    #2
    Hello Oren,
    Seems like you're placing your indicator on Panel 1 itself, you can use new panel for your indicator & keep DrawOnPricePanel = true; so your draw objects are on proce panel & your plot are in panel 2 & your scaling will not be affected. Hope it helps!

    Comment


      #3
      Hello Oren, thanks for your post.

      You would need to use SharpDX in the OnRender method to draw objects on the chart panel without the scaling getting messed up. The ChartPanel object contains the coordinates of the chart panel that you can use to draw graphics in OnRender.

      https://ninjatrader.com/support/help..._rendering.htm - SharpDX guide

      There is also an example indicator called "SampleCustomRender" for a working reference sample.

      Best regards,
      -ChrisL

      Comment


        #4
        s.kinra - this code is from starategy (not from an indocator).
        i tried to implement the code from indicator - i did use
        DrawOnPricePanel = true;
        if i load the indicator from GUI it positions well on price panel but when i try load it from strategy by AddChartIndicator it lost its scale as looks above.
        Chris L - wow i looked at the manual looks like somthing complex i will back to it later after finishing critical blocks at my strategy.

        Thanks alot for both of you!
        Oren

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        55 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        132 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X