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 Noerclou, Today, 04:55 AM
    0 responses
    1 view
    0 likes
    Last Post Noerclou  
    Started by llanqui, Yesterday, 09:59 AM
    2 responses
    16 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by ThoriSten, Today, 03:56 AM
    0 responses
    6 views
    0 likes
    Last Post ThoriSten  
    Started by PhillT, 04-19-2024, 02:16 PM
    3 responses
    20 views
    0 likes
    Last Post mangel2000  
    Started by TraderBCL, Today, 02:37 AM
    0 responses
    4 views
    0 likes
    Last Post TraderBCL  
    Working...
    X