Ned to:
When bar open is higher than the Bollinger upper line, and the close of the bar is lower than Bollinger upper line - go Short.
And
When bar open is lower than the Bollinger Lower line, and the close of the bar is upper than Bollinger Lower line - go Long.
Please help to understand the code for complete beginner.
Very thanks for the help!
My wrong code:
IsInstantiatedOnEachOptimizationIteration = true; } else if (State == State.Configure) { } else if (State == State.DataLoaded) { Bollinger1 = Bollinger(Close, 2, 14); } } protected override void OnBarUpdate() { if (CurrentBars[0] < 1) return; // Set 1 if ((CrossAbove(Bollinger1.Upper, Open, 1)) && (CrossBelow(Bollinger1.Upper, Close, 1))) { EnterShortLimit(Convert.ToInt32(DefaultQuantity), 1, @"GoShort"); } // Set 2 if ((CrossAbove(Bollinger1.Lower, Open, 1)) && (CrossBelow(Bollinger1.Lower, Close, 1))) { EnterLongLimit(Convert.ToInt32(DefaultQuantity), 1, @"GoLong"); } } } }
Comment