I'm using the VHF indicator in a strategy I'm creating, but it seems to have issues. First of all, the threshold is decimal...so in my strategy I use a double. However, no matter what I do, it will not take my double value and instead puts a 1.
Here's the code though:
public class UHF : Strategy
{
#region Variables
// Wizard generated variables
private int vHFperiod = 8; // Default setting for VHFperiod
private double vHFthreshold = 0.82; // Default setting for VHFthreshold
// User defined variables (add any user defined variables below)
#endregion
}
No matter what I do, it will not take the .82 value, and instead puts a 1. Even when I try to change it in backtest, it will not change.
Here's the parameter also:
[GridCategory("Parameters")]
public double VHFthreshold
{
get { return vHFthreshold; }
set { vHFthreshold = Math.Max(1, value); }
}
#endregion
All I want to do is if the line crosses the threshold to filter a trade.
if (VHF(VHFperiod, VHFthreshold).VHFLine[0] > vHFthreshold && ...)
any help would be appreciated.
DT
Comment