I am having some trouble building a strategy with nBarsDown. I tried using a user input of value = 1 for true (when I tried to use a bool with this indicator it said Type of left expression and right expression do not match).
Essentially, I am trying to get the strategy to enter a long trade when there are 4 consecutive bars down.
I have attached a pic of the strategy builder and some of the code it generated.
Thanks!
Lois
Value = 1;
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
NBarsDown1 = NBarsDown(Close, 4, true, true, true);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if (NBarsDown1[0] == Value)
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");

Comment