Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText in 2nd Panel above volume bar

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

    DrawText in 2nd Panel above volume bar

    Hi,

    Using and modifying the VolumeUpDown indicator....

    The indicator is in a new Panel...Panel 2

    I want to write text above each volume bar and eventually under certain conditions...

    My code is this....

    protectedoverridevoid Initialize()
    {
    Add(
    new Plot(new Pen(Color.Lime, 2), PlotStyle.Bar, "UpVolume"));
    Add(
    new Plot(new Pen(Color.Red, 2), PlotStyle.Bar, "DownVolume"));
    Add(
    new Line(Color.DarkGray, 0, "Zero line"));
    }

    protectedoverridevoid OnBarUpdate()
    {
    if (Close[0] >= Open[0])
    {
    Values[
    0].Set(Volume[0]);
    Values[
    1].Reset();
    cntrGreen=cntrGreen +
    1; //Declared variable earlier
    cntrRed=
    0;

    // Draw number above Volume bar.
    DrawText("Volume" + CurrentBar,false,cntrGreen.ToString(),0,Volumebar?,0,Color.Blue,new Font("Arial",7,FontStyle.Regular),
    StringAlignment.Center,Color.Empty,Color.Blue,
    5);


    }
    else
    {
    Values[
    1].Set(Volume[0]);
    Values[
    0].Reset();
    cntrRed=cntrRed +
    1;
    cntrGreen=
    0;
    }

    I'm not sure how to access the Panel2 to write the text above the completed volume bar?


    Help would be appreciated

    Thanks
    Bruce


    Last edited by tacticaltrader; 09-23-2011, 08:21 AM.

    #2
    Hello tacticaltrader,

    Indicators can only be applied to 1 panel at a time. To have it default to its own panel, can set Overlay property to false.

    They can draw in either their own panel or the price panel. This is controlled with DrawOnPricePanel property. Set that to false if you want it to draw in the indicator panel.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK thanks..that worked

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X