I am trying to develop an Idicator which compares the Volume of the previous Bar with a given Threshold Value. The Indicator is based on the NT7 VOL Indicator. Currently I am unsing the Code below, on a 1 Minute Chart:
if (Volume[0] > Threshold && OnOff == true)
{
Back ColorAll = Color.Cyan;
}
Volume returns a double value, so I also defined "Threshold" as double.
The Problem:
Compilation is OK. But: Indicator ignores the Threshold Variable for size Comparison. The complete Chart will be painted Cyan. I defined the Thershold in Parameters:
public double Threshold
{
get { return threshold; }
set { threshold = Math.Max(1, value); }
}
I also use the threshold value to draw a horizontal Line - it works.
As soon as I replace the Threshold Variable by a figure, e.g. 300 in the code, re-Compile it works perfectly:
if (Volume[0] > 300 && OnOff == true)
{
Back ColorAll = Color.Cyan;
}
I would like to be able to set the Threshold Value in the Indicator Settings Window.
How can I solve the issue?
Thanks in advance
Helmut
Comment