Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

volume counter location

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

    volume counter location

    Which part of this can be changed to move the location to the left by x bars or 12 bars or whatever?

    // Plot the volume count message to the lower right hand corner of the chart
    if (Bars.Period.Id == PeriodType.Volume)
    {
    double volumeCount = ShowPercent ? CountDown ? (1 - Bars.PercentComplete) * 100 : Bars.PercentComplete * 100 : CountDown ? Bars.Period.Value - volume : volume;
    graphics.DrawString((CountDown ?
    " Volume remaining = " + volumeCount : "Volume = " + volumeCount) + (ShowPercent ? "%" : ""), ChartControl.Font, textBrush, bounds.X + bounds.Width - textWidth, bounds.Y + bounds.Height - textHeight, stringFormat);
    }
    else
    graphics.DrawString("Volume Counter only works on volume based intervals", ChartControl.Font, textBrush, bounds.X + bounds.Width - noTickTextWidth, bounds.Y + bounds.Height - noTickTextHeight, stringFormat);
    }

    #2
    Hello,

    Try something like this:
    if (Bars.Period.Id == PeriodType.Volume)
    {
    double volumeCount = ShowPercent ? CountDown ? (1 - Bars.PercentComplete) * 100 : Bars.PercentComplete * 100 : CountDown ? Bars.Period.Value - volume : volume;
    //graphics.DrawString((CountDown ? " Volume remaining = " + volumeCount : "Volume = " + volumeCount) + (ShowPercent ? "%" : ""), ChartControl.Font, textBrush, bounds.X + bounds.Width - textWidth, bounds.Y + bounds.Height - textHeight, stringFormat);
    DrawTextFixed("test",(CountDown ? " Volume remaining = " + volumeCount : "Volume = " + volumeCount) + (ShowPercent ? "%" : ""),TextPosition.TopRight);
    }
    etc...

    This is not tested...
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Taddypole, Today, 02:47 PM
    0 responses
    0 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    50 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    10 responses
    398 views
    1 like
    Last Post beobast
    by beobast
     
    Started by lorem, Yesterday, 09:18 AM
    5 responses
    22 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by WHICKED, Today, 12:56 PM
    2 responses
    15 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Working...
    X