Forex_Strategy_Builder.Indicator.BarClosesBelowIndicatorLogic C# (CSharp) Method

BarClosesBelowIndicatorLogic() protected method

Returns signals for the logic rule "The bar closes below the Indicator"
protected BarClosesBelowIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void
        protected void BarClosesBelowIndicatorLogic(int firstBar, int prvs, double[] adIndValue, ref IndicatorComp indCompLong, ref IndicatorComp indCompShort)
        {
            double sigma = Sigma();

            for (int bar = firstBar; bar < Bars; bar++)
            {
                indCompLong.Value[bar]  = Close[bar] < adIndValue[bar - prvs] - sigma ? 1 : 0;
                indCompShort.Value[bar] = Close[bar] > adIndValue[bar - prvs] + sigma ? 1 : 0;
            }

            return;
        }