Forex_Strategy_Builder.Indicator.IndicatorIsLowerThanAnotherIndicatorLogic C# (CSharp) Method

IndicatorIsLowerThanAnotherIndicatorLogic() protected method

Returns signals for the logic rule "The Indicator is lower than the AnotherIndicator"
protected IndicatorIsLowerThanAnotherIndicatorLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
adAnotherIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void
        protected void IndicatorIsLowerThanAnotherIndicatorLogic(int firstBar, int prvs, double[] adIndValue, double[] adAnotherIndValue, ref IndicatorComp indCompLong, ref IndicatorComp indCompShort)
        {
            double sigma = Sigma();

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

            return;
        }