Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
can you help with code, would like to paint low volume bar black
why is this not working??
would like to paint volume bar black if it is below a certain amount
protected override void 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 Plot(new Pen(Color.Black, 2), PlotStyle.Bar, "LowVol"));
Add(new Line(Color.DarkGray, 0, "Zero line"));
DrawOnPricePanel = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (Close[0] >= Open[0])
{
Values[0].Set(Volume[0]);
Values[1].Reset();
if (Volume[1]<x)
{ Values[2].Set(Volume[1]);
}
}
else
{
Values[1].Set(Volume[0]);
Values[0].Reset();
if (Volume[1]<x)
{ Values[2].Set(Volume[1]);
many thanks for your help/advise
Can you help answer these questions from other members on NexusFi?
Here are some changes that I suggest. Have not tested them. Also ou need to declare the Variable x via "double x = 0.0;" somewhere.
Further suggestions:
If you post code, you can use [Code] tags -> just highlight the code and select # on your task bar
The condition
will work but is annoying, because you have to change the value of x for every instrument. You could try
This would show the bar as a low volume bar, if it has the lowest volume of the last 20 bars - not including the current active bar, which is yet incomplete.