Forex_Strategy_Builder.Indicator.IndicatorIsHigherThanAnotherIndicatorLogic C# (CSharp) Метод

IndicatorIsHigherThanAnotherIndicatorLogic() защищенный Метод

Returns signals for the logic rule "The Indicator is higher than the AnotherIndicator"
protected IndicatorIsHigherThanAnotherIndicatorLogic ( 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
Результат void
        protected void IndicatorIsHigherThanAnotherIndicatorLogic(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;
        }