diff --git a/Classes/x-saherelm.x121.xmcycle.class.mq5 b/Classes/x-saherelm.x121.xmcycle.class.mq5 index 65549663..a7b94bd1 100644 --- a/Classes/x-saherelm.x121.xmcycle.class.mq5 +++ b/Classes/x-saherelm.x121.xmcycle.class.mq5 @@ -447,6 +447,8 @@ public: double ichChikouSpans[]; double ichSenkouSpanAs[]; double ichSenkouSpanBs[]; + double ichFutureSenkouSpanAs[]; + double ichFutureSenkouSpanBs[]; // // XMC ... @@ -548,45 +550,175 @@ public: double tdSignals[]; // - // XTD ... - bool isXTDSignalPeak; - bool isXTDSignalVale; - bool isXTDBullishPeak; - bool isXTDBullishVale; - bool isXTDBearishPeak; - bool isXTDBearishVale; - bool isXTDBullOverBear; - bool isXTDBullUnderBear; - bool isXTDSignalOverBear; - bool isXTDSignalUnderBear; - bool isXTDBullCrossedOverBear; - bool isXTDBullCrossedUnderBear; - bool isXTDSignalCrossedOverBear; - bool isXTDSignalCrossedUnderBear; + // General Conditions ... + + // + // XZG ... + bool isZigZagInPeak; + bool isZigZagInVale; + + // + // XPV ... + + // + bool isNewPeak; + bool isNewPeakOverLast; + bool isNewPeakUnderLast; + + // + bool isNewVale; + bool isNewValeOverLast; + bool isNewValeUnderLast; + + // + bool isFiboIncreased; + bool isFiboDecreased; + bool isFiboSectionChanged; + + // + // SC ... + + // + bool isSCBullish; + bool isSCHHBullish; + bool isSCLLBullish; + bool isSCSwitchedToBullish; + bool isSCHHSwitchedToBullish; + bool isSCLLSwitchedToBullish; + + // + bool isSCBearish; + bool isSCHHBearish; + bool isSCLLBearish; + bool isSCSwitchedToBearish; + bool isSCHHSwitchedToBearish; + bool isSCLLSwitchedToBeraish; + + // + // MC ... + + // + bool isMCBullish; + bool isMCHHBullish; + bool isMCLLBullish; + bool isMCSwitchedToBullish; + bool isMCHHSwitchedToBullish; + bool isMCLLSwitchedToBullish; + + // + bool isMCBearish; + bool isMCHHBearish; + bool isMCLLBearish; + bool isMCSwitchedToBearish; + bool isMCHHSwitchedToBearish; + bool isMCLLSwitchedToBeraish; + + // + // LC ... + + // + bool isLCBullish; + bool isLCHHBullish; + bool isLCLLBullish; + bool isLCSwitchedToBullish; + bool isLCHHSwitchedToBullish; + bool isLCLLSwitchedToBullish; + // + bool isLCBearish; + bool isLCHHBearish; + bool isLCLLBearish; + bool isLCSwitchedToBearish; + bool isLCHHSwitchedToBearish; + bool isLCLLSwitchedToBeraish; + + // + // HC ... + + // + bool isHCBullish; + bool isHCHHBullish; + bool isHCLLBullish; + bool isHCSwitchedToBullish; + bool isHCHHSwitchedToBullish; + bool isHCLLSwitchedToBullish; + + // + bool isHCBearish; + bool isHCHHBearish; + bool isHCLLBearish; + bool isHCSwitchedToBearish; + bool isHCHHSwitchedToBearish; + bool isHCLLSwitchedToBeraish; // // XHK ... // bool isHKBullish; - bool isSMHKBullish; bool isHKBearish; + bool isClosedOverHK; + bool isClosedUnderHK; + bool isHKSwitchedToBullish; + bool isHKSwitchedToBearish; + + // + bool isSMHKBullish; bool isSMHKBearish; bool isClosedOverSMHK; bool isClosedUnderSMHK; - bool isHKBullishPrev; - bool isSMHKBullishPrev; - bool isHKBearishPrev; - bool isSMHKBearishPrev; - bool isClosedOverSMHKPrev; - bool isClosedUnderSMHKPrev; + bool isSMHKSwitchedToBullish; + bool isSMHKSwitchedToBearish; // - // XZG ... + // XSTR ... + bool isTrendBullish; + bool isTrendBearish; + bool isTrendSwitchedToBullish; + bool isTrendSwitchedToBearish; // - bool isZigZagInPeak; - bool isZigZagInVale; + // XTD ... + bool isTDBullish; + bool isTDBearish; + bool isTDSwitchedToBullish; + bool isTDSwitchedToBearish; + + // + // XCHE ... + bool isCHEBullish; + bool isCHEBearish; + bool isCHESwitchedToBullish; + bool isCHESwitchedToBearish; + + // + // XMC ... + bool isMCFastOverSlow; + bool isMCFastUnderSlow; + bool isMCFastOverVerifier; + bool isMCFastUnderVerifier; + bool isMCSlowOverVerifier; + bool isMCSlowUnderVerifier; + bool isMCFastCrossedOverSlow; + bool isMCFastCrossedUnderSlow; + bool isMCFastCrossedOverVerifier; + bool isMCFastCrossedUnderVerifier; + bool isMCSlowCrossedOverVerifier; + bool isMCSlowCrossedUnderVerifier; + + // + // XMRB ... + bool isMRBFastOverSlow; + bool isMRBFastUnderSlow; + bool isMRBFastCrossedOverSlow; + bool isMRBFastCrossedUnderSlow; + bool isMRBFastOverVerifier; + bool isMRBFastUnderVerifier; + bool isMRBFastCrossedtOverVerifier; + bool isMRBFastCrossedUnderVerifier; + bool isMRBSlowOverVerifier; + bool isMRBSlowUnderVerifier; + bool isMRBSlowCrossedtOverVerifier; + bool isMRBSlowCrossedUnderVerifier; // // XDON ... @@ -596,111 +728,29 @@ public: bool isDONAttachedMinLower; bool isDONCrossedOverMaxLower; bool isDONCrossedUnderMaxLower; + bool isDONCrossedOverMinLower; + bool isDONCrossedUnderMinLower; // bool isDONAttachedMaxUpper; bool isDONAttachedMinUpper; bool isDONCrossedOverMaxUpper; bool isDONCrossedUnderMaxUpper; - - // - // XPV ... - - // - bool isPVPeakSameAs; - bool isPVNewPeak; - bool isPVNewPeakOverLast; - bool isPVNewPeakUnderLast; - bool isPVValeSameAs; - bool isPVNewVale; - bool isPVNewValeOverLast; - bool isPVNewValeUnderLast; - bool isPVFiboIncreased; - bool isPVFiboDecreased; - bool isPVFiboSectionChanged; - - // - bool isPVSCBullish; - bool isPVSCHHBullish; - bool isPVSCLLBullish; - bool isPVSCSwitchedToBullish; - - // - bool isPVSCBearish; - bool isPVSCHHBearish; - bool isPVSCLLBearish; - bool isPVSCSwitchedToBearish; - - // - bool isPVMCBullish; - bool isPVMCHHBullish; - bool isPVMCLLBullish; - bool isPVMCSwitchedToBullish; - - // - bool isPVMCBearish; - bool isPVMCHHBearish; - bool isPVMCLLBearish; - bool isPVMCSwitchedToBearish; - - // - bool isPVLCBullish; - bool isPVLCHHBullish; - bool isPVLCLLBullish; - bool isPVLCSwitchedToBullish; - - // - bool isPVLCBearish; - bool isPVLCHHBearish; - bool isPVLCLLBearish; - bool isPVLCSwitchedToBearish; - - // - bool isPVHCBullish; - bool isPVHCHHBullish; - bool isPVHCLLBullish; - bool isPVHCSwitchedToBullish; - - // - bool isPVHCBearish; - bool isPVHCHHBearish; - bool isPVHCLLBearish; - bool isPVHCSwitchedToBearish; + bool isDONCrossedOverMinUpper; + bool isDONCrossedUnderMinUpper; // // XICH ... - // Ichimoku strategy - // Strategy one: Ichimoku trend identifier: - // According to this strategy, we need a trigger that can be used - // to inform us about the trend type, - // if it is an uptrend or downtrend. - // We will check three values to do that and these values are the: - // closing price, Senkou Span A, and Senkou Span B. - // If the closing price is greater than the Senkou Span B and at the same time - // the closing price is greater than Senkou Span A, - // this will be the trigger to know that the trend is up. - // Vice versa, if the closing price is lower than the Senkou Span B and at the same time - // the closing price is lower than the Senkou Span A, - // this will be the trigger to the downtrend. + // - // Closing price > Senkou Span B and closing price > Senkou Span A --> Uptrend - // Closing price < Senkou Span B and closing price < Senkou Span A --> Downtrend + bool isClosedOverKijunSen; + bool isClosedUnderKijunSen; + bool isTenkanSenOverKijunSen; + bool isTenkanSenUnderKijunSen; + bool isTenkanSenCrossedOverKijunSen; + bool isTenkanSenCrossedUnderKijunSen; + // - // Strategy two: Ichimoku trend strength: - // Based on this strategy, we need a trigger that can inform us the current trend is strong. - // We will check three values to do that and these values are the: - // - current Senkou Span A, - // - the previous Senkou Span A, and - // - the Senkou Span B. - // If the current Senkou Span A is greater than the previous Senkous Span A and at the same time - // the current Senkou Span A is greater than the Senkou Span B, - // this is a trigger that the trend is up and strong. - // Vice versa, if the current Senkou Span A is lower than the previous Senkou Span A and at the - // same time, the current Senkou Span A is lower than the Senkou Span B, - // this will be a signal that the trend is down and strong. - // - // Current Senkou Span A > previous Senkou Span A and current Senkou Span A > Senkou Span B --> the uptrend is strong - // Current Senkou Span A < previous Senkou Span A and current Senkou Span A < Senkou Span B --> the downtrend is strong bool isSenkouSpanAOverB; bool isSenkouSpanAUnderB; bool isSenkouSpanAOverLast; @@ -709,397 +759,33 @@ public: bool isFutureSenkouSpanAUnderB; bool isFutureSenkouSpanAOverLast; bool isFutureSenkouSpanAUnderLast; - // - // Strategy three: Ichimoku price-Ki signal: - // According to this strategy, during the uptrend, we need a trigger that can - // alert us about the bullish signal, and during the downtrend, we need a trigger than can alert us about the bearish signal. - // We will check based on this strategy two values, closing price, and Kijun-Sen. - // If the closing price is greater than the Kijun-sen value, - // this will be a trigger to a bullish signal. - // Vice versa, if the closing price is lower than the Kijun-sen value, - // this will be a bearish signal. - // - // During uptrend, closing price > Kijun -sen --> bullish signal - // Duuring downtrend, closing price < Kijun -sen --> bearish signal - bool isCloseOverKijunSen; - bool isCloseUnderKijunSen; - // - // Strategy four: Ichimoku ten-ki signal: - // According to this strategy, during the uptrend, we need another trigger or - // method to alert us when there is a bullish signal or - // during the downtrend, we need a signal of bearishness. - // We will check based on this strategy two values, Tenkan-sen and Kijum-sen. - // If the Tenkan-sen value is greater than the Kijun-sen, - // this will be a signal of bullishness. - // Vice versa, if the Tenkan-sen is lower than the Kijun-sen, - // this will be a signal of bearishness. - // - // Tenkan-sen > Kijun-sen --> bullish signal - // Tenkan-sen < Kijun-sen --> bearish signal - bool isTenkanSenOverKijunSen; - bool isTenkanSenUnderKijunSen; - bool isTenkanSenCrossedOverKijunSen; - bool isTenkanSenCrossedUnderKijunSen; // - // XMC ... - // Three Moving Averages Crossover - // In this strategy, we will use three simple moving averages: - // the shorter simple moving average period is 10, the longer one period is 48, and in between a period of 24. - // - // According to the strategy, we need the three simple moving averages to be checked at every tick: - // - // If 10 SMA > 24 SMA, 10 SMA > 48 SMA, and 24 SMA > 48 SMA: the signal will be to buy and we need to be appeared as a comment on the chart. - // If 10 SMA < 24 SMA, 10 SMA < 48 SMA, and 24 SMA < 48 SMA: the signal will be to sell and we need to be appeared as a comment on the chart. - // If anything, else do nothing. - bool isFastOverSlow; - bool isFastUnderSlow; - bool isFastOverVerifier; - bool isFastUnderVerifier; - bool isSlowOverVerifier; - bool isSlowUnderVerifier; - bool isCloseOverFast; - bool isCloseUnderFast; - bool isCloseOverSlow; - bool isCloseUnderSlow; - bool isCloseOverVerifier; - bool isCloseUnderVerifier; - bool isFastCrossedOverSlow; - bool isFastCrossedUnderSlow; - bool isFastCrossedOverVerifier; - bool isFastCrossedUnderVerifier; - bool isSlowCrossedOverVerifier; - bool isSlowCrossedUnderVerifier; - - // - // XSTR ... - bool isTrendBullish; - bool isTrendSwitchedToBullish; - bool isTrendBearish; - bool isTrendSwitchedToBearish; - - // - // XCHE ... - bool isCHEInLong; - bool isCHEInStrongLong; - bool isCHESwitchedInStrongLong; - bool isCHEInShort; - bool isCHEInStrongShort; - bool isCHESwitchedInStrongShort; + bool isSenkouSpanACrossedOverB; + bool isSenkouSpanACrossedUnderB; + bool isSenkouSpanACrossedOverLast; + bool isSenkouSpanACrossedUnderLast; + bool isFutureSenkouSpanACrossedOverB; + bool isFutureSenkouSpanACrossedUnderB; + bool isFutureSenkouSpanACrossedOverLast; + bool isFutureSenkouSpanACrossedUnderLast; // // XOSC ... // - // RVI Signals ... - // Strategy one: RVI Crossover - Uptrend: - // Based on this strategy, we need to get buy and close signals during the uptrend by a specific condition. - // When the RVI current value and RVI signal current value are greater than the zero level at the same time - // that RVI current value is greater than the current value of the RVI signal, this will be a buy signal. - // Vice Versa, when the RVI current value and RVI signal current value is below zero level at - // the same time that the RVI current value is below the current value of the RVI signal, this will be a close signal. - // - // RVI value > 0 and RVI signal value > 0 and RVI value > RVI signal value --> buy - // RVI value < 0 and RVI signal value < 0 and RVI value < RVI signal value --> close - bool isRVILongStart; - bool isRVILongStop; - // - // Strategy two: RVI Crossover - Downtrend: - // Based on this strategy, we need to get the opposite signals of the previous RVI Crossover - - // Uptrend strategy as we need to get short and cover signals. - // When the RVI current value and RVI signal current value are lower than the zero level at - // the same time that RVI current value is lower than the current value of the RVI signal, this will be a short signal. - // Vice Versa, when the RVI current value and RVI signal current value is above the zero level - // at the same time that the RVI current value is above the current value of the RVI signal, this will be a cover signal. - // - // RVI value < 0 and RVI signal value < 0 and RVI value < RVI signal value --> short - // RVI value > 0 and RVI signal value > 0 and RVI value > RVI signal value --> cover - bool isRVIShortStart; - bool isRVIShortStop; - // - // Strategy three: RVI and MA Crossover - // Based on this strategy, we need to get buy and sell signals based on specific conditions - // as we need to get a - // buy signal - // when the closing price is greater than the 100 -period moving average - // at the same time that the current RVI value is greater than the current RVI signal value. - // In the other scenario, we need to get a - // sell signal - // when the closing price is lower than the 100 -period moving average - // at the same time that the current RVI value is lower than the current RVI signal value. - - // - // RSI strategy ... - // During Uptrend - // In this case, most of the time RSI values move between or moving between - // the mid range and level 70 (Overbought level). - // The trading strategy for the uptrend is: - // - // RSI Value < 50 = Buy - // RSI Value > 70 = Take Profit - bool isRSIUnder50; - bool isRSIOver70; - // - // During Downtrend - // During the downtrend, the RSI moves most of the time between - // the mid range and level 30 (Oversold level). - // The trading strategy will be as follows: - // - // RSI Value > 50 = Short - // RSI Value < 30 = Take Profit - bool isRSIOver50; - bool isRSIUnder30; - // - // During Sideways: - // RSI spends most of the time between levels 30 (Oversold level) and 70 (Oversbought level). - // The trading strategy will be as follows: - // RSI Value < 30 = Buy - // RSI Value > 50 = Take Profit - // RSI Value > 70 = Short - // RSI Value < 50 = Take Profit - - // - // Bull's Power strategy: - // In this part, we will learn how we can use Bull's Power through simple strategies - // that can be used based on the basic concept of this indicator. - // The following are for these strategies and their conditions. - // I need to confirm here, that these strategies for education only as the main objective - // is to understand the main concept behind the indicator and how we can use them in our favor, - // so you must test any of them before using them on your real account to make sure that - // it will be good for your trading as there is no strategy is suitable for everyone. - // - // Strategy one: Bull's Power Movement: - // Based on this strategy, we need to get signals based on the position of current and previous bull's power values. - // If the current bull's power value is greater than the previous one, - // we will consider it as a signal of the rising of the Bull's Power indicator. - // Vice versa, if the current value is lower than the previous one, we will consider that as a signal of - // declining Bull's Power. - // - // To simplify that, it will be the same as the following: - // - // Current Bull's Power > Previous Bull's Power --> Bull's Power is Rising - // Current Bull's Power < Previous Bull's Power --> Bull's Power is declining - bool isBullPowerOverLast; - bool isBullPoswerUnderLast; - // - // Strategy two: Bull's Power - Strong or Divergence - // Based on this strategy, we want to get a signal that informs us if there is a strong movement - // or there is a divergence by evaluating four values and these values are current high, - // the previous high, bull power, and previous bull power. - // If the current high is higher than the previous high and - // the current bull power value is higher than the previous one, - // we will consider that as a signal of a strong move. - // In the other case, if the current high is higher than the previous high and the current - // bull value is lower than the previous one, we will consider that as a signal of bearish divergence. - // - // To simplify that, it will be the same as the following: - // - // Current high > previous high and current bull's power > previous bull's power --> strong move - // Current high < previous high and current bull's power > previous bull's power --> bearish divergence - // - // Strategy three: Bull's Power signals - // Based on this strategy, we need a signal that can be used to get buy and sell signals and we will - // evaluate four values to do that based on this strategy. - // These four values are: - // - current bull's power, - // - zero level, - // - current close value, and - // - current exponential moving average. - // If the current bull's power is lower than the zero level and - // the current close is lower than the exponential moving average, - // we will consider it as a signal of selling. - // If the current bull's power is greater than the zero level and the current close is greater than - // the exponential moving average, this will be a signal of buying. - // - // To simplify that, it will be the same as the following: - // - // Current bull's power < zero level and current close < EMA --> sell - // Current bear's power > zero level and current close > EMA --> buy - bool isBullPowerOverZero; - bool isBullPoswerUnderZero; - - // - // Bear's Power strategy - // In this part, we will learn how we can use Bear's Power through simple strategies - // that can be used based on the basic concept of this indicator. - // The following are for these strategies and their conditions. - // I need to confirm here, that these strategies for education as the main objective - // is to understand the main concept behind the indicator and how we can use it, - // so you must test any of them before using them on your real account to - // make sure that it will be good for your trading. - // - // Strategy one: Bear's Power Movement - // According to this strategy, we need to get signals based on the position of current and previous - // bear's power values. - // If the current value is greater than the previous, this will be a signal of the rising of - // Bear's Power indicator. - // Vice versa, if the current value is lower than the previous value, - // this will be a signal of declining Bear's Power. - // - // Simply, - // - // Current Bear's Power > Previous Bear's Power --> Bear's Power is Rising - // Current Bear's Power < Previous Bear's Power --> Bear's Power is declining - bool isBearPowerOverLast; - bool isBearPoswerUnderLast; - // - // Strategy two: Bear's Power - Strong or Divergence - // According to this strategy, we need to get a signal that informs us if there are strong movements or - // there are divergences by evaluating four values and they are: - // -current low, - // - previous low, - // - bear power, and - // - previous bear power. - // If the current low is lower than the previous low and the current bear power value - // is lower than the previous one, this will be a signal of a strong move. - // In the other case, if the current low is lower than the previous low and the current - // bear value is greater than the previous one, this will be a signal of bullish divergence. - // - // Simply, - // - // Current low < previous low and current bear's power < previous bear's power --> strong move - // Current low < previous low and current bear's power > previous bear's power --> bullish divergence - // - // Strategy three - // According to this strategy, we need a trigger that can be used to get buy and sell signals and - // we will evaluate four values to do that based on this strategy. - // These four values are current: - // - bear's power, - // - zero level, - // - current close value, and - // - current exponential moving average. - // If the current bear's power is greater than the zero level and the current close is greater than - // the exponential moving average, this will be a signal of buy. - // If the current bear's power is lower than the zero level and the current close is lower than - // the exponential moving average, this will be a signal of selling. - // - // Simply, - // - // Current bear's power > zero level and current close > EMA --> buy - // Current bear's power < zero level and current close < EMA --> sell - bool isBearPowerOverZero; - bool isBearPoswerUnderZero; - - // + // SAR ... + // ATR ... + // RVI ... + // RSI ... // CCI ... - bool isCCIPositive; - bool isCCINegative; - bool isCCIOverPositiveHundred; - bool isCCIUnderNegativeHundred; - - // - // STDDEV ... - // Based on this strategy, we need to measure the volatility based on the comparison between the - // current Std Dev and the average of the five previous Std values. - // If the current Std Dev is greater than the Std Dev 5-periods average, this will be a high volatility signal. - // If the current Std is lower than the Std Dev 5- period average, this will be low volatility. - // - // Based on this strategy, we need to get buy and sell signals based on specific conditions. - // If the current Std Dev is greater than the previous Std Dev and the Ask value is greater than the moving average, - // this will be a buy signal. - // If the current Std Dev is greater than the previous Std Dev and the Bid value is lower than the moving average, - // this will be a sell signal. - // - // Current Std > Prev. Std and Ask > MA --> Buy signal - // Current Std > Prev. Std and Bid < MA --> Sell signal - // - // Based on this strategy, we need to get buy and sell signals based on other conditions. - // If the current Std Dev is greater than Std Dev Avg and Ask is greater than the moving average, - // this will be a buy signal. - // If the current Std Dev is greater than Std Dev Avg and Bid is lower than the moving average, - // this will be a sell signal. - // - // Current Std > Std Avg and Ask > MA --> Buy signal - // Current Std > Std Avg and Bid < Ma --> Sell signal - bool isSTDDEVOverAVG; - bool isSTDDEVOverLast; - bool isSTDDEVUnderAVG; - bool isSTDDEVUnderLast; - - // // MACD ... - // According to this strategy, we need to identify the market setup: - // is it buying setup or shorting setup. - // In other words we need to identify the market direction, if it is bullish or bearish market, - // and this will be identified by MACD. - // If the MACD main line breaks above zero level, this will be a buying setup or bullish setup and - // vice versa if MACD main line breaks below zero level, this will be a shorting setup or bearish. - // - // MACD main line > 0 = Bullish Setup - // MACD main line < 0 = Bearish Setup - // - // According to this strategy, we need to identify generated signals - // if there is a buy signal or a sell signal based on MACD main line and Signal line crossover. - // If MACD main line breaks above Signal line, this will be a buy signal and if MACD main line breaks - // below Signal line, this will be a short signal. - // - // MACD main line > MACD signal line = Buying Signal - // MACD main line < MACD signal line = Shorting signal - bool isMACDPositiove; - bool isMACDNegative; - bool isMACDOverSignal; - bool isMACDUnderSignal; - - // - // STOCHASTIC ... - // Stochastic strategy - // In this part, we will talk about how we can use this indicator through simple strategies. - // We can get signals from the stochastic indicator according to market trend and these strategies are - // uptrend strategy, downtrend strategy, and sideways strategy. - // - // Strategy one: Uptrend strategy - // According to this strategy, we need to check if the %K line and %D line are below the 50 level, - // then, the buy signal will be generated - // when the %K line crosses above the %D line. - // We can take profit according to another effective tool like price action by searching - // for a lower low for example. - // - // %K, %D < 50 --> %K > %D = buy signal - bool isStochKOverD; - bool isStochKDUnder50; - // - // Strategy two: downtrend strategy - // According to this strategy, we need to check if the %K line and %D line are above the 50 level, - // then, the sell signal will be generated - // when the %K line crosses below the %D line. - // We can take profit according to another effective tool like price action by searching - // for a higher high for example. - // - // %K, %D > 50 --> %K < %D = sell signal - bool isStochKUnderD; - bool isStochKDOver50; - // - // Strategy three: sideways strategy - // - // The buy signal: - // According to this strategy, we need to check if the %K line and %D line are below the 20 level, - // then, the buy signal will be generated - // when the %K line crosses above the %D line. - // When the %K line and %D line are above 80, then the take profit signal will be generated - // when the %K line crosses below the %D line. - // %K, %D < 20 --> %K > %D = buy signal - // %K, %D > 80 --> %K < %D = take profit - bool isStochKDUnder20; - // - // The sell signal - // According to this strategy, we need to check if the %K line and %D line are above the 80 level, - // then, the sell signal will be generated - // when the %K line crosses below the %D line. - // When the %K line and %D are below the 20 level, then, the take profit signal will be generated - // when the %K line crosses above the %D line. - // - // %K, %D > 80 --> %K < %D = sell signal - // %K, %D < 20 --> %K > %D = take profit - bool isStochKDOver80; - - // - // XMR ... - bool isMRBFastOverSlow; - bool isMRBFastCrossedOverSlow; - bool isMRBCloseOverFast; - bool isMRBFastUnderSlow; - bool isMRBFastCrossedUnderSlow; - bool isMRBCloseUnderSlow; + // STOCH ... + // BULLP ... + // BEARP ... + // STDDEV ... + // VOLUME ... + // MOMENTUM ... // // Tools ... @@ -1211,23 +897,6 @@ public: Clean(tdBearishs); Clean(tdSignals); - // - // XTD ... - isXTDSignalPeak = false; - isXTDSignalVale = false; - isXTDBullishPeak = false; - isXTDBullishVale = false; - isXTDBearishPeak = false; - isXTDBearishVale = false; - isXTDBullOverBear = false; - isXTDBullUnderBear = false; - isXTDSignalOverBear = false; - isXTDSignalUnderBear = false; - isXTDBullCrossedOverBear = false; - isXTDBullCrossedUnderBear = false; - isXTDSignalCrossedOverBear = false; - isXTDSignalCrossedUnderBear = false; - // // Buffers ... ArraySetAsSeries(bars, true); @@ -1305,88 +974,203 @@ public: ArraySetAsSeries(pvHCLLs, true); // + // XZG ... + isZigZagInPeak = false; + isZigZagInVale = false; + + // + // XPV ... + + // + isNewPeak = false; + isNewPeakOverLast = false; + isNewPeakUnderLast = false; + + // + isNewVale = false; + isNewValeOverLast = false; + isNewValeUnderLast = false; + + // + isFiboIncreased = false; + isFiboDecreased = false; + isFiboSectionChanged = false; + + // + // SC ... + + // + isSCBullish = false; + isSCHHBullish = false; + isSCLLBullish = false; + isSCSwitchedToBullish = false; + isSCHHSwitchedToBullish = false; + isSCLLSwitchedToBullish = false; + + // + isSCBearish = false; + isSCHHBearish = false; + isSCLLBearish = false; + isSCSwitchedToBearish = false; + isSCHHSwitchedToBearish = false; + isSCLLSwitchedToBeraish = false; + + // + // MC ... + + // + isMCBullish = false; + isMCHHBullish = false; + isMCLLBullish = false; + isMCSwitchedToBullish = false; + isMCHHSwitchedToBullish = false; + isMCLLSwitchedToBullish = false; + + // + isMCBearish = false; + isMCHHBearish = false; + isMCLLBearish = false; + isMCSwitchedToBearish = false; + isMCHHSwitchedToBearish = false; + isMCLLSwitchedToBeraish = false; + + // + // LC ... + + // + isLCBullish = false; + isLCHHBullish = false; + isLCLLBullish = false; + isLCSwitchedToBullish = false; + isLCHHSwitchedToBullish = false; + isLCLLSwitchedToBullish = false; + + // + isLCBearish = false; + isLCHHBearish = false; + isLCLLBearish = false; + isLCSwitchedToBearish = false; + isLCHHSwitchedToBearish = false; + isLCLLSwitchedToBeraish = false; + + // + // HC ... + + // + isHCBullish = false; + isHCHHBullish = false; + isHCLLBullish = false; + isHCSwitchedToBullish = false; + isHCHHSwitchedToBullish = false; + isHCLLSwitchedToBullish = false; + + // + isHCBearish = false; + isHCHHBearish = false; + isHCLLBearish = false; + isHCSwitchedToBearish = false; + isHCHHSwitchedToBearish = false; + isHCLLSwitchedToBeraish = false; + + // + // XHK ... isHKBullish = false; - isSMHKBullish = false; isHKBearish = false; + isClosedOverHK = false; + isClosedUnderHK = false; + isHKSwitchedToBullish = false; + isHKSwitchedToBearish = false; + + // + isSMHKBullish = false; isSMHKBearish = false; isClosedOverSMHK = false; isClosedUnderSMHK = false; - isHKBullishPrev = false; - isSMHKBullishPrev = false; - isHKBearishPrev = false; - isSMHKBearishPrev = false; - isClosedOverSMHKPrev = false; - isClosedUnderSMHKPrev = false; - isZigZagInPeak = false; - isZigZagInVale = false; - isDONAttachedMaxLower = false; - isDONAttachedMinLower = false; - isDONCrossedOverMaxLower = false; - isDONCrossedUnderMaxLower = false; - isDONAttachedMaxUpper = false; - isDONAttachedMinUpper = false; - isDONCrossedOverMaxUpper = false; - isDONCrossedUnderMaxUpper = false; - isPVPeakSameAs = false; - isPVNewPeak = false; - isPVNewPeakOverLast = false; - isPVNewPeakUnderLast = false; - isPVValeSameAs = false; - isPVNewVale = false; - isPVNewValeOverLast = false; - isPVNewValeUnderLast = false; - isPVFiboIncreased = false; - isPVFiboDecreased = false; - isPVFiboSectionChanged = false; - isPVSCBullish = false; - isPVSCHHBullish = false; - isPVSCLLBullish = false; - isPVSCSwitchedToBullish = false; - isPVSCBearish = false; - isPVSCHHBearish = false; - isPVSCLLBearish = false; - isPVSCSwitchedToBearish = false; - isPVMCBullish = false; - isPVMCHHBullish = false; - isPVMCLLBullish = false; - isPVMCSwitchedToBullish = false; - isPVMCBearish = false; - isPVMCHHBearish = false; - isPVMCLLBearish = false; - isPVMCSwitchedToBearish = false; - isPVLCBullish = false; - isPVLCHHBullish = false; - isPVLCLLBullish = false; - isPVLCSwitchedToBullish = false; - isPVLCBearish = false; - isPVLCHHBearish = false; - isPVLCLLBearish = false; - isPVLCSwitchedToBearish = false; - isPVHCBullish = false; - isPVHCHHBullish = false; - isPVHCLLBullish = false; - isPVHCSwitchedToBullish = false; - isPVHCBearish = false; - isPVHCHHBearish = false; - isPVHCLLBearish = false; - isPVHCSwitchedToBearish = false; + isSMHKSwitchedToBullish = false; + isSMHKSwitchedToBearish = false; // - // XTSR ... + // XSTR ... isTrendBullish = false; isTrendBearish = false; isTrendSwitchedToBullish = false; isTrendSwitchedToBearish = false; + // + // XTD ... + isTDBullish = false; + isTDBearish = false; + isTDSwitchedToBullish = false; + isTDSwitchedToBearish = false; + // // XCHE ... - isCHEInLong = false; - isCHEInStrongLong = false; - isCHEInShort = false; - isCHEInStrongShort = false; + isCHEBullish = false; + isCHEBearish = false; + isCHESwitchedToBullish = false; + isCHESwitchedToBearish = false; + + // + // XMC ... + isMCFastOverSlow = false; + isMCFastUnderSlow = false; + isMCFastOverVerifier = false; + isMCFastUnderVerifier = false; + isMCSlowOverVerifier = false; + isMCSlowUnderVerifier = false; + isMCFastCrossedOverSlow = false; + isMCFastCrossedUnderSlow = false; + isMCFastCrossedOverVerifier = false; + isMCFastCrossedUnderVerifier = false; + isMCSlowCrossedOverVerifier = false; + isMCSlowCrossedUnderVerifier = false; + + // + // XMRB ... + isMRBFastOverSlow = false; + isMRBFastUnderSlow = false; + isMRBFastCrossedOverSlow = false; + isMRBFastCrossedUnderSlow = false; + isMRBFastOverVerifier = false; + isMRBFastUnderVerifier = false; + isMRBFastCrossedtOverVerifier = false; + isMRBFastCrossedUnderVerifier = false; + isMRBSlowOverVerifier = false; + isMRBSlowUnderVerifier = false; + isMRBSlowCrossedtOverVerifier = false; + isMRBSlowCrossedUnderVerifier = false; + + // + // XDON ... + + // + isDONAttachedMaxLower = false; + isDONAttachedMinLower = false; + isDONCrossedOverMaxLower = false; + isDONCrossedUnderMaxLower = false; + isDONCrossedOverMinLower = false; + isDONCrossedUnderMinLower = false; + + // + isDONAttachedMaxUpper = false; + isDONAttachedMinUpper = false; + isDONCrossedOverMaxUpper = false; + isDONCrossedUnderMaxUpper = false; + isDONCrossedOverMinUpper = false; + isDONCrossedUnderMinUpper = false; // // XICH ... + + // + isClosedOverKijunSen = false; + isClosedUnderKijunSen = false; + isTenkanSenOverKijunSen = false; + isTenkanSenUnderKijunSen = false; + isTenkanSenCrossedOverKijunSen = false; + isTenkanSenCrossedUnderKijunSen = false; + + // isSenkouSpanAOverB = false; isSenkouSpanAUnderB = false; isSenkouSpanAOverLast = false; @@ -1395,100 +1179,21 @@ public: isFutureSenkouSpanAUnderB = false; isFutureSenkouSpanAOverLast = false; isFutureSenkouSpanAUnderLast = false; - isCloseOverKijunSen = false; - isCloseUnderKijunSen = false; - isTenkanSenOverKijunSen = false; - isTenkanSenUnderKijunSen = false; // - // XMC ... - isFastOverSlow = false; - isFastUnderSlow = false; - isFastOverVerifier = false; - isFastUnderVerifier = false; - isSlowOverVerifier = false; - isSlowUnderVerifier = false; - isCloseOverFast = false; - isCloseUnderFast = false; - isCloseOverSlow = false; - isCloseUnderSlow = false; - isCloseOverVerifier = false; - isCloseUnderVerifier = false; - - // - // XOSC ... - - // - // STDDEV ... - isSTDDEVOverAVG = false; - isSTDDEVUnderAVG = false; - isSTDDEVOverLast = false; - isSTDDEVUnderLast = false; - - // - // RVI ... - isRVILongStart = false; - isRVILongStop = false; - isRVIShortStart = false; - isRVIShortStop = false; - - // - // RSI ... - isRSIUnder50 = false; - isRSIOver70 = false; - isRSIOver50 = false; - isRSIUnder30 = false; - - // - // BULLPOWER ... - isBullPowerOverLast = false; - isBullPoswerUnderLast = false; - isBullPowerOverZero = false; - isBullPoswerUnderZero = false; - - // - // BEARPOWER ... - isBearPowerOverLast = false; - isBearPoswerUnderLast = false; - isBearPowerOverZero = false; - isBearPoswerUnderZero = false; - - // - // CCI ... - isCCIPositive = false; - isCCINegative = false; - isCCIOverPositiveHundred = false; - isCCIUnderNegativeHundred = false; - - // - // MACD ... - isMACDPositiove = false; - isMACDNegative = false; - isMACDOverSignal = false; - isMACDUnderSignal = false; - - // - // STOCH ... - isStochKOverD = false; - isStochKDUnder50 = false; - isStochKUnderD = false; - isStochKDOver50 = false; - isStochKDUnder20 = false; - isStochKDOver80 = false; - - // - // XMR ... - isMRBFastOverSlow = false; - isMRBFastCrossedOverSlow = false; - isMRBCloseOverFast = false; - isMRBFastUnderSlow = false; - isMRBFastCrossedUnderSlow = false; - isMRBCloseUnderSlow = false; + isSenkouSpanACrossedOverB = false; + isSenkouSpanACrossedUnderB = false; + isSenkouSpanACrossedOverLast = false; + isSenkouSpanACrossedUnderLast = false; + isFutureSenkouSpanACrossedOverB = false; + isFutureSenkouSpanACrossedUnderB = false; + isFutureSenkouSpanACrossedOverLast = false; + isFutureSenkouSpanACrossedUnderLast = false; } // // Generate Score ... - virtual void GenerateScore( + void GenerateScore( double &bullishScore, // Holds Bullish Score ... double &bearishScore, // Holds Bearish Score ... double multiplier = 1 // Score Multiplier ... @@ -1506,158 +1211,251 @@ public: // // Candlestic ... - - // - // BULLISH ... if (isLastBullish) { - bullScore++; + } + if (isLastBearish) + { } if (isCurrentBullish) { - bullScore++; - } - if (isCurrentMidLineOverLastUp) - { - bullScore++; - } - if (isCurrentMidLineOverLastHigh) - { - bullScore++; - } - if (isCurrentMidLineOverLastMidLine) - { - bullScore++; - } - - // - // BEARISH ... - if (isLastBearish) - { - bearScore++; } if (isCurrentBearish) { - bearScore++; + } + if (isCurrentMidLineOverLastHigh) + { } if (isCurrentMidLineUnderLastLow) { - bearScore++; + } + if (isCurrentMidLineOverLastUp) + { } if (isCurrentMidLineUnderLastDown) { - bearScore++; + } + if (isCurrentMidLineOverLastMidLine) + { } if (isCurrentMidLineUnderLastMidLine) { - bearScore++; } // - // XTD ... - - // - if (isXTDSignalPeak) + // XZG ... + if (isZigZagInPeak) + { + } + if (isZigZagInVale) { - // - bullScore--; - bearScore++; } // - if (isXTDSignalVale) + // XPV ... + + // + if (isNewPeak) + { + } + if (isNewPeakOverLast) + { + } + if (isNewPeakUnderLast) { - // - bullScore++; - bearScore--; } // - if (isXTDBullishPeak) + if (isNewVale) + { + } + if (isNewValeOverLast) + { + } + if (isNewValeUnderLast) { - // - bullScore--; - bearScore++; } // - if (isXTDBullishVale) + if (isFiboIncreased) + { + } + if (isFiboDecreased) + { + } + if (isFiboSectionChanged) { - // - bullScore++; - bearScore--; } // - if (isXTDBearishPeak) + // SC ... + + // + if (isSCBullish) + { + } + if (isSCHHBullish) + { + } + if (isSCLLBullish) + { + } + if (isSCSwitchedToBullish) + { + } + if (isSCHHSwitchedToBullish) + { + } + if (isSCLLSwitchedToBullish) + { + } + // + if (isSCBearish) + { + } + if (isSCHHBearish) + { + } + if (isSCLLBearish) + { + } + if (isSCSwitchedToBearish) + { + } + if (isSCHHSwitchedToBearish) + { + } + if (isSCLLSwitchedToBeraish) { - // - bullScore++; - bearScore--; } // - if (isXTDBearishVale) + // MC ... + + // + if (isMCBullish) + { + } + if (isMCHHBullish) + { + } + if (isMCLLBullish) + { + } + if (isMCSwitchedToBullish) + { + } + if (isMCHHSwitchedToBullish) + { + } + if (isMCLLSwitchedToBullish) { - // - bullScore--; - bearScore++; } // - if (isXTDBullOverBear) + if (isMCBearish) + { + } + if (isMCHHBearish) + { + } + if (isMCLLBearish) + { + } + if (isMCSwitchedToBearish) + { + } + if (isMCHHSwitchedToBearish) + { + } + if (isMCLLSwitchedToBeraish) { - bullScore++; } // - if (isXTDBullUnderBear) + // LC ... + + // + if (isLCBullish) + { + } + if (isLCHHBullish) + { + } + if (isLCLLBullish) + { + } + if (isLCSwitchedToBullish) + { + } + if (isLCHHSwitchedToBullish) + { + } + if (isLCLLSwitchedToBullish) { - bearScore++; } // - if (isXTDSignalOverBear) + if (isLCBearish) + { + } + if (isLCHHBearish) + { + } + if (isLCLLBearish) + { + } + if (isLCSwitchedToBearish) + { + } + if (isLCHHSwitchedToBearish) + { + } + if (isLCLLSwitchedToBeraish) { - bullScore++; } // - if (isXTDSignalUnderBear) + // HC ... + + // + if (isHCBullish) + { + } + if (isHCHHBullish) + { + } + if (isHCLLBullish) + { + } + if (isHCSwitchedToBullish) + { + } + if (isHCHHSwitchedToBullish) + { + } + if (isHCLLSwitchedToBullish) { - bearScore++; } // - if (isXTDBullCrossedOverBear) + if (isHCBearish) { - // - bullScore++; - bearScore--; } - - // - if (isXTDBullCrossedUnderBear) + if (isHCHHBearish) { - // - bullScore--; - bearScore++; } - - // - if (isXTDSignalCrossedOverBear) + if (isHCLLBearish) { - // - bullScore++; - bearScore--; } - - // - if (isXTDSignalCrossedUnderBear) + if (isHCSwitchedToBearish) + { + } + if (isHCHHSwitchedToBearish) + { + } + if (isHCLLSwitchedToBeraish) { - // - bullScore--; - bearScore++; } // @@ -1666,784 +1464,282 @@ public: // if (isHKBullish) { - // - bullScore++; - bearScore--; - } - if (isSMHKBullish) - { - // - bullScore++; - bearScore--; } if (isHKBearish) { - // - bullScore--; - bearScore++; + } + if (isClosedOverHK) + { + } + if (isClosedUnderHK) + { + } + if (isHKSwitchedToBullish) + { + } + if (isHKSwitchedToBearish) + { + } + + // + if (isSMHKBullish) + { } if (isSMHKBearish) { - // - bullScore--; - bearScore++; } if (isClosedOverSMHK) { - // - bullScore++; - bearScore--; } if (isClosedUnderSMHK) { - // - bullScore--; - bearScore++; } - - // - if (isHKBullishPrev) - { - // - bullScore += 2; - bearScore--; - } - if (isSMHKBullishPrev) - { - // - bullScore += 2; - bearScore--; - } - if (isHKBearishPrev) - { - // - bullScore--; - bearScore += 2; - } - if (isSMHKBearishPrev) - { - // - bullScore--; - bearScore += 2; - } - if (isClosedOverSMHKPrev) - { - // - bullScore += 2; - bearScore--; - } - if (isClosedUnderSMHKPrev) - { - // - bullScore--; - bearScore += 2; - } - - // - // XZG ... - if (isZigZagInPeak) - { - // - bullScore--; - bearScore++; - } - if (isZigZagInVale) - { - // - bullScore++; - bearScore--; - } - - // - // XDON ... - if (isDONAttachedMaxLower) - { - // - bullScore++; - bearScore--; - } - if (isDONAttachedMinLower) - { - bearScore++; - } - if (isDONCrossedOverMaxLower) - { - // - bullScore++; - bearScore--; - } - if (isDONCrossedUnderMaxLower) - { - // - bullScore--; - bearScore++; - } - if (isDONAttachedMaxUpper) - { - // - bullScore--; - bearScore++; - } - if (isDONAttachedMinUpper) - { - bullScore++; - } - if (isDONCrossedOverMaxUpper) - { - // - bullScore++; - bearScore--; - } - if (isDONCrossedUnderMaxUpper) - { - // - bullScore--; - bearScore++; - } - - // - // XPV ... - if (isPVPeakSameAs) + if (isSMHKSwitchedToBullish) { } - if (isPVNewPeak) + if (isSMHKSwitchedToBearish) { } - if (isPVNewPeakOverLast) - { - // - bullScore--; - bearScore++; - } - if (isPVNewPeakUnderLast) - { - // - bullScore++; - bearScore--; - } - if (isPVValeSameAs) - { - } - if (isPVNewVale) - { - } - if (isPVNewValeOverLast) - { - // - bullScore--; - bearScore++; - } - if (isPVNewValeUnderLast) - { - // - bullScore++; - bearScore--; - } - if (isPVFiboSectionChanged) - { - // - if (isPVFiboIncreased) - { - // - bullScore++; - bearScore--; - } - if (isPVFiboDecreased) - { - // - bullScore--; - bearScore++; - } - } - - // - if (isPVSCBullish) - { - bullScore++; - } - if (isPVSCHHBullish) - { - bullScore--; - } - if (isPVSCLLBullish) - { - bullScore++; - } - if (isPVSCSwitchedToBullish) - { - // - bullScore++; - bearScore--; - } - if (isPVSCBearish) - { - bearScore++; - } - if (isPVSCHHBearish) - { - bearScore--; - } - if (isPVSCLLBearish) - { - bearScore++; - } - if (isPVSCSwitchedToBearish) - { - // - bullScore--; - bearScore++; - } - if (isPVMCBullish) - { - bullScore++; - } - if (isPVMCHHBullish) - { - bullScore--; - } - if (isPVMCLLBullish) - { - bullScore++; - } - if (isPVMCSwitchedToBullish) - { - // - bullScore++; - bearScore--; - } - if (isPVMCBearish) - { - bullScore++; - } - if (isPVMCHHBearish) - { - bearScore--; - } - if (isPVMCLLBearish) - { - bearScore++; - } - if (isPVMCSwitchedToBearish) - { - // - bullScore--; - bearScore++; - } - if (isPVLCBullish) - { - bullScore++; - } - if (isPVLCHHBullish) - { - bullScore--; - } - if (isPVLCLLBullish) - { - bullScore++; - } - if (isPVLCSwitchedToBullish) - { - // - bullScore++; - bullScore--; - } - if (isPVLCBearish) - { - bearScore++; - } - if (isPVLCHHBearish) - { - bearScore--; - } - if (isPVLCLLBearish) - { - bearScore++; - } - if (isPVLCSwitchedToBearish) - { - // - bullScore--; - bearScore++; - } - if (isPVHCBullish) - { - bullScore++; - } - if (isPVHCHHBullish) - { - bullScore--; - } - if (isPVHCLLBullish) - { - bullScore++; - } - if (isPVHCSwitchedToBullish) - { - // - bullScore++; - bearScore--; - } - if (isPVHCBearish) - { - bearScore++; - } - if (isPVHCHHBearish) - { - bearScore--; - } - if (isPVHCLLBearish) - { - bearScore++; - } - if (isPVHCSwitchedToBearish) - { - // - bullScore--; - bearScore++; - } // // XSTR ... if (isTrendBullish) { - bullScore++; } if (isTrendBearish) { - bearScore++; } if (isTrendSwitchedToBullish) { - // - bullScore++; - bearScore--; } if (isTrendSwitchedToBearish) { - // - bullScore--; - bearScore++; + } + + // + // XTD ... + if (isTDBullish) + { + } + if (isTDBearish) + { + } + if (isTDSwitchedToBullish) + { + } + if (isTDSwitchedToBearish) + { + } + + // + // XCHE ... + if (isCHEBullish) + { + } + if (isCHEBearish) + { + } + if (isCHESwitchedToBullish) + { + } + if (isCHESwitchedToBearish) + { + } + + // + // XMC ... + if (isMCFastOverSlow) + { + } + if (isMCFastUnderSlow) + { + } + if (isMCFastOverVerifier) + { + } + if (isMCFastUnderVerifier) + { + } + if (isMCSlowOverVerifier) + { + } + if (isMCSlowUnderVerifier) + { + } + if (isMCFastCrossedOverSlow) + { + } + if (isMCFastCrossedUnderSlow) + { + } + if (isMCFastCrossedOverVerifier) + { + } + if (isMCFastCrossedUnderVerifier) + { + } + if (isMCSlowCrossedOverVerifier) + { + } + if (isMCSlowCrossedUnderVerifier) + { + } + + // + // XMRB ... + if (isMRBFastOverSlow) + { + } + if (isMRBFastUnderSlow) + { + } + if (isMRBFastCrossedOverSlow) + { + } + if (isMRBFastCrossedUnderSlow) + { + } + if (isMRBFastOverVerifier) + { + } + if (isMRBFastUnderVerifier) + { + } + if (isMRBFastCrossedtOverVerifier) + { + } + if (isMRBFastCrossedUnderVerifier) + { + } + if (isMRBSlowOverVerifier) + { + } + if (isMRBSlowUnderVerifier) + { + } + if (isMRBSlowCrossedtOverVerifier) + { + } + if (isMRBSlowCrossedUnderVerifier) + { + } + + // + // XDON ... + + // + if (isDONAttachedMaxLower) + { + } + if (isDONAttachedMinLower) + { + } + if (isDONCrossedOverMaxLower) + { + } + if (isDONCrossedUnderMaxLower) + { + } + if (isDONCrossedOverMinLower) + { + } + if (isDONCrossedUnderMinLower) + { + } + + // + if (isDONAttachedMaxUpper) + { + } + if (isDONAttachedMinUpper) + { + } + if (isDONCrossedOverMaxUpper) + { + } + if (isDONCrossedUnderMaxUpper) + { + } + if (isDONCrossedOverMinUpper) + { + } + if (isDONCrossedUnderMinUpper) + { } // // XICH ... // - // BULLISH ... - if (isSenkouSpanAOverB) + if (isClosedOverKijunSen) { - bullScore++; } - if (isSenkouSpanAOverLast) + if (isClosedUnderKijunSen) { - bullScore++; - } - if (isCloseOverKijunSen) - { - bullScore++; } if (isTenkanSenOverKijunSen) { - bullScore++; - } - if (isFutureSenkouSpanAOverB) - { - bullScore++; - } - if (isFutureSenkouSpanAOverLast) - { - bullScore++; - } - if (isTenkanSenCrossedOverKijunSen) - { - // - bullScore++; - bearScore--; - } - - // - // BEARISH ... - if (isSenkouSpanAUnderB) - { - bearScore++; - } - if (isSenkouSpanAUnderLast) - { - bearScore++; - } - if (isCloseUnderKijunSen) - { - bearScore++; } if (isTenkanSenUnderKijunSen) { - bearScore++; } - if (isFutureSenkouSpanAUnderB) + if (isTenkanSenCrossedOverKijunSen) { - bearScore++; - } - if (isFutureSenkouSpanAUnderLast) - { - bearScore++; } if (isTenkanSenCrossedUnderKijunSen) { - // - bullScore--; - bearScore++; } // - // XMC ... - - // - // BULLISH ... - if (isFastOverSlow) + if (isSenkouSpanAOverB) { - bullScore++; } - if (isFastOverVerifier) + if (isSenkouSpanAUnderB) { - bullScore++; } - if (isSlowOverVerifier) + if (isSenkouSpanAOverLast) { - bullScore++; } - if (isCloseOverFast) + if (isSenkouSpanAUnderLast) { - bullScore++; } - if (isCloseOverSlow) + if (isFutureSenkouSpanAOverB) { - bullScore++; } - if (isCloseOverVerifier) + if (isFutureSenkouSpanAUnderB) { - bullScore++; } - if (isFastCrossedOverSlow) + if (isFutureSenkouSpanAOverLast) { - // - bullScore++; - bearScore--; } - if (isFastCrossedOverVerifier) + if (isFutureSenkouSpanAUnderLast) { - // - bullScore++; - bearScore--; - } - if (isSlowCrossedOverVerifier) - { - // - bullScore++; - bearScore--; } // - // BEARISH ... - if (isFastUnderSlow) + if (isSenkouSpanACrossedOverB) { - bearScore++; } - if (isFastUnderVerifier) + if (isSenkouSpanACrossedUnderB) { - bearScore++; } - if (isSlowUnderVerifier) + if (isSenkouSpanACrossedOverLast) { - bearScore++; } - if (isCloseUnderFast) + if (isSenkouSpanACrossedUnderLast) { - bearScore++; } - if (isCloseUnderSlow) + if (isFutureSenkouSpanACrossedOverB) { - bearScore++; } - if (isCloseUnderVerifier) + if (isFutureSenkouSpanACrossedUnderB) { - bearScore++; } - if (isFastCrossedUnderSlow) + if (isFutureSenkouSpanACrossedOverLast) { - // - bullScore--; - bearScore++; } - if (isFastCrossedUnderVerifier) + if (isFutureSenkouSpanACrossedUnderLast) { - // - bullScore--; - bearScore++; - } - if (isSlowCrossedUnderVerifier) - { - // - bullScore--; - bearScore++; - } - - // - // XCHE ... - if (isCHEInLong) - { - bullScore++; - } - if (isCHEInStrongLong) - { - // - bullScore++; - bearScore--; - } - if (isCHESwitchedInStrongLong) - { - // - bullScore++; - bearScore--; - } - if (isCHEInShort) - { - // - bearScore++; - } - if (isCHEInStrongShort) - { - // - bullScore--; - bearScore++; - } - if (isCHESwitchedInStrongShort) - { - // - bullScore--; - bearScore++; - } - - // - // XOSC ... - - // - // STDDEV ... - - // - // BULLISH ... - if (isSTDDEVOverAVG) - { - bullScore++; - } - if (isSTDDEVOverLast) - { - bullScore++; - } - - // - // BEARISH ... - if (isSTDDEVUnderAVG) - { - bearScore++; - } - if (isSTDDEVUnderLast) - { - bearScore++; - } - - // - // RVI ... - if (isRVILongStart && !isRVILongStop) - { - bullScore++; - } - if (isRVIShortStart && isRVIShortStop) - { - bearScore++; - } - - // - // RSI ... - - // - // BULLISH ... - if (isRSIUnder30 || (!isRSIUnder30 && isRSIOver50 && isRSIOver70)) - { - bullScore++; - } - - // - // BEARISH ... - if (isRSIOver70 || (!isRSIOver70 && !isRSIOver50 && isRSIUnder30)) - { - bearScore++; - } - - // - // BULLPOWER ... - - // - // BULLISH ... - if (isBullPowerOverLast) - { - bullScore++; - } - if (isBullPowerOverZero) - { - bullScore++; - } - - // - // BEARISH ... - if (isBullPoswerUnderLast) - { - bearScore++; - } - if (isBullPoswerUnderZero) - { - bearScore++; - } - - // - // BEARPOWER ... - - // - // BULLISH ... - if (isBearPoswerUnderLast) - { - bullScore++; - } - if (isBearPoswerUnderZero) - { - bullScore++; - } - - // - // BEARISH ... - if (isBearPowerOverLast) - { - bearScore++; - } - if (isBearPowerOverZero) - { - bearScore++; - } - - // - // CCI ... - - // - // BULLISH ... - if (isCCIPositive) - { - bullScore++; - } - if (isCCIOverPositiveHundred) - { - bullScore++; - } - - // - // BEARISH ... - if (isCCINegative) - { - bearScore++; - } - if (isCCIUnderNegativeHundred) - { - bearScore++; - } - - // - // MACD ... - - // - // BULLISH ... - if (isMACDPositiove) - { - bullScore++; - } - if (isMACDOverSignal) - { - bullScore++; - } - - // - // BEARISH ... - if (isMACDNegative) - { - bearScore++; - } - if (isMACDUnderSignal) - { - bearScore++; - } - - // - // STOCH ... - - // - // BULLISH ... - if (isStochKOverD) - { - bullScore++; - } - if (isStochKDUnder20) - { - bullScore++; - } - if (isStochKDUnder50) - { - bullScore++; - } - - // - // BEARISH ... - if (isStochKUnderD) - { - bearScore++; - } - if (isStochKDOver50) - { - bearScore++; - } - if (isStochKDOver80) - { - bearScore++; - } - - // - // XMR ... - if (isMRBFastOverSlow) - { - bullScore++; - } - if (isMRBFastCrossedOverSlow) - { - // - bullScore++; - bearScore--; - } - if (isMRBCloseOverFast) - { - // - bullScore++; - bearScore--; - } - if (isMRBFastUnderSlow) - { - bearScore++; - } - if (isMRBFastCrossedUnderSlow) - { - // - bullScore--; - bearScore++; - } - if (isMRBCloseUnderSlow) - { - bullScore--; - bearScore++; } // @@ -2453,43 +1749,7 @@ public: // // Generate Summary ... - virtual string GenerateSummary( - const bool onlySummary = false, // Only Generate Conditions Summary - double multiplier = 1, // Score Multiplier - const string separator = "\n", // Separator - const bool ignoreFalseConditions = true // Ignore False Conditions - ) - { - // - string result = NULL; - - // - result = GenerateSummaryBody( - onlySummary, - multiplier, - separator, - ignoreFalseConditions - // - ); - - // - // Generating Full Result by Combining parts ... - result = - // - "[" + GetToken() + "]" + separator + - "-----------------------------" + separator + - result + - "" - // - ; - - // - return result; - } - - // string GenerateSummary( - string provided, // Additional Info about Type, Provider and Symbol const bool onlySummary = false, // Only Generate Conditions Summary double multiplier = 1, // Score Multiplier const string separator = "\n", // Separator @@ -2512,8 +1772,7 @@ public: // Generating Full Result by Combining parts ... result = // - "[" + GetToken() + "]" + separator + - provided + separator + + GetTitle() + separator + "-----------------------------" + separator + result + "" @@ -2564,389 +1823,6 @@ public: // ; - // - // Candlestick ... - string candlesticStr = - // - ToString("isLastBullish", isLastBullish, ignoreFalseConditions) + - ToString("isLastBearish", isLastBearish, ignoreFalseConditions) + - ToString("isCurrentBullish", isCurrentBullish, ignoreFalseConditions) + - ToString("isCurrentBearish", isCurrentBearish, ignoreFalseConditions) + - ToString("isCurrentMidLineOverLastHigh", isCurrentMidLineOverLastHigh, ignoreFalseConditions) + - ToString("isCurrentMidLineUnderLastLow", isCurrentMidLineUnderLastLow, ignoreFalseConditions) + - ToString("isCurrentMidLineOverLastUp", isCurrentMidLineOverLastUp, ignoreFalseConditions) + - ToString("isCurrentMidLineUnderLastDown", isCurrentMidLineUnderLastDown, ignoreFalseConditions) + - ToString("isCurrentMidLineOverLastMidLine", isCurrentMidLineOverLastMidLine, ignoreFalseConditions) + - ToString("isCurrentMidLineUnderLastMidLine", isCurrentMidLineUnderLastMidLine, ignoreFalseConditions) + - "" - // - ; - candlesticStr = SetLabel("Candelstick: ", candlesticStr, separator); - - // - // XHK ... - string hkStr = - // - ToString("isHKBullish", isHKBullish, ignoreFalseConditions) + - ToString("isSMHKBullish", isSMHKBullish, ignoreFalseConditions) + - ToString("isHKBearish", isHKBearish, ignoreFalseConditions) + - ToString("isSMHKBearish", isSMHKBearish, ignoreFalseConditions) + - ToString("isClosedOverSMHK", isClosedOverSMHK, ignoreFalseConditions) + - ToString("isClosedUnderSMHK", isClosedUnderSMHK, ignoreFalseConditions) + - ToString("isHKBullishPrev", isHKBullishPrev, ignoreFalseConditions) + - ToString("isSMHKBullishPrev", isSMHKBullishPrev, ignoreFalseConditions) + - ToString("isHKBearishPrev", isHKBearishPrev, ignoreFalseConditions) + - ToString("isSMHKBearishPrev", isSMHKBearishPrev, ignoreFalseConditions) + - ToString("isClosedOverSMHKPrev", isClosedOverSMHKPrev, ignoreFalseConditions) + - ToString("isClosedUnderSMHKPrev", isClosedUnderSMHKPrev, ignoreFalseConditions) + - "" - // - ; - hkStr = SetLabel("XHK: ", hkStr, separator); - - // - // XZG ... - string zigzagStr = - // - ToString("isZigZagInPeak", isZigZagInPeak, ignoreFalseConditions) + - ToString("isZigZagInVale", isZigZagInVale, ignoreFalseConditions) + - "" - // - ; - zigzagStr = SetLabel("XZG: ", zigzagStr, separator); - - // - // XTD ... - string tdStr = - // - ToString("isXTDSignalPeak", isXTDSignalPeak, ignoreFalseConditions) + - ToString("isXTDSignalVale", isXTDSignalVale, ignoreFalseConditions) + - ToString("isXTDBullishPeak", isXTDBullishPeak, ignoreFalseConditions) + - ToString("isXTDBullishVale", isXTDBullishVale, ignoreFalseConditions) + - ToString("isXTDBearishPeak", isXTDBearishPeak, ignoreFalseConditions) + - ToString("isXTDBearishVale", isXTDBearishVale, ignoreFalseConditions) + - ToString("isXTDBullOverBear", isXTDBullOverBear, ignoreFalseConditions) + - ToString("isXTDBullUnderBear", isXTDBullUnderBear, ignoreFalseConditions) + - ToString("isXTDSignalOverBear", isXTDSignalOverBear, ignoreFalseConditions) + - ToString("isXTDSignalUnderBear", isXTDSignalUnderBear, ignoreFalseConditions) + - ToString("isXTDBullCrossedOverBear", isXTDBullCrossedOverBear, ignoreFalseConditions) + - ToString("isXTDBullCrossedUnderBear", isXTDBullCrossedUnderBear, ignoreFalseConditions) + - ToString("isXTDSignalCrossedOverBear", isXTDSignalCrossedOverBear, ignoreFalseConditions) + - ToString("isXTDSignalCrossedUnderBear", isXTDSignalCrossedUnderBear, ignoreFalseConditions) + - "" - // - ; - tdStr = SetLabel("XTD: ", tdStr, separator); - - // - // XMR ... - string mrbStr = - // - ToString("isMRBFastOverSlow", isMRBFastOverSlow, ignoreFalseConditions) + - ToString("isMRBFastCrossedOverSlow", isMRBFastCrossedOverSlow, ignoreFalseConditions) + - ToString("isMRBCloseOverFast", isMRBCloseOverFast, ignoreFalseConditions) + - ToString("isMRBFastUnderSlow", isMRBFastUnderSlow, ignoreFalseConditions) + - ToString("isMRBFastCrossedUnderSlow", isMRBFastCrossedUnderSlow, ignoreFalseConditions) + - ToString("isMRBCloseUnderSlow", isMRBCloseUnderSlow, ignoreFalseConditions) + - "" - // - ; - mrbStr = SetLabel("XMRB: ", mrbStr, separator); - - // - // XSTR ... - string strStr = - // - ToString("isTrendBullish", isTrendBullish, ignoreFalseConditions) + - ToString("isTrendBearish", isTrendBearish, ignoreFalseConditions) + - ToString("isTrendSwitchedToBullish", isTrendSwitchedToBullish, ignoreFalseConditions) + - ToString("isTrendSwitchedToBearish", isTrendSwitchedToBearish, ignoreFalseConditions) + - "" - // - ; - strStr = SetLabel("XSTR: ", strStr, separator); - - // - // XCHE ... - string cheStr = - // - ToString("isCHEInLong", isCHEInLong, ignoreFalseConditions) + - ToString("isCHEInStrongLong", isCHEInStrongLong, ignoreFalseConditions) + - ToString("isCHESwitchedInStrongLong", isCHESwitchedInStrongLong, ignoreFalseConditions) + - ToString("isCHEInShort", isCHEInShort, ignoreFalseConditions) + - ToString("isCHEInStrongShort", isCHEInStrongShort, ignoreFalseConditions) + - ToString("isCHESwitchedInStrongShort", isCHESwitchedInStrongShort, ignoreFalseConditions) + - "" - // - ; - cheStr = SetLabel("XCHE: ", cheStr, separator); - - // - // XDON ... - string donStr = - // - ToString("isDONAttachedMaxLower", isDONAttachedMaxLower, ignoreFalseConditions) + - ToString("isDONAttachedMinLower", isDONAttachedMinLower, ignoreFalseConditions) + - ToString("isDONCrossedOverMaxLower", isDONCrossedOverMaxLower, ignoreFalseConditions) + - ToString("isDONCrossedUnderMaxLower", isDONCrossedUnderMaxLower, ignoreFalseConditions) + - ToString("isDONAttachedMaxUpper", isDONAttachedMaxUpper, ignoreFalseConditions) + - ToString("isDONAttachedMinUpper", isDONAttachedMinUpper, ignoreFalseConditions) + - ToString("isDONCrossedOverMaxUpper", isDONCrossedOverMaxUpper, ignoreFalseConditions) + - ToString("isDONCrossedUnderMaxUpper", isDONCrossedUnderMaxUpper, ignoreFalseConditions) + - "" - // - ; - donStr = SetLabel("XDON: ", donStr, separator); - - // - // XICH ... - string ichStr = - // - ToString("isSenkouSpanAOverB", isSenkouSpanAOverB, ignoreFalseConditions) + - ToString("isSenkouSpanAUnderB", isSenkouSpanAUnderB, ignoreFalseConditions) + - ToString("isSenkouSpanAOverLast", isSenkouSpanAOverLast, ignoreFalseConditions) + - ToString("isSenkouSpanAUnderLast", isSenkouSpanAUnderLast, ignoreFalseConditions) + - ToString("isCloseOverKijunSen", isCloseOverKijunSen, ignoreFalseConditions) + - ToString("isCloseUnderKijunSen", isCloseUnderKijunSen, ignoreFalseConditions) + - ToString("isTenkanSenOverKijunSen", isTenkanSenOverKijunSen, ignoreFalseConditions) + - ToString("isTenkanSenUnderKijunSen", isTenkanSenUnderKijunSen, ignoreFalseConditions) + - ToString("isFutureSenkouSpanAOverB", isFutureSenkouSpanAOverB, ignoreFalseConditions) + - ToString("isFutureSenkouSpanAUnderB", isFutureSenkouSpanAUnderB, ignoreFalseConditions) + - ToString("isFutureSenkouSpanAOverLast", isFutureSenkouSpanAOverLast, ignoreFalseConditions) + - ToString("isFutureSenkouSpanAUnderLast", isFutureSenkouSpanAUnderLast, ignoreFalseConditions) + - "" - // - ; - ichStr = SetLabel("XICH: ", ichStr, separator); - - // - // XMC ... - string mcStr = - // - ToString("isFastOverSlow", isFastOverSlow, ignoreFalseConditions) + - ToString("isFastUnderSlow", isFastUnderSlow, ignoreFalseConditions) + - ToString("isFastOverVerifier", isFastOverVerifier, ignoreFalseConditions) + - ToString("isFastUnderVerifier", isFastUnderVerifier, ignoreFalseConditions) + - ToString("isSlowOverVerifier", isSlowOverVerifier, ignoreFalseConditions) + - ToString("isSlowUnderVerifier", isSlowUnderVerifier, ignoreFalseConditions) + - ToString("isCloseOverFast", isCloseOverFast, ignoreFalseConditions) + - ToString("isCloseUnderFast", isCloseUnderFast, ignoreFalseConditions) + - ToString("isCloseOverSlow", isCloseOverSlow, ignoreFalseConditions) + - ToString("isCloseUnderSlow", isCloseUnderSlow, ignoreFalseConditions) + - ToString("isCloseOverVerifier", isCloseOverVerifier, ignoreFalseConditions) + - ToString("isCloseUnderVerifier", isCloseUnderVerifier, ignoreFalseConditions) + - ToString("isFastCrossedOverSlow", isFastCrossedOverSlow, ignoreFalseConditions) + - ToString("isFastCrossedUnderSlow", isFastCrossedUnderSlow, ignoreFalseConditions) + - ToString("isFastCrossedOverVerifier", isFastCrossedOverVerifier, ignoreFalseConditions) + - ToString("isFastCrossedUnderVerifier", isFastCrossedUnderVerifier, ignoreFalseConditions) + - ToString("isSlowCrossedOverVerifier", isSlowCrossedOverVerifier, ignoreFalseConditions) + - ToString("isSlowCrossedUnderVerifier", isSlowCrossedUnderVerifier, ignoreFalseConditions) + - "" - // - ; - mcStr = SetLabel("XMC: ", mcStr, separator); - - // - // XPV ... - string pvStr = - // - ToString("isPVPeakSameAs", isPVPeakSameAs, ignoreFalseConditions) + - ToString("isPVNewPeak", isPVNewPeak, ignoreFalseConditions) + - ToString("isPVNewPeakOverLast", isPVNewPeakOverLast, ignoreFalseConditions) + - ToString("isPVNewPeakUnderLast", isPVNewPeakUnderLast, ignoreFalseConditions) + - ToString("isPVValeSameAs", isPVValeSameAs, ignoreFalseConditions) + - ToString("isPVNewVale", isPVNewVale, ignoreFalseConditions) + - ToString("isPVNewValeOverLast", isPVNewValeOverLast, ignoreFalseConditions) + - ToString("isPVNewValeUnderLast", isPVNewValeUnderLast, ignoreFalseConditions) + - ToString("isPVFiboIncreased", isPVFiboIncreased, ignoreFalseConditions) + - ToString("isPVFiboDecreased", isPVFiboDecreased, ignoreFalseConditions) + - ToString("isPVFiboSectionChanged", isPVFiboSectionChanged, ignoreFalseConditions) + - ToString("isPVSCBullish", isPVSCBullish, ignoreFalseConditions) + - ToString("isPVSCHHBullish", isPVSCHHBullish, ignoreFalseConditions) + - ToString("isPVSCLLBullish", isPVSCLLBullish, ignoreFalseConditions) + - ToString("isPVSCSwitchedToBullish", isPVSCSwitchedToBullish, ignoreFalseConditions) + - ToString("isPVSCBearish", isPVSCBearish, ignoreFalseConditions) + - ToString("isPVSCHHBearish", isPVSCHHBearish, ignoreFalseConditions) + - ToString("isPVSCLLBearish", isPVSCLLBearish, ignoreFalseConditions) + - ToString("isPVSCSwitchedToBearish", isPVSCSwitchedToBearish, ignoreFalseConditions) + - ToString("isPVMCBullish", isPVMCBullish, ignoreFalseConditions) + - ToString("isPVMCHHBullish", isPVMCHHBullish, ignoreFalseConditions) + - ToString("isPVMCLLBullish", isPVMCLLBullish, ignoreFalseConditions) + - ToString("isPVMCSwitchedToBullish", isPVMCSwitchedToBullish, ignoreFalseConditions) + - ToString("isPVMCBearish", isPVMCBearish, ignoreFalseConditions) + - ToString("isPVMCHHBearish", isPVMCHHBearish, ignoreFalseConditions) + - ToString("isPVMCLLBearish", isPVMCLLBearish, ignoreFalseConditions) + - ToString("isPVMCSwitchedToBearish", isPVMCSwitchedToBearish, ignoreFalseConditions) + - ToString("isPVLCBullish", isPVLCBullish, ignoreFalseConditions) + - ToString("isPVLCHHBullish", isPVLCHHBullish, ignoreFalseConditions) + - ToString("isPVLCLLBullish", isPVLCLLBullish, ignoreFalseConditions) + - ToString("isPVLCSwitchedToBullish", isPVLCSwitchedToBullish, ignoreFalseConditions) + - ToString("isPVLCBearish", isPVLCBearish, ignoreFalseConditions) + - ToString("isPVLCHHBearish", isPVLCHHBearish, ignoreFalseConditions) + - ToString("isPVLCLLBearish", isPVLCLLBearish, ignoreFalseConditions) + - ToString("isPVLCSwitchedToBearish", isPVLCSwitchedToBearish, ignoreFalseConditions) + - ToString("isPVHCBullish", isPVHCBullish, ignoreFalseConditions) + - ToString("isPVHCHHBullish", isPVHCHHBullish, ignoreFalseConditions) + - ToString("isPVHCLLBullish", isPVHCLLBullish, ignoreFalseConditions) + - ToString("isPVHCSwitchedToBullish", isPVHCSwitchedToBullish, ignoreFalseConditions) + - ToString("isPVHCBearish", isPVHCBearish, ignoreFalseConditions) + - ToString("isPVHCHHBearish", isPVHCHHBearish, ignoreFalseConditions) + - ToString("isPVHCLLBearish", isPVHCLLBearish, ignoreFalseConditions) + - ToString("isPVHCSwitchedToBearish", isPVHCSwitchedToBearish, ignoreFalseConditions) + - "" - // - ; - pvStr = SetLabel("XPV: ", pvStr, separator); - - // - // XOSC ... - - // - // STDDEV ... - string stddevStr = - // - ToString("isSTDDEVOverAVG", isSTDDEVOverAVG, ignoreFalseConditions) + - ToString("isSTDDEVUnderAVG", isSTDDEVUnderAVG, ignoreFalseConditions) + - ToString("isSTDDEVOverLast", isSTDDEVOverLast, ignoreFalseConditions) + - ToString("isSTDDEVUnderLast", isSTDDEVUnderLast, ignoreFalseConditions) + - "" - // - ; - stddevStr = SetLabel("STDDEV: ", stddevStr, separator); - - // - // RVI ... - string rviStr = - // - ToString("isRVILongStart", isRVILongStart, ignoreFalseConditions) + - ToString("isRVILongStop", isRVILongStop, ignoreFalseConditions) + - ToString("isRVIShortStart", isRVIShortStart, ignoreFalseConditions) + - ToString("isRVIShortStop", isRVIShortStop, ignoreFalseConditions) + - "" - // - ; - rviStr = SetLabel("RVI: ", rviStr, separator); - - // - // RSI ... - string rsiStr = - // - ToString("isRSIOver50", isRSIOver50, ignoreFalseConditions) + - ToString("isRSIUnder50", isRSIUnder50, ignoreFalseConditions) + - ToString("isRSIOver70", isRSIOver70, ignoreFalseConditions) + - ToString("isRSIUnder30", isRSIUnder30, ignoreFalseConditions) + - "" - // - ; - rsiStr = SetLabel("RSI: ", rsiStr, separator); - - // - // CCI ... - string cciStr = - // - ToString("isCCIPositive", isCCIPositive, ignoreFalseConditions) + - ToString("isCCINegative", isCCINegative, ignoreFalseConditions) + - ToString("isCCIOverPositiveHundred", isCCIOverPositiveHundred, ignoreFalseConditions) + - ToString("isCCIUnderNegativeHundred", isCCIUnderNegativeHundred, ignoreFalseConditions) + - "" - // - ; - cciStr = SetLabel("CCI: ", cciStr, separator); - - // - // MACD ... - string macdStr = - // - ToString("isMACDPositiove", isMACDPositiove, ignoreFalseConditions) + - ToString("isMACDNegative", isMACDNegative, ignoreFalseConditions) + - ToString("isMACDOverSignal", isMACDOverSignal, ignoreFalseConditions) + - ToString("isMACDUnderSignal", isMACDUnderSignal, ignoreFalseConditions) + - "" - // - ; - macdStr = SetLabel("MACD: ", macdStr, separator); - - // - // BULLP ... - string bullPStr = - // - ToString("isBullPowerOverLast", isBullPowerOverLast, ignoreFalseConditions) + - ToString("isBullPoswerUnderLast", isBullPoswerUnderLast, ignoreFalseConditions) + - ToString("isBullPowerOverZero", isBullPowerOverZero, ignoreFalseConditions) + - ToString("isBullPoswerUnderZero", isBullPoswerUnderZero, ignoreFalseConditions) + - "" - // - ; - bullPStr = SetLabel("BULLP: ", bullPStr, separator); - - // - // BEARP ... - string bearPStr = - // - ToString("isBearPowerOverLast", isBearPowerOverLast, ignoreFalseConditions) + - ToString("isBearPoswerUnderLast", isBearPoswerUnderLast, ignoreFalseConditions) + - ToString("isBearPowerOverZero", isBearPowerOverZero, ignoreFalseConditions) + - ToString("isBearPoswerUnderZero", isBearPoswerUnderZero, ignoreFalseConditions) + - "" - // - ; - bearPStr = SetLabel("BEARP: ", bearPStr, separator); - - // - // STOCH ... - string stochStr = - // - ToString("isStochKOverD", isStochKOverD, ignoreFalseConditions) + - ToString("isStochKUnderD", isStochKUnderD, ignoreFalseConditions) + - ToString("isStochKDOver50", isStochKDOver50, ignoreFalseConditions) + - ToString("isStochKDOver80", isStochKDOver80, ignoreFalseConditions) + - ToString("isStochKDUnder20", isStochKDUnder20, ignoreFalseConditions) + - ToString("isStochKDUnder50", isStochKDUnder50, ignoreFalseConditions) + - "" - // - ; - stochStr = SetLabel("STOCH: ", stochStr, separator); - - // - string oscStr = - // - stddevStr + - rviStr + - rsiStr + - cciStr + - macdStr + - bullPStr + - bearPStr + - stochStr + - "" - // - ; - oscStr = SetLabel("XOSC: ", oscStr, separator); - - // - result = - // - commonStr + - candlesticStr + - (onlySummary - ? "" - : hkStr + - tdStr + - zigzagStr + - mrbStr + - strStr + - cheStr + - donStr + - ichStr + - mcStr + - pvStr + - oscStr + - "" // - ) + - "" - // - ; - // return result; } @@ -2967,29 +1843,6 @@ public: // return result; } - - // - // For Data Collector ... - string GetToken() - { - return GetSpecificToken(this); - } - bool IsModelValid() - { - return false; - } - string ToModelString() - { - return NULL; - } - bool ParseModel(string content) - { - return false; - } - int FindIndex(X121MCycleConditions &items[]) - { - return -1; - } }; // @@ -3134,12 +1987,10 @@ public: } // - int curr = barIndex + 1; - int prev = curr + 1; - - // - // Here i Have to Calculate Market Conditions based on - // Several Indicator/Oscillator(s) ... + if (mNumberOfItems <= 0) + { + mNumberOfItems = 2; + } // // Set Commons ... @@ -3157,85 +2008,1355 @@ public: conditions.symbol, conditions.period, barIndex, - barIndex + 5); + mNumberOfItems + // + ); // - XOHCL cBar = GetBar(barIndex); - XOHCL pBar = GetBar(barIndex + 1); + int zIndex = barIndex; + int cIndex = zIndex + 1; + int pIndex = cIndex + 1; + int ppIndex = pIndex + 1; // - // CANDELSTICK ... + int start = zIndex; + int count = mNumberOfItems; + // + // Filling Buffers ... + + // + // XHK ... + + // + hk.CopyAsOHCL( + start, + count, + conditions.hkBars // + ); + + // + hk.CopySMAsOHCL( + start, + count, + conditions.smHKBars // + ); + + // + // XICH ... + + // + ich.CopyTenkanSen( + start, + count, + conditions.ichTenkanSens // + ); + + // + ich.CopyKijunSen( + start, + count, + conditions.ichKijunSens // + ); + + // + ich.CopyChikouSpan( + start, + count, + conditions.ichChikouSpans // + ); + + // + ich.CopySenkouSpanA( + start, + count, + conditions.ichSenkouSpanAs // + ); + + // + ich.CopySenkouSpanB( + start, + count, + conditions.ichSenkouSpanBs // + ); + + // + ich.CopyFutureSenkouSpanA( + start, + count, + conditions.ichFutureSenkouSpanAs // + ); + + // + ich.CopyFutureSenkouSpanB( + start, + count, + conditions.ichFutureSenkouSpanBs // + ); + + // + // XMC ... + + // + mc.CopyFast( + start, + count, + conditions.mcFasts // + ); + + // + mc.CopySlow( + start, + count, + conditions.mcSlows // + ); + + // + mc.CopyVerifier( + start, + count, + conditions.mcVerifiers // + ); + + // + // XSTR ... + + // + str.CopyTrend( + start, + count, + conditions.strTrends // + ); + + // + str.CopyState( + start, + count, + conditions.strStates // + ); + + // + // XZG ... + + // + zg.CopyMain( + start, + count, + conditions.zigzags // + ); + + // + zg.CopyPeaksAndVales( + start, + count, + conditions.zigzagPVs // + ); + + // + // XMRB ... + + // + mrb.CopyFast( + start, + count, + conditions.mrbFasts // + ); + + // + mrb.CopySlow( + start, + count, + conditions.mrbSlows // + ); + + // + // Ribbon 1 ... + + // + mrb.CopyR1Fast( + start, + count, + conditions.mrb1Fasts // + ); + + // + mrb.CopyR1Slow( + start, + count, + conditions.mrb1Slows // + ); + + // + // Ribbon 2 ... + + // + mrb.CopyR2Fast( + start, + count, + conditions.mrb2Fasts // + ); + + // + mrb.CopyR2Slow( + start, + count, + conditions.mrb2Slows // + ); + + // + // Ribbon 3 ... + + // + mrb.CopyR3Fast( + start, + count, + conditions.mrb3Fasts // + ); + + // + mrb.CopyR3Slow( + start, + count, + conditions.mrb3Slows // + ); + + // + // Ribbon 4 ... + + // + mrb.CopyR4Fast( + start, + count, + conditions.mrb4Fasts // + ); + + // + mrb.CopyR4Slow( + start, + count, + conditions.mrb4Slows // + ); + + // + // Ribbon 5 ... + + // + mrb.CopyR5Fast( + start, + count, + conditions.mrb5Fasts // + ); + + // + mrb.CopyR5Slow( + start, + count, + conditions.mrb5Slows // + ); + + // + // Ribbon 6 ... + + // + mrb.CopyR6Fast( + start, + count, + conditions.mrb6Fasts // + ); + + // + mrb.CopyR6Slow( + start, + count, + conditions.mrb6Slows // + ); + + // + // XCHE ... + + // + che.CopyLongExit1( + start, + count, + conditions.cheLongExit1s // + ); + + // + che.CopyLongExit2( + start, + count, + conditions.cheLongExit2s // + ); + + // + che.CopyShortExit1( + start, + count, + conditions.cheShortExit1s // + ); + + // + che.CopyShortExit2( + start, + count, + conditions.cheShortExit2s // + ); + + // + // XTD ... + + // + td.CopyBullish( + start, + count, + conditions.tdBullishs // + ); + + // + td.CopyBearish( + start, + count, + conditions.tdBearishs // + ); + + // + td.CopySignal( + start, + count, + conditions.tdSignals // + ); + + // + // XDON ... + + // + don.CopyUpperO( + start, + count, + conditions.donUpperOs // + ); + + // + don.CopyLowerO( + start, + count, + conditions.donLowerOs // + ); + + // + don.CopyUpperC( + start, + count, + conditions.donUpperCs // + ); + + // + don.CopyLowerC( + start, + count, + conditions.donLowerCs // + ); + + // + don.CopyUpperH( + start, + count, + conditions.donUpperHs // + ); + + // + don.CopyLowerH( + start, + count, + conditions.donLowerHs // + ); + + // + don.CopyUpperL( + start, + count, + conditions.donUpperLs // + ); + + // + don.CopyLowerL( + start, + count, + conditions.donLowerLs // + ); + + // + // XPV ... + + // + pv.CopyPeak( + start, + count, + conditions.pvPeaks // + ); + + // + pv.CopyVale( + start, + count, + conditions.pvVales // + ); + + // + pv.CopyResistance( + start, + count, + conditions.pvResistances // + ); + + // + pv.CopySupport( + start, + count, + conditions.pvSupports // + ); + + // + pv.CopyFib1( + start, + count, + conditions.pvFib1s // + ); + + // + pv.CopyFib2( + start, + count, + conditions.pvFib2s // + ); + + // + pv.CopyFib3( + start, + count, + conditions.pvFib3s // + ); + + // + pv.CopyFib4( + start, + count, + conditions.pvFib4s // + ); + + // + pv.CopyFib5( + start, + count, + conditions.pvFib5s // + ); + + // + pv.CopySCHH( + start, + count, + conditions.pvSCHHs // + ); + + // + pv.CopySCLL( + start, + count, + conditions.pvSCLLs // + ); + + // + pv.CopyMCHH( + start, + count, + conditions.pvMCHHs // + ); + + // + pv.CopyMCLL( + start, + count, + conditions.pvMCLLs // + ); + + // + pv.CopyLCHH( + start, + count, + conditions.pvLCHHs // + ); + + // + pv.CopyLCLL( + start, + count, + conditions.pvLCLLs // + ); + + // + pv.CopyHCHH( + start, + count, + conditions.pvHCHHs // + ); + + // + pv.CopyHCLL( + start, + count, + conditions.pvHCLLs // + ); + + // + // XOSC ... + + // + // ATR ... + osc.CopyATR( + start, + count, + conditions.oscAtrs // + ); + + // + // VOLUE ... + osc.CopyVolume( + start, + count, + conditions.oscVolumes // + ); + + // + // MOMENTUM ... + osc.CopyMomentum( + start, + count, + conditions.oscMomentums // + ); + + // + // SAR ... + osc.CopySAR( + start, + count, + conditions.oscSars // + ); + + // + // RSI ... + osc.CopyRSI( + start, + count, + conditions.oscRsis // + ); + + // + // CCI ... + osc.CopyCCI( + start, + count, + conditions.oscCcis // + ); + + // + // STDDEV ... + osc.CopySTDDEV( + start, + count, + conditions.oscStddevs // + ); + + // + // BULLPOWER ... + osc.CopyBullPower( + start, + count, + conditions.oscBullPs // + ); + + // + // BEARPOWER ... + osc.CopyBearPower( + start, + count, + conditions.oscBearPs // + ); + + // + // RVI ... + + // + osc.CopyRVI( + start, + count, + conditions.oscRviMains // + ); + + // + osc.CopyRVISignal( + start, + count, + conditions.oscRviSignals // + ); + + // + // MACD ... + + // + osc.CopyMACD( + start, + count, + conditions.oscMacdMains // + ); + + // + osc.CopyMACDSignal( + start, + count, + conditions.oscMacdSignals // + ); + + // + // STOCH ... + + // + osc.CopySTOCH( + start, + count, + conditions.oscStochMains // + ); + + // + osc.CopySTOCHSignal( + start, + count, + conditions.oscStochSignals // + ); + + // + // Now we Have all Buffers ... + // Going to Extract Market Conditions Variables ... + + // + XOHCL zBar = conditions.bars[zIndex]; + XOHCL cBar = conditions.bars[cIndex]; + XOHCL pBar = conditions.bars[pIndex]; + + // + // Candlestic ... // bool isLastBullish = - // - pBar.IsBullish() - // - ; - - // - bool isLastBearish = - // - pBar.IsBearish() - // - ; - - // - bool isCurrentBullish = // cBar.IsBullish() // ; // - bool isCurrentBearish = + bool isLastBearish = // cBar.IsBearish() // ; + // + bool isCurrentBullish = + // + zBar.IsBullish() + // + ; + + // + bool isCurrentBearish = + // + zBar.IsBearish() + // + ; + // bool isCurrentMidLineOverLastHigh = // - cBar.GetMid() > pBar.high; + zBar.GetMid() > cBar.high; // ; // bool isCurrentMidLineUnderLastLow = // - cBar.GetMid() < pBar.low + zBar.GetMid() < cBar.low // ; // bool isCurrentMidLineOverLastUp = // - cBar.GetMid() > pBar.GetUp() + zBar.GetMid() > cBar.GetUp() // ; // bool isCurrentMidLineUnderLastDown = // - cBar.GetMid() < pBar.GetDown() + zBar.GetMid() < cBar.GetDown() // ; // bool isCurrentMidLineOverLastMidLine = // - cBar.GetMid() > pBar.GetMid() + zBar.GetMid() > cBar.GetMid() // ; // bool isCurrentMidLineUnderLastMidLine = // - cBar.GetMid() < pBar.GetMid() + zBar.GetMid() < cBar.GetMid() // ; + // + // XHK ... + + // + XOHCL zHKBar = conditions.hkBars[zIndex]; + XOHCL cHKBar = conditions.hkBars[cIndex]; + XOHCL pHKBar = conditions.hkBars[pIndex]; + + // + bool isHKBullish = cHKBar.IsBullish(); + bool isHKBearish = cHKBar.IsBearish(); + bool isClosedOverHK = cBar.close > cHKBar.high; + bool isClosedUnderHK = cBar.close < cHKBar.low; + bool isHKSwitchedToBullish = cHKBar.IsBullish() && !pHKBar.IsBullish(); + bool isHKSwitchedToBearish = cHKBar.IsBearish() && !pHKBar.IsBearish(); + + // + XOHCL zSMHKBar = conditions.smHKBars[zIndex]; + XOHCL cSMHKBar = conditions.smHKBars[cIndex]; + XOHCL pSMHKBar = conditions.smHKBars[pIndex]; + + // + bool isSMHKBullish = cSMHKBar.IsBullish(); + bool isSMHKBearish = cSMHKBar.IsBearish(); + bool isClosedOverSMHK = cBar.close > cSMHKBar.high; + bool isClosedUnderSMHK = cBar.close < cSMHKBar.low; + bool isSMHKSwitchedToBullish = cSMHKBar.IsBullish() && !pSMHKBar.IsBullish(); + bool isSMHKSwitchedToBearish = cSMHKBar.IsBearish() && !pSMHKBar.IsBearish(); + + // + // XICH ... + + // + bool isClosedOverKijunSen = cBar.close > conditions.ichKijunSens[cIndex]; + bool isClosedUnderKijunSen = cBar.close < conditions.ichKijunSens[cIndex]; + bool isTenkanSenOverKijunSen = conditions.ichTenkanSens[cIndex] > conditions.ichKijunSens[cIndex]; + bool isTenkanSenUnderKijunSen = conditions.ichTenkanSens[cIndex] < conditions.ichKijunSens[cIndex]; + + // + bool isTenkanSenOverKijunSenPrev = conditions.ichTenkanSens[pIndex] > conditions.ichKijunSens[pIndex]; + bool isTenkanSenUnderKijunSenPrev = conditions.ichTenkanSens[pIndex] < conditions.ichKijunSens[pIndex]; + + // + bool isTenkanSenCrossedOverKijunSen = isTenkanSenOverKijunSen && + !isTenkanSenOverKijunSenPrev; + bool isTenkanSenCrossedUnderKijunSen = isTenkanSenUnderKijunSen && + !isTenkanSenUnderKijunSenPrev; + + // + bool isSenkouSpanAOverB = conditions.ichSenkouSpanAs[cIndex] > conditions.ichSenkouSpanBs[cIndex]; + bool isSenkouSpanAUnderB = conditions.ichSenkouSpanAs[cIndex] < conditions.ichSenkouSpanBs[cIndex]; + + // + bool isSenkouSpanAOverBPrev = conditions.ichSenkouSpanAs[pIndex] > conditions.ichSenkouSpanBs[pIndex]; + bool isSenkouSpanAUnderBPrev = conditions.ichSenkouSpanAs[pIndex] < conditions.ichSenkouSpanBs[pIndex]; + + // + bool isSenkouSpanAOverLast = conditions.ichSenkouSpanAs[cIndex] > conditions.ichSenkouSpanAs[pIndex]; + bool isSenkouSpanAUnderLast = conditions.ichSenkouSpanAs[cIndex] < conditions.ichSenkouSpanAs[pIndex]; + + // + bool isSenkouSpanAOverLastPrev = conditions.ichSenkouSpanAs[pIndex] > conditions.ichSenkouSpanAs[ppIndex]; + bool isSenkouSpanAUnderLastPrev = conditions.ichSenkouSpanAs[pIndex] < conditions.ichSenkouSpanAs[ppIndex]; + + // + bool isFutureSenkouSpanAOverB = conditions.ichFutureSenkouSpanAs[cIndex] > conditions.ichFutureSenkouSpanBs[cIndex]; + bool isFutureSenkouSpanAUnderB = conditions.ichFutureSenkouSpanAs[cIndex] < conditions.ichFutureSenkouSpanBs[cIndex]; + + // + bool isFutureSenkouSpanAOverBPrev = conditions.ichFutureSenkouSpanAs[pIndex] > conditions.ichFutureSenkouSpanBs[pIndex]; + bool isFutureSenkouSpanAUnderBPrev = conditions.ichFutureSenkouSpanAs[pIndex] < conditions.ichFutureSenkouSpanBs[pIndex]; + + // + bool isFutureSenkouSpanAOverLast = conditions.ichFutureSenkouSpanAs[cIndex] > conditions.ichFutureSenkouSpanAs[pIndex]; + bool isFutureSenkouSpanAUnderLast = conditions.ichFutureSenkouSpanAs[cIndex] < conditions.ichFutureSenkouSpanAs[pIndex]; + + // + bool isFutureSenkouSpanAOverLastPrev = conditions.ichFutureSenkouSpanAs[pIndex] > conditions.ichFutureSenkouSpanAs[ppIndex]; + bool isFutureSenkouSpanAUnderLastPrev = conditions.ichFutureSenkouSpanAs[pIndex] < conditions.ichFutureSenkouSpanAs[ppIndex]; + + // + bool isSenkouSpanACrossedOverB = isSenkouSpanAOverB && + !isSenkouSpanAOverBPrev; + bool isSenkouSpanACrossedUnderB = isSenkouSpanAUnderB && + !isSenkouSpanAUnderBPrev; + bool isSenkouSpanACrossedOverLast = isSenkouSpanAOverLast && + !isSenkouSpanAOverLastPrev; + bool isSenkouSpanACrossedUnderLast = isSenkouSpanAUnderLast && + !isSenkouSpanAUnderLastPrev; + bool isFutureSenkouSpanACrossedOverB = isFutureSenkouSpanAOverB && + !isFutureSenkouSpanAOverBPrev; + bool isFutureSenkouSpanACrossedUnderB = isFutureSenkouSpanAUnderB && + !isFutureSenkouSpanAUnderBPrev; + bool isFutureSenkouSpanACrossedOverLast = isFutureSenkouSpanAOverLast && + !isFutureSenkouSpanAOverLastPrev; + bool isFutureSenkouSpanACrossedUnderLast = isFutureSenkouSpanAUnderLast && + !isFutureSenkouSpanAUnderLastPrev; + + // + // XMC ... + + // + bool isMCFastOverSlow = conditions.mcFasts[cIndex] > conditions.mcSlows[cIndex]; + bool isMCFastUnderSlow = conditions.mcFasts[cIndex] < conditions.mcSlows[cIndex]; + + // + bool isMCFastOverSlowPrev = conditions.mcFasts[pIndex] > conditions.mcSlows[pIndex]; + bool isMCFastUnderSlowPrev = conditions.mcFasts[pIndex] < conditions.mcSlows[pIndex]; + + // + bool isMCFastOverVerifier = conditions.mcFasts[cIndex] > conditions.mcVerifiers[cIndex]; + bool isMCFastUnderVerifier = conditions.mcFasts[cIndex] < conditions.mcVerifiers[cIndex]; + + // + bool isMCFastOverVerifierPrev = conditions.mcFasts[pIndex] > conditions.mcVerifiers[pIndex]; + bool isMCFastUnderVerifierPrev = conditions.mcFasts[pIndex] < conditions.mcVerifiers[pIndex]; + + // + bool isMCSlowOverVerifier = conditions.mcSlows[cIndex] > conditions.mcVerifiers[cIndex]; + bool isMCSlowUnderVerifier = conditions.mcSlows[cIndex] < conditions.mcVerifiers[cIndex]; + + // + bool isMCSlowOverVerifierPrev = conditions.mcSlows[pIndex] > conditions.mcVerifiers[pIndex]; + bool isMCSlowUnderVerifierPrev = conditions.mcSlows[pIndex] < conditions.mcVerifiers[pIndex]; + + // + bool isMCFastCrossedOverSlow = isMCFastOverSlow && + !isMCFastOverSlowPrev; + bool isMCFastCrossedUnderSlow = isMCFastUnderSlow && + !isMCFastUnderSlowPrev; + bool isMCFastCrossedOverVerifier = isMCFastOverVerifier && + !isMCFastOverVerifierPrev; + bool isMCFastCrossedUnderVerifier = isMCFastUnderVerifier && + !isMCFastUnderVerifierPrev; + bool isMCSlowCrossedOverVerifier = isMCSlowOverVerifier && + !isMCSlowOverVerifierPrev; + bool isMCSlowCrossedUnderVerifier = isMCSlowUnderVerifier && + !isMCSlowUnderVerifierPrev; + + // + // XSTR ... + + // + bool isTrendBullish = str.IsBullish(conditions.strStates[cIndex]); + bool isTrendBearish = str.IsBearish(conditions.strStates[cIndex]); + bool isTrendSwitchedToBullish = str.IsBullish(conditions.strStates[cIndex]) && + !str.IsBullish(conditions.strStates[pIndex]); + bool isTrendSwitchedToBearish = str.IsBearish(conditions.strStates[cIndex]) && + !str.IsBearish(conditions.strStates[pIndex]); + + // + // XZG ... + + // + bool isZigZagInPeak = conditions.zigzags[cIndex] < conditions.zigzagPVs[cIndex]; + bool isZigZagInVale = conditions.zigzags[cIndex] > conditions.zigzagPVs[cIndex]; + + // + // XMRB ... + + // + bool isMRBFastOverSlow = conditions.mrbFasts[cIndex] > conditions.mrbSlows[cIndex]; + bool isMRBFastUnderSlow = conditions.mrbFasts[cIndex] < conditions.mrbSlows[cIndex]; + + // + bool isMRBFastOverSlowPrev = conditions.mrbFasts[pIndex] > conditions.mrbSlows[pIndex]; + bool isMRBFastUnderSlowPrev = conditions.mrbFasts[pIndex] < conditions.mrbSlows[pIndex]; + + // + bool isMRBFastCrossedOverSlow = isMRBFastOverSlow && + !isMRBFastOverSlowPrev; + bool isMRBFastCrossedUnderSlow = isMRBFastUnderSlow && + !isMRBFastUnderSlowPrev; + + // + bool isMRBFastOverVerifier = conditions.mrbFasts[cIndex] > conditions.mcVerifiers[cIndex]; + bool isMRBFastUnderVerifier = conditions.mrbFasts[cIndex] < conditions.mcVerifiers[cIndex]; + + // + bool isMRBFastOverVerifierPrev = conditions.mrbFasts[pIndex] > conditions.mcVerifiers[pIndex]; + bool isMRBFastUnderVerifierPrev = conditions.mrbFasts[pIndex] < conditions.mcVerifiers[pIndex]; + + // + bool isMRBFastCrossedtOverVerifier = isMRBFastOverVerifier && + !isMRBFastOverVerifierPrev; + bool isMRBFastCrossedUnderVerifier = isMRBFastUnderVerifier && + !isMRBFastUnderVerifierPrev; + + // + bool isMRBSlowOverVerifier = conditions.mrbSlows[cIndex] > conditions.mcVerifiers[cIndex]; + bool isMRBSlowUnderVerifier = conditions.mrbSlows[cIndex] < conditions.mcVerifiers[cIndex]; + + // + bool isMRBSlowOverVerifierPrev = conditions.mrbSlows[pIndex] > conditions.mcVerifiers[pIndex]; + bool isMRBSlowUnderVerifierPrev = conditions.mrbSlows[pIndex] < conditions.mcVerifiers[pIndex]; + + // + bool isMRBSlowCrossedtOverVerifier = isMRBSlowOverVerifier && + !isMRBSlowOverVerifierPrev; + bool isMRBSlowCrossedUnderVerifier = isMRBSlowUnderVerifier && + !isMRBSlowUnderVerifierPrev; + + // + // XCHE ... + + // + bool isCHEBullish = NotEmpty(conditions.cheLongExit1s[cIndex]) && + NotEmpty(conditions.cheLongExit2s[cIndex]); + bool isCHEBearish = NotEmpty(conditions.cheShortExit1s[cIndex]) && + NotEmpty(conditions.cheShortExit2s[cIndex]); + + // + bool isCHEBullishPrev = NotEmpty(conditions.cheLongExit1s[pIndex]) && + NotEmpty(conditions.cheLongExit2s[pIndex]); + bool isCHEBearishPrev = NotEmpty(conditions.cheShortExit1s[pIndex]) && + NotEmpty(conditions.cheShortExit2s[pIndex]); + + // + bool isCHESwitchedToBullish = isCHEBullish && + !isCHEBullishPrev; + bool isCHESwitchedToBearish = isCHEBearish && + !isCHEBearishPrev; + + // + // XTD ... + + // + bool isTDBullish = conditions.tdBullishs[cIndex] > conditions.tdBearishs[cIndex]; + bool isTDBearish = conditions.tdBearishs[cIndex] > conditions.tdBullishs[cIndex]; + + // + bool isTDBullishPrev = conditions.tdBullishs[pIndex] > conditions.tdBearishs[pIndex]; + bool isTDBearishPrev = conditions.tdBearishs[pIndex] > conditions.tdBullishs[pIndex]; + + // + bool isTDSwitchedToBullish = isTDBullish && + !isTDBullishPrev; + bool isTDSwitchedToBearish = isTDBearish && + !isTDBearishPrev; + + // + // XDON ... + + // + double cDonMaxUpper = don.GetMaxUpper(cIndex); + double pDonMaxUpper = don.GetMaxUpper(pIndex); + + // + double cDonMinUpper = don.GetMinUpper(cIndex); + double pDonMinUpper = don.GetMinUpper(pIndex); + + // + double cDonMaxLower = don.GetMaxLower(cIndex); + double pDonMaxLower = don.GetMaxLower(pIndex); + + // + double cDonMinLower = don.GetMinLower(cIndex); + double pDonMinLower = don.GetMinLower(pIndex); + + // + bool isDONAttachedMaxLower = cBar.low <= cDonMaxLower; + bool isDONAttachedMinLower = cBar.low <= cDonMinLower; + + // + bool isDONAttachedMaxLowerPrev = pBar.low <= pDonMaxLower; + bool isDONAttachedMinLowerPrev = pBar.low <= pDonMinLower; + + // + bool isDONCrossedOverMaxLower = !isDONAttachedMaxLower && + isDONAttachedMaxLowerPrev; + bool isDONCrossedUnderMaxLower = isDONAttachedMaxLower && + !isDONAttachedMaxLowerPrev; + + // + bool isDONCrossedOverMinLower = !isDONAttachedMinLower && + isDONAttachedMinLowerPrev; + bool isDONCrossedUnderMinLower = isDONAttachedMinLower && + !isDONAttachedMinLowerPrev; + + // + bool isDONAttachedMaxUpper = cBar.high >= cDonMaxUpper; + bool isDONAttachedMinUpper = cBar.high >= cDonMinUpper; + + // + bool isDONAttachedMaxUpperPrev = pBar.high >= pDonMaxUpper; + bool isDONAttachedMinUpperPrev = pBar.high >= pDonMinUpper; + + // + bool isDONCrossedOverMaxUpper = isDONAttachedMaxUpper && + !isDONAttachedMaxUpperPrev; + bool isDONCrossedUnderMaxUpper = !isDONAttachedMaxUpper && + isDONAttachedMaxUpperPrev; + + // + bool isDONCrossedOverMinUpper = isDONAttachedMinUpper && + !isDONAttachedMinUpperPrev; + bool isDONCrossedUnderMinUpper = !isDONAttachedMinUpper && + isDONAttachedMinUpperPrev; + + // + // XPV ... + + // + bool isNewPeak = conditions.pvPeaks[cIndex] != conditions.pvPeaks[pIndex]; + bool isNewPeakOverLast = isNewPeak && + conditions.pvPeaks[cIndex] > conditions.pvPeaks[pIndex]; + bool isNewPeakUnderLast = isNewPeak && + conditions.pvPeaks[cIndex] < conditions.pvPeaks[pIndex]; + + // + bool isNewVale = conditions.pvVales[cIndex] != conditions.pvVales[pIndex]; + bool isNewValeOverLast = isNewVale && + conditions.pvVales[cIndex] > conditions.pvVales[pIndex]; + bool isNewValeUnderLast = isNewVale && + conditions.pvVales[cIndex] < conditions.pvVales[pIndex]; + + // + bool isFiboIncreased = + // + conditions.pvFib1s[cIndex] > conditions.pvFib1s[pIndex] && + conditions.pvFib2s[cIndex] > conditions.pvFib2s[pIndex] && + conditions.pvFib3s[cIndex] > conditions.pvFib3s[pIndex] && + conditions.pvFib4s[cIndex] > conditions.pvFib4s[pIndex] && + conditions.pvFib5s[cIndex] > conditions.pvFib5s[pIndex] + // + ; + bool isFiboDecreased = + // + conditions.pvFib1s[cIndex] < conditions.pvFib1s[pIndex] && + conditions.pvFib2s[cIndex] < conditions.pvFib2s[pIndex] && + conditions.pvFib3s[cIndex] < conditions.pvFib3s[pIndex] && + conditions.pvFib4s[cIndex] < conditions.pvFib4s[pIndex] && + conditions.pvFib5s[cIndex] < conditions.pvFib5s[pIndex] + // + ; + + bool isFiboSectionChanged = + // + (isFiboDecreased && + isNewPeakUnderLast) + // + || + // + (isFiboIncreased && + isNewValeOverLast) + // + ; + + // + // SC ... + + // + bool isSCHHBullish = conditions.pvSCHHs[cIndex] > conditions.pvSCHHs[pIndex]; + bool isSCLLBullish = conditions.pvSCLLs[cIndex] > conditions.pvSCLLs[pIndex]; + + // + bool isSCHHBullishPrev = conditions.pvSCHHs[pIndex] > conditions.pvSCHHs[ppIndex]; + bool isSCLLBullishPrev = conditions.pvSCLLs[pIndex] > conditions.pvSCLLs[ppIndex]; + + // + bool isSCBullish = isSCHHBullish && + isSCLLBullish; + + // + bool isSCBullishPrev = isSCHHBullishPrev && + isSCLLBullishPrev; + + // + bool isSCHHSwitchedToBullish = isSCHHBullish && + !isSCHHBullishPrev; + bool isSCLLSwitchedToBullish = isSCLLBullish && + !isSCLLBullishPrev; + + // + bool isSCHHBearish = conditions.pvSCHHs[cIndex] < conditions.pvSCHHs[pIndex]; + bool isSCLLBearish = conditions.pvSCLLs[cIndex] < conditions.pvSCLLs[pIndex]; + + // + bool isSCHHBearishPrev = conditions.pvSCHHs[pIndex] < conditions.pvSCHHs[ppIndex]; + bool isSCLLBearishPrev = conditions.pvSCLLs[pIndex] < conditions.pvSCLLs[ppIndex]; + + // + bool isSCBearish = isSCHHBearish && + isSCLLBearish; + + // + bool isSCBearishPrev = isSCHHBearishPrev && + isSCLLBearishPrev; + + // + bool isSCHHSwitchedToBearish = isSCHHBearish && + !isSCHHBearishPrev; + bool isSCLLSwitchedToBeraish = isSCLLBearish && + !isSCLLBearishPrev; + + // + bool isSCSwitchedToBullish = + // + (isSCHHSwitchedToBullish && + !isSCLLBearish) + // + || + // + (isSCLLSwitchedToBullish && + !isSCHHBearish) + // + ; + + // + bool isSCSwitchedToBearish = + // + (isSCHHSwitchedToBearish && + !isSCLLBullish) + // + || + // + (isSCLLSwitchedToBeraish && + !isSCHHBullish) + // + ; + + // + // MC ... + + // + bool isMCHHBullish = conditions.pvMCHHs[cIndex] > conditions.pvMCHHs[pIndex]; + bool isMCLLBullish = conditions.pvMCLLs[cIndex] > conditions.pvMCLLs[pIndex]; + + // + bool isMCHHBullishPrev = conditions.pvMCHHs[pIndex] > conditions.pvMCHHs[ppIndex]; + bool isMCLLBullishPrev = conditions.pvMCLLs[pIndex] > conditions.pvMCLLs[ppIndex]; + + // + bool isMCBullish = isMCHHBullish && + isMCLLBullish; + + // + bool isMCBullishPrev = isMCHHBullishPrev && + isMCLLBullishPrev; + + // + bool isMCHHSwitchedToBullish = isMCHHBullish && + !isMCHHBullishPrev; + bool isMCLLSwitchedToBullish = isMCLLBullish && + !isMCLLBullishPrev; + + // + bool isMCHHBearish = conditions.pvMCHHs[cIndex] < conditions.pvMCHHs[pIndex]; + bool isMCLLBearish = conditions.pvMCLLs[cIndex] < conditions.pvMCLLs[pIndex]; + + // + bool isMCHHBearishPrev = conditions.pvMCHHs[pIndex] < conditions.pvMCHHs[ppIndex]; + bool isMCLLBearishPrev = conditions.pvMCLLs[pIndex] < conditions.pvMCLLs[ppIndex]; + + // + bool isMCBearish = isMCHHBearish && + isMCLLBearish; + + // + bool isMCBearishPrev = isMCHHBearishPrev && + isMCLLBearishPrev; + + // + bool isMCHHSwitchedToBearish = isMCHHBearish && + !isMCHHBearishPrev; + bool isMCLLSwitchedToBeraish = isMCLLBearish && + !isMCLLBearishPrev; + + // + bool isMCSwitchedToBullish = + // + (isMCHHSwitchedToBullish && + !isMCLLBearish) + // + || + // + (isMCLLSwitchedToBullish && + !isMCHHBearish) + // + ; + + // + bool isMCSwitchedToBearish = + // + (isMCHHSwitchedToBearish && + !isMCLLBullish) + // + || + // + (isMCLLSwitchedToBeraish && + !isMCHHBullish) + // + ; + + // + // LC ... + + // + bool isLCHHBullish = conditions.pvLCHHs[cIndex] > conditions.pvLCHHs[pIndex]; + bool isLCLLBullish = conditions.pvLCLLs[cIndex] > conditions.pvLCLLs[pIndex]; + + // + bool isLCHHBullishPrev = conditions.pvLCHHs[pIndex] > conditions.pvLCHHs[ppIndex]; + bool isLCLLBullishPrev = conditions.pvLCLLs[pIndex] > conditions.pvLCLLs[ppIndex]; + + // + bool isLCBullish = isLCHHBullish && + isLCLLBullish; + + // + bool isLCBullishPrev = isLCHHBullishPrev && + isLCLLBullishPrev; + + // + bool isLCHHSwitchedToBullish = isLCHHBullish && + !isLCHHBullishPrev; + bool isLCLLSwitchedToBullish = isLCLLBullish && + !isLCLLBullishPrev; + + // + bool isLCHHBearish = conditions.pvLCHHs[cIndex] < conditions.pvLCHHs[pIndex]; + bool isLCLLBearish = conditions.pvLCLLs[cIndex] < conditions.pvLCLLs[pIndex]; + + // + bool isLCHHBearishPrev = conditions.pvLCHHs[pIndex] < conditions.pvLCHHs[ppIndex]; + bool isLCLLBearishPrev = conditions.pvLCLLs[pIndex] < conditions.pvLCLLs[ppIndex]; + + // + bool isLCBearish = isLCHHBearish && + isLCLLBearish; + + // + bool isLCBearishPrev = isLCHHBearishPrev && + isLCLLBearishPrev; + + // + bool isLCHHSwitchedToBearish = isLCHHBearish && + !isLCHHBearishPrev; + bool isLCLLSwitchedToBeraish = isLCLLBearish && + !isLCLLBearishPrev; + + // + bool isLCSwitchedToBullish = + // + (isLCHHSwitchedToBullish && + !isLCLLBearish) + // + || + // + (isLCLLSwitchedToBullish && + !isLCHHBearish) + // + ; + + // + bool isLCSwitchedToBearish = + // + (isLCHHSwitchedToBearish && + !isLCLLBullish) + // + || + // + (isLCLLSwitchedToBeraish && + !isLCHHBullish) + // + ; + + // + // HC ... + + // + bool isHCHHBullish = conditions.pvHCHHs[cIndex] > conditions.pvHCHHs[pIndex]; + bool isHCLLBullish = conditions.pvHCLLs[cIndex] > conditions.pvHCLLs[pIndex]; + + // + bool isHCHHBullishPrev = conditions.pvHCHHs[pIndex] > conditions.pvHCHHs[ppIndex]; + bool isHCLLBullishPrev = conditions.pvHCLLs[pIndex] > conditions.pvHCLLs[ppIndex]; + + // + bool isHCBullish = isHCHHBullish && + isHCLLBullish; + + // + bool isHCBullishPrev = isHCHHBullishPrev && + isHCLLBullishPrev; + + // + bool isHCHHSwitchedToBullish = isHCHHBullish && + !isHCHHBullishPrev; + bool isHCLLSwitchedToBullish = isHCLLBullish && + !isHCLLBullishPrev; + + // + bool isHCHHBearish = conditions.pvHCHHs[cIndex] < conditions.pvHCHHs[pIndex]; + bool isHCLLBearish = conditions.pvHCLLs[cIndex] < conditions.pvHCLLs[pIndex]; + + // + bool isHCHHBearishPrev = conditions.pvHCHHs[pIndex] < conditions.pvHCHHs[ppIndex]; + bool isHCLLBearishPrev = conditions.pvHCLLs[pIndex] < conditions.pvHCLLs[ppIndex]; + + // + bool isHCBearish = isHCHHBearish && + isHCLLBearish; + + // + bool isHCBearishPrev = isHCHHBearishPrev && + isHCLLBearishPrev; + + // + bool isHCHHSwitchedToBearish = isHCHHBearish && + !isHCHHBearishPrev; + bool isHCLLSwitchedToBeraish = isHCLLBearish && + !isHCLLBearishPrev; + + // + bool isHCSwitchedToBullish = + // + (isHCHHSwitchedToBullish && + !isHCLLBearish) + // + || + // + (isHCLLSwitchedToBullish && + !isHCHHBearish) + // + ; + + // + bool isHCSwitchedToBearish = + // + (isHCHHSwitchedToBearish && + !isHCLLBullish) + // + || + // + (isHCLLSwitchedToBeraish && + !isHCHHBullish) + // + ; + + // + // Setting Conditional Variables ... + // conditions.isLastBullish = isLastBullish; conditions.isLastBearish = isLastBearish; @@ -3248,1664 +3369,194 @@ public: conditions.isCurrentMidLineOverLastMidLine = isCurrentMidLineOverLastMidLine; conditions.isCurrentMidLineUnderLastMidLine = isCurrentMidLineUnderLastMidLine; - // - // XHK ... - - // - hk.CopyAsOHCL( - barIndex, - mNumberOfItems, - conditions.hkBars // - ); - - // - hk.CopySMAsOHCL( - barIndex, - mNumberOfItems, - conditions.smHKBars // - ); - - // - bool isHKBullish = conditions.hkBars[curr].IsBullish(); - bool isHKBullishPrev = conditions.hkBars[prev].IsBullish(); - bool isSMHKBullish = conditions.smHKBars[curr].IsBullish(); - bool isSMHKBullishPrev = conditions.smHKBars[prev].IsBullish(); - - // - bool isHKBearish = conditions.hkBars[curr].IsBearish(); - bool isHKBearishPrev = conditions.hkBars[prev].IsBearish(); - bool isSMHKBearish = conditions.smHKBars[curr].IsBearish(); - bool isSMHKBearishPrev = conditions.smHKBars[prev].IsBearish(); - - // - bool isClosedOverSMHK = conditions.bars[curr].close > conditions.smHKBars[curr].GetUp(); - bool isClosedUnderSMHK = conditions.bars[curr].close < conditions.smHKBars[curr].GetDown(); - bool isClosedOverSMHKPrev = conditions.bars[prev].close > conditions.smHKBars[prev].GetUp(); - bool isClosedUnderSMHKPrev = conditions.bars[prev].close < conditions.smHKBars[prev].GetDown(); - // conditions.isHKBullish = isHKBullish; - conditions.isSMHKBullish = isSMHKBullish; conditions.isHKBearish = isHKBearish; + conditions.isClosedOverHK = isClosedOverHK; + conditions.isClosedUnderHK = isClosedUnderHK; + conditions.isHKSwitchedToBullish = isHKSwitchedToBullish; + conditions.isHKSwitchedToBearish = isHKSwitchedToBearish; + + // + conditions.isSMHKBullish = isSMHKBullish; conditions.isSMHKBearish = isSMHKBearish; conditions.isClosedOverSMHK = isClosedOverSMHK; conditions.isClosedUnderSMHK = isClosedUnderSMHK; - conditions.isHKBullishPrev = isHKBullishPrev; - conditions.isSMHKBullishPrev = isSMHKBullishPrev; - conditions.isHKBearishPrev = isHKBearishPrev; - conditions.isSMHKBearishPrev = isSMHKBearishPrev; - conditions.isClosedOverSMHKPrev = isClosedOverSMHKPrev; - conditions.isClosedUnderSMHKPrev = isClosedUnderSMHKPrev; + conditions.isSMHKSwitchedToBullish = isSMHKSwitchedToBullish; + conditions.isSMHKSwitchedToBearish = isSMHKSwitchedToBearish; // - // XZG ... - - // - zg.CopyMain( - barIndex, - mNumberOfItems, - conditions.zigzags // - ); - - // - zg.CopyPeaksAndVales( - barIndex, - mNumberOfItems, - conditions.zigzagPVs // - ); - - // - // Looking for Vale ... - bool isZigZagInPeak = conditions.zigzags[curr] < conditions.zigzagPVs[curr]; - conditions.isZigZagInPeak = isZigZagInPeak; - - // - // Looking for Peak ... - bool isZigZagInVale = conditions.zigzags[curr] > conditions.zigzagPVs[curr]; - conditions.isZigZagInVale = isZigZagInVale; - - // - // XMR ... - - // - mrb.CopyFast( - barIndex, - mNumberOfItems, - conditions.mrbFasts // - ); - - // - mrb.CopyR1Fast( - barIndex, - mNumberOfItems, - conditions.mrb1Fasts // - ); - - // - mrb.CopyR2Fast( - barIndex, - mNumberOfItems, - conditions.mrb2Fasts // - ); - - // - mrb.CopyR3Fast( - barIndex, - mNumberOfItems, - conditions.mrb3Fasts // - ); - - // - mrb.CopyR4Fast( - barIndex, - mNumberOfItems, - conditions.mrb4Fasts // - ); - - // - mrb.CopyR5Fast( - barIndex, - mNumberOfItems, - conditions.mrb5Fasts // - ); - - // - mrb.CopyR6Fast( - barIndex, - mNumberOfItems, - conditions.mrb6Fasts // - ); - - // - mrb.CopySlow( - barIndex, - mNumberOfItems, - conditions.mrbSlows // - ); - - // - mrb.CopyR1Slow( - barIndex, - mNumberOfItems, - conditions.mrb1Slows // - ); - - // - mrb.CopyR2Slow( - barIndex, - mNumberOfItems, - conditions.mrb2Slows // - ); - - // - mrb.CopyR3Slow( - barIndex, - mNumberOfItems, - conditions.mrb3Slows // - ); - - // - mrb.CopyR4Slow( - barIndex, - mNumberOfItems, - conditions.mrb4Slows // - ); - - // - mrb.CopyR5Slow( - barIndex, - mNumberOfItems, - conditions.mrb5Slows // - ); - - // - mrb.CopyR6Slow( - barIndex, - mNumberOfItems, - conditions.mrb6Slows // - ); - - // - bool isMRBFastOverSlow = - // - conditions.mrbFasts[curr] > conditions.mrbSlows[curr] && - conditions.mrbFasts[prev] > conditions.mrbSlows[prev] - // - ; - bool isMRBFastCrossedOverSlow = - // - conditions.mrbFasts[curr] > conditions.mrbSlows[curr] && - conditions.mrbFasts[prev] <= conditions.mrbSlows[prev] - // - ; - bool isMRBCloseOverFast = - // - conditions.bars[prev].close > conditions.mrbFasts[prev] && - conditions.bars[curr].low > conditions.mrbFasts[prev] - // - ; - bool isMRBFastUnderSlow = - // - conditions.mrbFasts[curr] < conditions.mrbSlows[curr] && - conditions.mrbFasts[prev] < conditions.mrbSlows[prev] - // - ; - bool isMRBFastCrossedUnderSlow = - // - conditions.mrbFasts[curr] < conditions.mrbSlows[curr] && - conditions.mrbFasts[prev] >= conditions.mrbSlows[prev] - // - ; - bool isMRBCloseUnderSlow = - // - conditions.bars[prev].close < conditions.mrbSlows[prev] && - conditions.bars[curr].high < conditions.mrbSlows[prev] - // - ; - - // - isMRBFastOverSlow = isMRBFastOverSlow; - isMRBFastCrossedOverSlow = isMRBFastCrossedOverSlow; - isMRBCloseOverFast = isMRBCloseOverFast; - isMRBFastUnderSlow = isMRBFastUnderSlow; - isMRBFastCrossedUnderSlow = isMRBFastCrossedUnderSlow; - isMRBCloseUnderSlow = isMRBCloseUnderSlow; - - // - // XDON ... - - // - don.CopyUpperO( - barIndex, - mNumberOfItems, - conditions.donUpperOs // - ); - don.CopyLowerO( - barIndex, - mNumberOfItems, - conditions.donLowerOs // - ); - don.CopyUpperC( - barIndex, - mNumberOfItems, - conditions.donUpperCs // - ); - don.CopyLowerC( - barIndex, - mNumberOfItems, - conditions.donLowerCs // - ); - don.CopyUpperH( - barIndex, - mNumberOfItems, - conditions.donUpperHs // - ); - don.CopyLowerH( - barIndex, - mNumberOfItems, - conditions.donLowerHs // - ); - don.CopyUpperL( - barIndex, - mNumberOfItems, - conditions.donUpperLs // - ); - don.CopyLowerL( - barIndex, - mNumberOfItems, - conditions.donLowerLs // - ); - - // - // Upper ... - - // - double donUpperO = conditions.donUpperOs[curr]; - double donUpperOPrev = conditions.donUpperOs[prev]; - - // - double donUpperC = conditions.donUpperCs[curr]; - double donUpperCPrev = conditions.donUpperCs[prev]; - - // - double donUpperH = conditions.donUpperHs[curr]; - double donUpperHPrev = conditions.donUpperHs[prev]; - - // - double donUpperL = conditions.donUpperLs[curr]; - double donUpperLPrev = conditions.donUpperLs[prev]; - - // - double donUppers[] = { - donUpperO, - donUpperC, - donUpperH, - donUpperL // - }; - double maxDonUpper = GetMax(donUppers); - double minDonUpper = GetMin(donUppers); - - // - double donUpperPrevs[] = { - donUpperOPrev, - donUpperCPrev, - donUpperHPrev, - donUpperLPrev // - }; - double maxDonUpperPrev = GetMax(donUpperPrevs); - double minDonUpperPrev = GetMin(donUpperPrevs); - - // - // Lower ... - - // - double donLowerO = conditions.donLowerOs[curr]; - double donLowerOPrev = conditions.donLowerOs[prev]; - - // - double donLowerC = conditions.donLowerCs[curr]; - double donLowerCPrev = conditions.donLowerCs[prev]; - - // - double donLowerH = conditions.donLowerHs[curr]; - double donLowerHPrev = conditions.donLowerHs[prev]; - - // - double donLowerL = conditions.donLowerLs[curr]; - double donLowerLPrev = conditions.donLowerLs[prev]; - - // - double donLowers[] = { - donLowerO, - donLowerC, - donLowerH, - donLowerL // - }; - double maxDonLower = GetMax(donLowers); - double minDonLower = GetMin(donLowers); - - // - double donLowerPrevs[] = { - donLowerOPrev, - donLowerCPrev, - donLowerHPrev, - donLowerLPrev // - }; - double maxDonLowerPrev = GetMax(donLowerPrevs); - double minDonLowerPrev = GetMin(donLowerPrevs); - - // - bool isDONAttachedMaxLower = conditions.bars[curr].low == maxDonLower; - bool isDONAttachedMinLower = conditions.bars[curr].low == minDonLower; - bool isDONCrossedOverMaxLower = - // - ((conditions.bars[curr].low > maxDonLower) || - (conditions.bars[curr].close > maxDonLower)) - // - && - // - ((conditions.bars[prev].high <= maxDonLower) || - (conditions.bars[prev].open <= maxDonLower)) - // - ; - bool isDONCrossedUnderMaxLower = - // - ((conditions.bars[curr].low < maxDonLower) || - (conditions.bars[curr].close < maxDonLower)) - // - && - // - ((conditions.bars[prev].high >= maxDonLower) || - (conditions.bars[prev].open >= maxDonLower)) - // - ; - - // - bool isDONAttachedMaxUpper = conditions.bars[curr].high == maxDonUpper; - bool isDONAttachedMinUpper = conditions.bars[curr].high == minDonUpper; - bool isDONCrossedOverMaxUpper = - // - ((conditions.bars[curr].low > maxDonUpper) || - (conditions.bars[curr].close > maxDonUpper)) - // - && - // - ((conditions.bars[prev].high <= maxDonUpper) || - (conditions.bars[prev].open <= maxDonUpper)) - // - ; - bool isDONCrossedUnderMaxUpper = - // - ((conditions.bars[curr].low < maxDonUpper) || - (conditions.bars[curr].close < maxDonUpper)) - // - && - // - ((conditions.bars[prev].high >= maxDonUpper) || - (conditions.bars[prev].open >= maxDonUpper)) - // - ; - - // - conditions.isDONAttachedMaxLower = isDONAttachedMaxLower; - conditions.isDONAttachedMinLower = isDONAttachedMinLower; - conditions.isDONCrossedOverMaxLower = isDONCrossedOverMaxLower; - conditions.isDONCrossedUnderMaxLower = isDONCrossedUnderMaxLower; - - // - conditions.isDONAttachedMaxUpper = isDONAttachedMaxUpper; - conditions.isDONAttachedMinUpper = isDONAttachedMinUpper; - conditions.isDONCrossedOverMaxUpper = isDONCrossedOverMaxUpper; - conditions.isDONCrossedUnderMaxUpper = isDONCrossedUnderMaxUpper; - - // - // XPV ... - - // - pv.CopyPeak( - barIndex, - mNumberOfItems, - conditions.pvPeaks // - ); - pv.CopyVale( - barIndex, - mNumberOfItems, - conditions.pvVales // - ); - pv.CopyResistance( - barIndex, - mNumberOfItems, - conditions.pvResistances // - ); - pv.CopySupport( - barIndex, - mNumberOfItems, - conditions.pvSupports // - ); - pv.CopyFib1( - barIndex, - mNumberOfItems, - conditions.pvFib1s // - ); - pv.CopyFib2( - barIndex, - mNumberOfItems, - conditions.pvFib2s // - ); - pv.CopyFib3( - barIndex, - mNumberOfItems, - conditions.pvFib3s // - ); - pv.CopyFib4( - barIndex, - mNumberOfItems, - conditions.pvFib4s // - ); - pv.CopyFib5( - barIndex, - mNumberOfItems, - conditions.pvFib5s // - ); - pv.CopySCHH( - barIndex, - mNumberOfItems, - conditions.pvSCHHs // - ); - pv.CopySCLL( - barIndex, - mNumberOfItems, - conditions.pvSCLLs // - ); - pv.CopyMCHH( - barIndex, - mNumberOfItems, - conditions.pvMCHHs // - ); - pv.CopyMCLL( - barIndex, - mNumberOfItems, - conditions.pvMCLLs // - ); - pv.CopyLCHH( - barIndex, - mNumberOfItems, - conditions.pvLCHHs // - ); - pv.CopyLCLL( - barIndex, - mNumberOfItems, - conditions.pvLCLLs // - ); - pv.CopyHCHH( - barIndex, - mNumberOfItems, - conditions.pvHCHHs // - ); - pv.CopyHCLL( - barIndex, - mNumberOfItems, - conditions.pvHCLLs // - ); - - // - double pvPeak = conditions.pvPeaks[curr]; - double pvPeakPrev = conditions.pvPeaks[prev]; - - // - double pvVale = conditions.pvVales[curr]; - double pvValePrev = conditions.pvVales[prev]; - - // - double pvFib1 = conditions.pvFib1s[curr]; - double pvFib2 = conditions.pvFib2s[curr]; - double pvFib3 = conditions.pvFib3s[curr]; - double pvFib4 = conditions.pvFib4s[curr]; - double pvFib5 = conditions.pvFib5s[curr]; - - // - double pvFib1Prev = conditions.pvFib1s[prev]; - double pvFib2Prev = conditions.pvFib2s[prev]; - double pvFib3Prev = conditions.pvFib3s[prev]; - double pvFib4Prev = conditions.pvFib4s[prev]; - double pvFib5Prev = conditions.pvFib5s[prev]; - - // - bool isPVPeakSameAs = IsSame(conditions.pvPeaks); - bool isPVNewPeak = NotEmpty(pvPeak) && pvPeak != pvPeakPrev; - bool isPVNewPeakOverLast = isPVNewPeak && pvPeak > pvPeakPrev; - bool isPVNewPeakUnderLast = isPVNewPeak && pvPeak < pvPeakPrev; - bool isPVValeSameAs = IsSame(conditions.pvVales); - bool isPVNewVale = NotEmpty(pvVale) && pvVale != pvValePrev; - bool isPVNewValeOverLast = isPVNewVale && pvVale > pvValePrev; - bool isPVNewValeUnderLast = isPVNewVale && pvVale < pvValePrev; - bool isPVFiboIncreased = - // - pvFib1 > pvFib1Prev && - pvFib2 > pvFib2Prev && - pvFib3 > pvFib3Prev && - pvFib4 > pvFib4Prev && - pvFib5 > pvFib5Prev - // - ; - bool isPVFiboDecreased = - // - pvFib1 < pvFib1Prev && - pvFib2 < pvFib2Prev && - pvFib3 < pvFib3Prev && - pvFib4 < pvFib4Prev && - pvFib5 < pvFib5Prev - // - ; - - bool isPVFiboSectionChanged = - // - (isPVNewPeakUnderLast && isPVFiboDecreased) - // - || - // - (isPVNewValeOverLast && isPVFiboIncreased) - // - ; - - // - conditions.isPVPeakSameAs = isPVPeakSameAs; - conditions.isPVNewPeak = isPVNewPeak; - conditions.isPVNewPeakOverLast = isPVNewPeakOverLast; - conditions.isPVNewPeakUnderLast = isPVNewPeakUnderLast; - conditions.isPVValeSameAs = isPVValeSameAs; - conditions.isPVNewVale = isPVNewVale; - conditions.isPVNewValeOverLast = isPVNewValeOverLast; - conditions.isPVNewValeUnderLast = isPVNewValeUnderLast; - conditions.isPVFiboIncreased = isPVFiboIncreased; - conditions.isPVFiboDecreased = isPVFiboDecreased; - conditions.isPVFiboSectionChanged = isPVFiboSectionChanged; - - // - // XPV Cycles ... - - // - double pvSCHH = conditions.pvSCHHs[curr]; - double pvSCLL = conditions.pvSCLLs[curr]; - double pvMCHH = conditions.pvMCHHs[curr]; - double pvMCLL = conditions.pvMCLLs[curr]; - double pvLCHH = conditions.pvLCHHs[curr]; - double pvLCLL = conditions.pvLCLLs[curr]; - double pvHCHH = conditions.pvHCHHs[curr]; - double pvHCLL = conditions.pvHCLLs[curr]; - - // - double pvSCHHPrev = conditions.pvSCHHs[prev]; - double pvSCLLPrev = conditions.pvSCLLs[prev]; - double pvMCHHPrev = conditions.pvMCHHs[prev]; - double pvMCLLPrev = conditions.pvMCLLs[prev]; - double pvLCHHPrev = conditions.pvLCHHs[prev]; - double pvLCLLPrev = conditions.pvLCLLs[prev]; - double pvHCHHPrev = conditions.pvHCHHs[prev]; - double pvHCLLPrev = conditions.pvHCLLs[prev]; - - // - double pvSCHHPrevPrev = conditions.pvSCHHs[prev + 1]; - double pvSCLLPrevPrev = conditions.pvSCLLs[prev + 1]; - double pvMCHHPrevPrev = conditions.pvMCHHs[prev + 1]; - double pvMCLLPrevPrev = conditions.pvMCLLs[prev + 1]; - double pvLCHHPrevPrev = conditions.pvLCHHs[prev + 1]; - double pvLCLLPrevPrev = conditions.pvLCLLs[prev + 1]; - double pvHCHHPrevPrev = conditions.pvHCHHs[prev + 1]; - double pvHCLLPrevPrev = conditions.pvHCLLs[prev + 1]; - - // - // Short ... - - // - bool isPVSCHHBullish = pvSCHH > pvSCHHPrev; - bool isPVSCHHBullishPrev = pvSCHHPrev > pvSCHHPrevPrev; - bool isPVSCLLBullish = pvSCLL > pvSCLLPrev; - bool isPVSCLLBullishPrev = pvSCLLPrev > pvSCLLPrevPrev; - bool isPVSCBullish = - // - isPVSCHHBullish && - isPVSCLLBullish - // - ; - bool isPVSCBullishPrev = - // - isPVSCHHBullishPrev && - isPVSCLLBullishPrev - // - ; - bool isPVSCSwitchedToBullish = - // - isPVSCBullish && - !isPVSCBullishPrev - // - ; - - // - bool isPVSCHHBearish = pvSCHH < pvSCHHPrev; - bool isPVSCHHBearishPrev = pvSCHHPrev < pvSCHHPrevPrev; - bool isPVSCLLBearish = pvSCLL < pvSCLLPrev; - bool isPVSCLLBearishPrev = pvSCLLPrev < pvSCLLPrevPrev; - bool isPVSCBearish = - // - isPVSCHHBearish && - isPVSCLLBearish - // - ; - bool isPVSCBearishPrev = - // - isPVSCHHBearishPrev && - isPVSCLLBearishPrev - // - ; - bool isPVSCSwitchedToBearish = - // - isPVSCBearish && - !isPVSCBearishPrev - // - ; - - // - // Medium ... - - // - bool isPVMCHHBullish = pvMCHH > pvMCHHPrev; - bool isPVMCHHBullishPrev = pvMCHHPrev > pvMCHHPrevPrev; - bool isPVMCLLBullish = pvMCLL > pvMCLLPrev; - bool isPVMCLLBullishPrev = pvMCLLPrev > pvMCLLPrevPrev; - bool isPVMCBullish = - // - isPVMCHHBullish && - isPVMCLLBullish - // - ; - bool isPVMCBullishPrev = - // - isPVMCHHBullishPrev && - isPVMCLLBullishPrev - // - ; - bool isPVMCSwitchedToBullish = - // - isPVMCBullish && - !isPVMCBullishPrev - // - ; - - // - bool isPVMCHHBearish = pvMCHH < pvMCHHPrev; - bool isPVMCHHBearishPrev = pvMCHHPrev < pvMCHHPrevPrev; - bool isPVMCLLBearish = pvMCLL < pvMCLLPrev; - bool isPVMCLLBearishPrev = pvMCLLPrev < pvMCLLPrevPrev; - bool isPVMCBearish = - // - isPVMCHHBearish && - isPVMCLLBearish - // - ; - bool isPVMCBearishPrev = - // - isPVMCHHBearishPrev && - isPVMCLLBearishPrev - // - ; - bool isPVMCSwitchedToBearish = - // - isPVMCBearish && - !isPVMCBearishPrev - // - ; - - // - // Long ... - - // - bool isPVLCHHBullish = pvLCHH > pvLCHHPrev; - bool isPVLCHHBullishPrev = pvLCHHPrev > pvLCHHPrevPrev; - bool isPVLCLLBullish = pvLCLL > pvLCLLPrev; - bool isPVLCLLBullishPrev = pvLCLLPrev > pvLCLLPrevPrev; - bool isPVLCBullish = - // - isPVLCHHBullish && - isPVLCLLBullish - // - ; - bool isPVLCBullishPrev = - // - isPVLCHHBullishPrev && - isPVLCLLBullishPrev - // - ; - bool isPVLCSwitchedToBullish = - // - isPVLCBullish && - !isPVLCBullishPrev - // - ; - - // - bool isPVLCHHBearish = pvLCHH < pvLCHHPrev; - bool isPVLCHHBearishPrev = pvLCHHPrev < pvLCHHPrevPrev; - bool isPVLCLLBearish = pvLCLL < pvLCLLPrev; - bool isPVLCLLBearishPrev = pvLCLLPrev < pvLCLLPrevPrev; - bool isPVLCBearish = - // - isPVLCHHBearish && - isPVLCLLBearish - // - ; - bool isPVLCBearishPrev = - // - isPVLCHHBearishPrev && - isPVLCLLBearishPrev - // - ; - bool isPVLCSwitchedToBearish = - // - isPVLCBearish && - !isPVLCBearishPrev - // - ; - - // - // Hind ... - - // - bool isPVHCHHBullish = pvHCHH > pvHCHHPrev; - bool isPVHCHHBullishPrev = pvHCHHPrev > pvHCHHPrevPrev; - bool isPVHCLLBullish = pvHCLL > pvHCLLPrev; - bool isPVHCLLBullishPrev = pvHCLLPrev > pvHCLLPrevPrev; - bool isPVHCBullish = - // - isPVHCHHBullish && - isPVHCLLBullish - // - ; - bool isPVHCBullishPrev = - // - isPVHCHHBullishPrev && - isPVHCLLBullishPrev - // - ; - bool isPVHCSwitchedToBullish = - // - isPVHCBullish && - !isPVHCBullishPrev - // - ; - - // - bool isPVHCHHBearish = pvHCHH < pvHCHHPrev; - bool isPVHCHHBearishPrev = pvHCHHPrev < pvHCHHPrevPrev; - bool isPVHCLLBearish = pvHCLL < pvHCLLPrev; - bool isPVHCLLBearishPrev = pvHCLLPrev < pvHCLLPrevPrev; - bool isPVHCBearish = - // - isPVHCHHBearish && - isPVHCLLBearish - // - ; - bool isPVHCBearishPrev = - // - isPVHCHHBearishPrev && - isPVHCLLBearishPrev - // - ; - bool isPVHCSwitchedToBearish = - // - isPVHCBearish && - !isPVHCBearishPrev - // - ; - - // - conditions.isPVSCHHBullish = isPVSCHHBullish; - conditions.isPVSCLLBullish = isPVSCLLBullish; - conditions.isPVSCBullish = isPVSCBullish; - conditions.isPVSCSwitchedToBullish = isPVSCSwitchedToBullish; - conditions.isPVSCHHBearish = isPVSCHHBearish; - conditions.isPVSCLLBearish = isPVSCLLBearish; - conditions.isPVSCBearish = isPVSCBearish; - conditions.isPVSCSwitchedToBearish = isPVSCSwitchedToBearish; - conditions.isPVMCHHBullish = isPVMCHHBullish; - conditions.isPVMCLLBullish = isPVMCLLBullish; - conditions.isPVMCBullish = isPVMCBullish; - conditions.isPVMCSwitchedToBullish = isPVMCSwitchedToBullish; - conditions.isPVMCHHBearish = isPVMCHHBearish; - conditions.isPVMCLLBearish = isPVMCLLBearish; - conditions.isPVMCBearish = isPVMCBearish; - conditions.isPVMCSwitchedToBearish = isPVMCSwitchedToBearish; - conditions.isPVLCHHBullish = isPVLCHHBullish; - conditions.isPVLCLLBullish = isPVLCLLBullish; - conditions.isPVLCBullish = isPVLCBullish; - conditions.isPVLCSwitchedToBullish = isPVLCSwitchedToBullish; - conditions.isPVLCHHBearish = isPVLCHHBearish; - conditions.isPVLCLLBearish = isPVLCLLBearish; - conditions.isPVLCBearish = isPVLCBearish; - conditions.isPVLCSwitchedToBearish = isPVLCSwitchedToBearish; - conditions.isPVHCHHBullish = isPVHCHHBullish; - conditions.isPVHCLLBullish = isPVHCLLBullish; - conditions.isPVHCBullish = isPVHCBullish; - conditions.isPVHCSwitchedToBullish = isPVHCSwitchedToBullish; - conditions.isPVHCHHBearish = isPVHCHHBearish; - conditions.isPVHCLLBearish = isPVHCLLBearish; - conditions.isPVHCBearish = isPVHCBearish; - conditions.isPVHCSwitchedToBearish = isPVHCSwitchedToBearish; - - // - // XSTR ... - - // - str.CopyTrend( - barIndex, - mNumberOfItems, - conditions.strTrends // - ); - str.CopyState( - barIndex, - mNumberOfItems, - conditions.strStates // - ); - - // - bool isTrendBullish = - // - str.IsBullish(str.GetState(curr)) - // - ; - bool isTrendBearish = - // - str.IsBearish(str.GetState(curr)) - // - ; - - // - bool isTrendBullishPrev = - // - str.IsBullish(str.GetState(prev)) - // - ; - bool isTrendBearishPrev = - // - str.IsBearish(str.GetState(prev)) - // - ; - - // - conditions.isTrendBullish = isTrendBullish; - conditions.isTrendBearish = isTrendBearish; - conditions.isTrendSwitchedToBullish = - // - isTrendBullish && - !isTrendBullishPrev - // - ; - conditions.isTrendSwitchedToBearish = - // - isTrendBearish && - !isTrendBearishPrev - // - ; - - // - // XCHE ... - - // - che.CopyLongExit1( - barIndex, - mNumberOfItems, - conditions.cheLongExit1s // - ); - che.CopyLongExit2( - barIndex, - mNumberOfItems, - conditions.cheLongExit2s // - ); - che.CopyShortExit1( - barIndex, - mNumberOfItems, - conditions.cheShortExit1s // - ); - che.CopyShortExit2( - barIndex, - mNumberOfItems, - conditions.cheShortExit2s // - ); - - // - bool isCHEInLong = - // - NotEmpty(che.GetLongExit1(curr)) - // - ; - bool isCHEInLongPrev = - // - NotEmpty(che.GetLongExit1(prev)) - // - ; - bool isCHEInStrongLong = - // - isCHEInLong && - NotEmpty(che.GetLongExit2(curr)) - // - ; - bool isCHEInStrongLongPrev = - // - isCHEInLongPrev && - NotEmpty(che.GetLongExit2(prev)) - // - ; - bool isCHEInShort = - // - NotEmpty(che.GetShortExit1(curr)) - // - ; - bool isCHEInShortPrev = - // - NotEmpty(che.GetShortExit1(prev)) - // - ; - bool isCHEInStrongShort = - // - isCHEInShort && - NotEmpty(che.GetShortExit2(curr)) - // - ; - bool isCHEInStrongShortPrev = - // - isCHEInShortPrev && - NotEmpty(che.GetShortExit2(prev)) - // - ; - - // - conditions.isCHEInLong = isCHEInLong; - conditions.isCHEInStrongLong = isCHEInStrongLong; - conditions.isCHESwitchedInStrongLong = - // - isCHEInStrongLong && - !isCHEInStrongLongPrev - // - ; - conditions.isCHEInShort = isCHEInShort; - conditions.isCHEInStrongShort = isCHEInStrongShort; - conditions.isCHESwitchedInStrongShort = - // - isCHEInStrongShort && - !isCHEInStrongShortPrev - // - ; - - // - // XMC ... - - // - mc.CopyFast( - barIndex, - mNumberOfItems, - conditions.mcFasts // - ); - mc.CopySlow( - barIndex, - mNumberOfItems, - conditions.mcSlows // - ); - mc.CopyVerifier( - barIndex, - mNumberOfItems, - conditions.mcVerifiers // - ); - - // - bool isFastOverSlow = - // - conditions.mcFasts[curr] > conditions.mcSlows[curr] && - conditions.mcFasts[prev] > conditions.mcSlows[prev] - // - ; - bool isFastUnderSlow = - // - conditions.mcFasts[curr] < conditions.mcSlows[curr] && - conditions.mcFasts[prev] < conditions.mcSlows[prev] - // - ; - bool isFastOverVerifier = - // - conditions.mcFasts[curr] > conditions.mcVerifiers[curr] && - conditions.mcFasts[prev] > conditions.mcVerifiers[prev] - // - ; - bool isFastUnderVerifier = - // - conditions.mcFasts[curr] < conditions.mcVerifiers[curr] && - conditions.mcFasts[prev] < conditions.mcVerifiers[prev] - // - ; - bool isSlowOverVerifier = - // - conditions.mcSlows[curr] > conditions.mcVerifiers[curr] && - conditions.mcSlows[prev] > conditions.mcVerifiers[prev] - // - ; - bool isSlowUnderVerifier = - // - conditions.mcSlows[curr] < conditions.mcVerifiers[curr] && - conditions.mcSlows[prev] < conditions.mcVerifiers[prev] - // - ; - bool isCloseOverFast = - // - pBar.close > conditions.mcFasts[prev] - // - ; - bool isCloseUnderFast = - // - pBar.close < conditions.mcFasts[prev] - // - ; - bool isCloseOverSlow = - // - pBar.close > conditions.mcSlows[prev] - // - ; - bool isCloseUnderSlow = - // - pBar.close < conditions.mcSlows[prev] - // - ; - bool isCloseOverVerifier = - // - pBar.close > conditions.mcVerifiers[prev] - // - ; - bool isCloseUnderVerifier = - // - pBar.close < conditions.mcVerifiers[prev] - // - ; - - // - bool isFastCrossedOverSlow = - // - conditions.mcFasts[curr] > conditions.mcSlows[curr] && - conditions.mcFasts[prev] <= conditions.mcSlows[prev] - // - ; - - // - bool isFastCrossedUnderSlow = - // - conditions.mcFasts[curr] < conditions.mcSlows[curr] && - conditions.mcFasts[prev] >= conditions.mcSlows[prev] - // - ; - - // - bool isFastCrossedOverVerifier = - // - conditions.mcFasts[curr] > conditions.mcVerifiers[curr] && - conditions.mcFasts[prev] <= conditions.mcVerifiers[prev] - // - ; - - // - bool isFastCrossedUnderVerifier = - // - conditions.mcFasts[curr] < conditions.mcVerifiers[curr] && - conditions.mcFasts[prev] >= conditions.mcVerifiers[prev] - // - ; - - // - bool isSlowCrossedOverVerifier = - // - conditions.mcSlows[curr] > conditions.mcVerifiers[curr] && - conditions.mcSlows[prev] <= conditions.mcVerifiers[prev] - // - ; - - // - bool isSlowCrossedUnderVerifier = - // - conditions.mcSlows[curr] < conditions.mcVerifiers[curr] && - conditions.mcSlows[prev] >= conditions.mcVerifiers[prev] - // - ; - - // - conditions.isFastOverSlow = isFastOverSlow; - conditions.isFastUnderSlow = isFastUnderSlow; - conditions.isFastOverVerifier = isFastOverVerifier; - conditions.isFastUnderVerifier = isFastUnderVerifier; - conditions.isSlowOverVerifier = isSlowOverVerifier; - conditions.isSlowUnderVerifier = isSlowUnderVerifier; - conditions.isCloseOverFast = isCloseOverFast; - conditions.isCloseUnderFast = isCloseUnderFast; - conditions.isCloseOverSlow = isCloseOverSlow; - conditions.isCloseUnderSlow = isCloseUnderSlow; - conditions.isCloseOverVerifier = isCloseOverVerifier; - conditions.isCloseUnderVerifier = isCloseUnderVerifier; - conditions.isFastCrossedOverSlow = isFastCrossedOverSlow; - conditions.isFastCrossedUnderSlow = isFastCrossedUnderSlow; - conditions.isFastCrossedOverVerifier = isFastCrossedOverVerifier; - conditions.isFastCrossedUnderVerifier = isFastCrossedUnderVerifier; - conditions.isSlowCrossedOverVerifier = isSlowCrossedOverVerifier; - conditions.isSlowCrossedUnderVerifier = isSlowCrossedUnderVerifier; - - // - // XICH ... - - // - ich.CopyTenkanSen( - barIndex, - mNumberOfItems, - conditions.ichTenkanSens // - ); - ich.CopyKijunSen( - barIndex, - mNumberOfItems, - conditions.ichKijunSens // - ); - ich.CopyChikouSpan( - barIndex, - mNumberOfItems, - conditions.ichChikouSpans // - ); - ich.CopySenkouSpanA( - barIndex, - mNumberOfItems, - conditions.ichSenkouSpanBs // - ); - ich.CopySenkouSpanB( - barIndex, - mNumberOfItems, - conditions.ichSenkouSpanAs // - ); - - // - double tenkanSen = ich.GetTenkanSen(curr); - double tenkanSenPrev = ich.GetTenkanSen(prev); - - // - double kijunSen = ich.GetKijunSen(curr); - double kijunSenPrev = ich.GetKijunSen(prev); - - // - double senkouSpanA = ich.GetSenkouSpanA(curr); - double senkouSpanAPrev = ich.GetSenkouSpanA(prev); - - // - double senkouSpanB = ich.GetSenkouSpanB(curr); - double senkouSpanBPrev = ich.GetSenkouSpanB(prev); - - // - double futureSenkouSpanA = ich.GetFutureSenkouSpanA(curr); - double futureSenkouSpanAPrev = ich.GetFutureSenkouSpanA(prev); - - // - double futureSenkouSpanB = ich.GetFutureSenkouSpanB(curr); - double futureSenkouSpanBPrev = ich.GetFutureSenkouSpanB(prev); - - // - bool isSenkouSpanAOverB = senkouSpanA > senkouSpanB; - bool isSenkouSpanAUnderB = senkouSpanA < senkouSpanB; - bool isSenkouSpanAOverLast = senkouSpanA > senkouSpanAPrev; - bool isSenkouSpanAUnderLast = senkouSpanA < senkouSpanAPrev; - bool isFutureSenkouSpanAOverB = futureSenkouSpanA > futureSenkouSpanB; - bool isFutureSenkouSpanAUnderB = futureSenkouSpanA < futureSenkouSpanB; - bool isFutureSenkouSpanAOverLast = futureSenkouSpanA > futureSenkouSpanAPrev; - bool isFutureSenkouSpanAUnderLast = futureSenkouSpanA < futureSenkouSpanAPrev; - bool isCloseOverKijunSen = pBar.close > kijunSenPrev; - bool isCloseUnderKijunSen = pBar.close < kijunSenPrev; - bool isTenkanSenOverKijunSen = tenkanSen > kijunSen; - bool isTenkanSenUnderKijunSen = tenkanSen < kijunSen; - bool isTenkanSenPrevOverKijunSen = tenkanSenPrev > kijunSenPrev; - bool isTenkanSenPrevUnderKijunSen = tenkanSenPrev < kijunSenPrev; - bool isTenkanSenCrossedOverKijunSen = - // - isTenkanSenOverKijunSen && - !isTenkanSenPrevOverKijunSen - // - ; - bool isTenkanSenCrossedUnderKijunSen = - // - isTenkanSenUnderKijunSen && - !isTenkanSenPrevUnderKijunSen - // - ; - - // - conditions.isSenkouSpanAOverB = isSenkouSpanAOverB; - conditions.isSenkouSpanAUnderB = isSenkouSpanAUnderB; - conditions.isSenkouSpanAOverLast = isSenkouSpanAOverLast; - conditions.isSenkouSpanAUnderLast = isSenkouSpanAUnderLast; - conditions.isFutureSenkouSpanAOverB = isFutureSenkouSpanAOverB; - conditions.isFutureSenkouSpanAUnderB = isFutureSenkouSpanAUnderB; - conditions.isFutureSenkouSpanAOverLast = isFutureSenkouSpanAOverLast; - conditions.isFutureSenkouSpanAUnderLast = isFutureSenkouSpanAUnderLast; - conditions.isCloseOverKijunSen = isCloseOverKijunSen; - conditions.isCloseUnderKijunSen = isCloseUnderKijunSen; + conditions.isClosedOverKijunSen = isClosedOverKijunSen; + conditions.isClosedUnderKijunSen = isClosedUnderKijunSen; conditions.isTenkanSenOverKijunSen = isTenkanSenOverKijunSen; conditions.isTenkanSenUnderKijunSen = isTenkanSenUnderKijunSen; conditions.isTenkanSenCrossedOverKijunSen = isTenkanSenCrossedOverKijunSen; conditions.isTenkanSenCrossedUnderKijunSen = isTenkanSenCrossedUnderKijunSen; // - // XOSC ... + conditions.isSenkouSpanAOverB = isSenkouSpanACrossedOverB; + conditions.isSenkouSpanAUnderB = isSenkouSpanACrossedUnderB; + conditions.isSenkouSpanAOverLast = isSenkouSpanACrossedOverLast; + conditions.isSenkouSpanAUnderLast = isSenkouSpanACrossedUnderLast; + conditions.isFutureSenkouSpanAOverB = isFutureSenkouSpanACrossedOverB; + conditions.isFutureSenkouSpanAUnderB = isFutureSenkouSpanACrossedUnderB; + conditions.isFutureSenkouSpanAOverLast = isFutureSenkouSpanACrossedOverLast; + conditions.isFutureSenkouSpanAUnderLast = isFutureSenkouSpanACrossedUnderLast; // - // ATR ... - osc.CopyATR( - barIndex, - mNumberOfItems, - conditions.oscAtrs // - ); + conditions.isSenkouSpanACrossedOverB = isSenkouSpanACrossedOverB; + conditions.isSenkouSpanACrossedUnderB = isSenkouSpanACrossedUnderB; + conditions.isSenkouSpanACrossedOverLast = isSenkouSpanACrossedOverLast; + conditions.isSenkouSpanACrossedUnderLast = isSenkouSpanACrossedUnderLast; + conditions.isFutureSenkouSpanACrossedOverB = isFutureSenkouSpanACrossedOverB; + conditions.isFutureSenkouSpanACrossedUnderB = isFutureSenkouSpanACrossedUnderB; + conditions.isFutureSenkouSpanACrossedOverLast = isFutureSenkouSpanACrossedOverLast; + conditions.isFutureSenkouSpanACrossedUnderLast = isFutureSenkouSpanACrossedUnderLast; // - // VOLUE ... - osc.CopyVolume( - barIndex, - mNumberOfItems, - conditions.oscVolumes // - ); + conditions.isMCFastOverSlow = isMCFastOverSlow; + conditions.isMCFastUnderSlow = isMCFastUnderSlow; + conditions.isMCFastOverVerifier = isMCFastOverVerifier; + conditions.isMCFastUnderVerifier = isMCFastUnderVerifier; + conditions.isMCSlowOverVerifier = isMCSlowOverVerifier; + conditions.isMCSlowUnderVerifier = isMCSlowUnderVerifier; + conditions.isMCFastCrossedOverSlow = isMCFastCrossedOverSlow; + conditions.isMCFastCrossedUnderSlow = isMCFastCrossedUnderSlow; + conditions.isMCFastCrossedOverVerifier = isMCFastCrossedOverVerifier; + conditions.isMCFastCrossedUnderVerifier = isMCFastCrossedUnderVerifier; + conditions.isMCSlowCrossedOverVerifier = isMCSlowCrossedOverVerifier; + conditions.isMCSlowCrossedUnderVerifier = isMCSlowCrossedUnderVerifier; // - // MOMENTUM ... - osc.CopyMomentum( - barIndex, - mNumberOfItems, - conditions.oscMomentums // - ); + conditions.isTrendBullish = isTrendBullish; + conditions.isTrendBearish = isTrendBearish; + conditions.isTrendSwitchedToBullish = isTrendSwitchedToBullish; + conditions.isTrendSwitchedToBearish = isTrendSwitchedToBearish; // - // SAR ... - osc.CopySAR( - barIndex, - mNumberOfItems, - conditions.oscSars // - ); + conditions.isZigZagInPeak = isZigZagInPeak; + conditions.isZigZagInVale = isZigZagInVale; // - // RVI ... + conditions.isMRBFastOverSlow = isMRBFastOverSlow; + conditions.isMRBFastUnderSlow = isMRBFastUnderSlow; + conditions.isMRBFastCrossedOverSlow = isMRBFastCrossedOverSlow; + conditions.isMRBFastCrossedUnderSlow = isMRBFastCrossedUnderSlow; + conditions.isMRBFastOverVerifier = isMRBFastOverVerifier; + conditions.isMRBFastUnderVerifier = isMRBFastUnderVerifier; + conditions.isMRBFastCrossedtOverVerifier = isMRBFastCrossedtOverVerifier; + conditions.isMRBFastCrossedUnderVerifier = isMRBFastCrossedUnderVerifier; + conditions.isMRBSlowOverVerifier = isMRBSlowOverVerifier; + conditions.isMRBSlowUnderVerifier = isMRBSlowUnderVerifier; + conditions.isMRBSlowCrossedtOverVerifier = isMRBSlowCrossedtOverVerifier; + conditions.isMRBSlowCrossedUnderVerifier = isMRBSlowCrossedUnderVerifier; // - osc.CopyRVI( - barIndex, - mNumberOfItems, - conditions.oscRviMains // - ); - osc.CopyRVISignal( - barIndex, - mNumberOfItems, - conditions.oscRviSignals // - ); + conditions.isCHEBullish = isCHEBullish; + conditions.isCHEBearish = isCHEBearish; + conditions.isCHESwitchedToBullish = isCHESwitchedToBullish; + conditions.isCHESwitchedToBearish = isCHESwitchedToBearish; // - double rvi = osc.GetRVI(curr); - double rviSignal = osc.GetRVISignal(curr); + conditions.isTDBullish = isTDBullish; + conditions.isTDBearish = isTDBearish; + conditions.isTDSwitchedToBullish = isTDSwitchedToBullish; + conditions.isTDSwitchedToBearish = isTDSwitchedToBearish; // - bool isRVILongStart = - // - rvi > 0 && - rviSignal > 0 && - rvi > rviSignal - // - ; - bool isRVILongStop = - // - rvi < 0 && - rviSignal < 0 && - rvi < rviSignal - // - ; - bool isRVIShortStart = - // - rvi < 0 && - rviSignal < 0 && - rvi < rviSignal - // - ; - bool isRVIShortStop = - // - rvi > 0 && - rviSignal > 0 && - rvi > rviSignal - // - ; + conditions.isDONAttachedMaxLower = isDONAttachedMaxLower; + conditions.isDONAttachedMinLower = isDONAttachedMinLower; + conditions.isDONCrossedOverMaxLower = isDONCrossedOverMaxLower; + conditions.isDONCrossedUnderMaxLower = isDONCrossedUnderMaxLower; + conditions.isDONCrossedOverMinLower = isDONCrossedOverMinLower; + conditions.isDONCrossedUnderMinLower = isDONCrossedUnderMinLower; // - conditions.isRVILongStart = isRVILongStart; - conditions.isRVILongStop = isRVILongStop; - conditions.isRVIShortStart = isRVIShortStart; - conditions.isRVIShortStop = isRVIShortStop; + conditions.isDONAttachedMaxUpper = isDONAttachedMaxUpper; + conditions.isDONAttachedMinUpper = isDONAttachedMinUpper; + conditions.isDONCrossedOverMaxUpper = isDONCrossedOverMaxUpper; + conditions.isDONCrossedUnderMaxUpper = isDONCrossedUnderMaxUpper; + conditions.isDONCrossedOverMinUpper = isDONCrossedOverMinUpper; + conditions.isDONCrossedUnderMinUpper = isDONCrossedUnderMinUpper; // - // RSI ... + conditions.isNewPeak = isNewPeak; + conditions.isNewPeakOverLast = isNewPeakOverLast; + conditions.isNewPeakUnderLast = isNewPeakUnderLast; // - osc.CopyRSI( - barIndex, - mNumberOfItems, - conditions.oscRsis // - ); + conditions.isNewVale = isNewVale; + conditions.isNewValeOverLast = isNewValeOverLast; + conditions.isNewValeUnderLast = isNewValeUnderLast; // - double rsi = osc.GetRSI(curr); + conditions.isFiboIncreased = isFiboIncreased; + conditions.isFiboDecreased = isFiboDecreased; + conditions.isFiboSectionChanged = isFiboSectionChanged; // - bool isRSIUnder50 = - // - rsi < 50 - // - ; - bool isRSIOver70 = - // - rsi > 70 - // - ; - bool isRSIOver50 = - // - rsi > 50 - // - ; - bool isRSIUnder30 = - // - rsi < 30 - // - ; + conditions.isSCBullish = isSCBullish; + conditions.isSCHHBullish = isSCHHBullish; + conditions.isSCLLBullish = isSCLLBullish; + conditions.isSCSwitchedToBullish = isSCSwitchedToBullish; + conditions.isSCHHSwitchedToBullish = isSCHHSwitchedToBullish; + conditions.isSCLLSwitchedToBullish = isSCLLSwitchedToBullish; // - conditions.isRSIUnder50 = isRSIUnder50; - conditions.isRSIOver70 = isRSIOver70; - conditions.isRSIOver50 = isRSIOver50; - conditions.isRSIUnder30 = isRSIUnder30; + conditions.isSCBearish = isSCBearish; + conditions.isSCHHBearish = isSCHHBearish; + conditions.isSCLLBearish = isSCLLBearish; + conditions.isSCSwitchedToBearish = isSCSwitchedToBearish; + conditions.isSCHHSwitchedToBearish = isSCHHSwitchedToBearish; + conditions.isSCLLSwitchedToBeraish = isSCLLSwitchedToBeraish; // - // BULLPOWER ... + conditions.isMCBullish = isMCBullish; + conditions.isMCHHBullish = isMCHHBullish; + conditions.isMCLLBullish = isMCLLBullish; + conditions.isMCSwitchedToBullish = isMCSwitchedToBullish; + conditions.isMCHHSwitchedToBullish = isMCHHSwitchedToBullish; + conditions.isMCLLSwitchedToBullish = isMCLLSwitchedToBullish; // - osc.CopyBullPower( - barIndex, - mNumberOfItems, - conditions.oscBullPs // - ); + conditions.isMCBearish = isMCBearish; + conditions.isMCHHBearish = isMCHHBearish; + conditions.isMCLLBearish = isMCLLBearish; + conditions.isMCSwitchedToBearish = isMCSwitchedToBearish; + conditions.isMCHHSwitchedToBearish = isMCHHSwitchedToBearish; + conditions.isMCLLSwitchedToBeraish = isMCLLSwitchedToBeraish; // - double bullp = osc.GetBullPower(curr); - double bullpLast = osc.GetBullPower(prev); + conditions.isLCBullish = isLCBullish; + conditions.isLCHHBullish = isLCHHBullish; + conditions.isLCLLBullish = isLCLLBullish; + conditions.isLCSwitchedToBullish = isLCSwitchedToBullish; + conditions.isLCHHSwitchedToBullish = isLCHHSwitchedToBullish; + conditions.isLCLLSwitchedToBullish = isLCLLSwitchedToBullish; // - bool isBullPowerOverLast = - // - bullp > bullpLast - // - ; - bool isBullPoswerUnderLast = - // - bullp < bullpLast - // - ; - bool isBullPowerOverZero = - // - bullp > 0 - // - ; - bool isBullPoswerUnderZero = - // - bullp < 0 - // - ; + conditions.isLCBearish = isLCBearish; + conditions.isLCHHBearish = isLCHHBearish; + conditions.isLCLLBearish = isLCLLBearish; + conditions.isLCSwitchedToBearish = isLCSwitchedToBearish; + conditions.isLCHHSwitchedToBearish = isLCHHSwitchedToBearish; + conditions.isLCLLSwitchedToBeraish = isLCLLSwitchedToBeraish; // - conditions.isBullPowerOverLast = isBullPowerOverLast; - conditions.isBullPoswerUnderLast = isBullPoswerUnderLast; - conditions.isBullPowerOverZero = isBullPowerOverZero; - conditions.isBullPoswerUnderZero = isBullPoswerUnderZero; + conditions.isHCBullish = isHCBullish; + conditions.isHCHHBullish = isHCHHBullish; + conditions.isHCLLBullish = isHCLLBullish; + conditions.isHCSwitchedToBullish = isHCSwitchedToBullish; + conditions.isHCHHSwitchedToBullish = isHCHHSwitchedToBullish; + conditions.isHCLLSwitchedToBullish = isHCLLSwitchedToBullish; // - // BEARPOWER ... - - // - osc.CopyBearPower( - barIndex, - mNumberOfItems, - conditions.oscBearPs // - ); - - // - double bearp = osc.GetBearPower(curr); - double bearpLast = osc.GetBearPower(prev); - - // - bool isBearPowerOverLast = - // - bearp > bearpLast - // - ; - bool isBearPoswerUnderLast = - // - bearp < bearpLast - // - ; - bool isBearPowerOverZero = - // - bearp > 0 - // - ; - bool isBearPoswerUnderZero = - // - bearp < 0 - // - ; - - // - conditions.isBearPowerOverLast = isBearPowerOverLast; - conditions.isBearPoswerUnderLast = isBearPoswerUnderLast; - conditions.isBearPowerOverZero = isBearPowerOverZero; - conditions.isBearPoswerUnderZero = isBearPoswerUnderZero; - - // - // CCI ... - - // - osc.CopyCCI( - barIndex, - mNumberOfItems, - conditions.oscCcis // - ); - - // - double cci = osc.GetCCI(curr); - - // - bool isCCIPositive = - // - cci > 0 - // - ; - bool isCCINegative = - // - cci < 0 - // - ; - bool isCCIOverPositiveHundred = - // - cci > 100 - // - ; - bool isCCIUnderNegativeHundred = - // - cci < -100 - // - ; - - // - conditions.isCCIPositive = isCCIPositive; - conditions.isCCINegative = isCCINegative; - conditions.isCCIOverPositiveHundred = isCCIOverPositiveHundred; - conditions.isCCIUnderNegativeHundred = isCCIUnderNegativeHundred; - - // - // MACD ... - - // - osc.CopyMACD( - barIndex, - mNumberOfItems, - conditions.oscMacdMains // - ); - osc.CopyMACDSignal( - barIndex, - mNumberOfItems, - conditions.oscMacdSignals // - ); - - // - double macd = osc.GetMACD(curr); - double macdSignal = osc.GetMACDSignal(curr); - - // - bool isMACDPositiove = - // - macd > 0 - // - ; - bool isMACDNegative = - // - macd < 0 - // - ; - bool isMACDOverSignal = - // - macd > macdSignal - // - ; - bool isMACDUnderSignal = - // - macd < macdSignal - // - ; - - // - conditions.isMACDPositiove = isMACDPositiove; - conditions.isMACDNegative = isMACDNegative; - conditions.isMACDOverSignal = isMACDOverSignal; - conditions.isMACDUnderSignal = isMACDUnderSignal; - - // - // STOCH ... - - // - osc.CopySTOCH( - barIndex, - mNumberOfItems, - conditions.oscStochMains // - ); - osc.CopySTOCHSignal( - barIndex, - mNumberOfItems, - conditions.oscStochSignals // - ); - - // - double stoch = osc.GetSTOCH(curr); - double stochSignal = osc.GetSTOCHSignal(curr); - - // - bool isStochKOverD = - // - stoch > stochSignal - // - ; - bool isStochKDUnder50 = - // - stoch < 50 && - stochSignal < 50 - // - ; - bool isStochKUnderD = - // - stoch < stochSignal - // - ; - bool isStochKDOver50 = - // - stoch > 50 && - stochSignal > 50 - // - ; - bool isStochKDUnder20 = - // - stoch < 20 && - stochSignal < 20 - // - ; - bool isStochKDOver80 = - // - stoch > 80 && - stochSignal > 80 - // - ; - - // - conditions.isStochKOverD = isStochKOverD; - conditions.isStochKDUnder50 = isStochKDUnder50; - conditions.isStochKUnderD = isStochKUnderD; - conditions.isStochKDOver50 = isStochKDOver50; - conditions.isStochKDUnder20 = isStochKDUnder20; - conditions.isStochKDOver80 = isStochKDOver80; - - // - // STDDEV ... - - // - osc.CopySTDDEV( - barIndex, - mNumberOfItems, - conditions.oscStddevs // - ); - - // - double stdDevs[]; - osc.CopySTDDEV( - barIndex + 1, - 5, - stdDevs // - ); - double stdDevAVG = GetAverage(stdDevs); - - // - double stdDev = osc.GetSTDDEV(curr); - double stdDevLast = osc.GetSTDDEV(prev); - - // - bool isSTDDEVOverAVG = - // - stdDev > stdDevAVG - // - ; - bool isSTDDEVUnderAVG = - // - stdDev < stdDevAVG - // - ; - bool isSTDDEVOverLast = - // - stdDev > stdDevLast - // - ; - bool isSTDDEVUnderLast = - // - stdDev < stdDevLast - // - ; - - // - conditions.isSTDDEVOverAVG = isSTDDEVOverAVG; - conditions.isSTDDEVUnderAVG = isSTDDEVUnderAVG; - conditions.isSTDDEVOverLast = isSTDDEVOverLast; - conditions.isSTDDEVUnderLast = isSTDDEVUnderLast; + conditions.isHCBearish = isHCBearish; + conditions.isHCHHBearish = isHCHHBearish; + conditions.isHCLLBearish = isHCLLBearish; + conditions.isHCSwitchedToBearish = isHCSwitchedToBearish; + conditions.isHCHHSwitchedToBearish = isHCHHSwitchedToBearish; + conditions.isHCLLSwitchedToBeraish = isHCLLSwitchedToBeraish; } // @@ -4916,400 +3567,7 @@ public: bool HasX786LongConditions() { // - bool result = false; - - // - int zIndex = 0; - int cIndex = zIndex + 1; - int pIndex = cIndex + 1; - - // - XOHCL cBar = GetBar(cIndex); - XOHCL pBar = GetBar(pIndex); - - // - // XPV ... - - double cPVPeak = pv.GetPeak(cIndex); - double cPVVale = pv.GetVale(cIndex); - - // - double pPVPeak = pv.GetPeak(pIndex); - double pPVVale = pv.GetVale(pIndex); - - // - double cPVSup = pv.GetSupport(cIndex); - double pPVSup = pv.GetSupport(pIndex); - - // - double cPVRes = pv.GetResistance(cIndex); - double pPVRes = pv.GetResistance(pIndex); - - // - double cPVFib1 = pv.GetFib1(cIndex); - double cPVFib2 = pv.GetFib2(cIndex); - double cPVFib3 = pv.GetFib3(cIndex); - double cPVFib4 = pv.GetFib4(cIndex); - double cPVFib5 = pv.GetFib5(cIndex); - - // - double pPVFib1 = pv.GetFib1(pIndex); - double pPVFib2 = pv.GetFib2(pIndex); - double pPVFib3 = pv.GetFib3(pIndex); - double pPVFib4 = pv.GetFib4(pIndex); - double pPVFib5 = pv.GetFib5(pIndex); - - // - bool isNewPeak = cPVPeak != pPVPeak; - bool isNewPeakUnderLast = - // - isNewPeak && - cPVPeak < pPVPeak - // - ; - bool isNewPeakOverLast = - // - isNewPeak && - cPVPeak > pPVPeak - // - ; - - // - bool isNewVale = cPVVale != pPVVale; - bool isNewValeUnderLast = - // - isNewVale && - cPVVale < pPVVale - // - ; - bool isNewValeOverLast = - // - isNewVale && - cPVVale > pPVVale - // - ; - - // - bool isFiboIncreased = - // - cPVFib1 > pPVFib1 && - cPVFib2 > pPVFib2 && - cPVFib3 > pPVFib3 && - cPVFib4 > pPVFib4 && - cPVFib5 > pPVFib5 - // - ; - - // - bool isFiboDecreased = - // - cPVFib1 < pPVFib1 && - cPVFib2 < pPVFib2 && - cPVFib3 < pPVFib3 && - cPVFib4 < pPVFib4 && - cPVFib5 < pPVFib5 - // - ; - - // - bool isFiboSectionChanged = - // - (isFiboDecreased && - isNewPeakUnderLast) - // - || - // - (isFiboIncreased && - isNewValeOverLast) - // - ; - - // - // XHK ... - - // - XOHCL cSMHKBar; - hk.SMAsOHCL( - cSMHKBar, - cIndex // - ); - - // - XOHCL pSMHKBar; - hk.SMAsOHCL( - pSMHKBar, - pIndex // - ); - - // - bool isCSMHKBullish = cSMHKBar.IsBullish(); - bool isCSMHKBearish = cSMHKBar.IsBearish(); - - // - bool isPSMHKBullish = pSMHKBar.IsBullish(); - bool isPSMHKBearish = pSMHKBar.IsBearish(); - - // - bool isSMHKBullish = isCSMHKBullish; - bool isSMHKBearish = isCSMHKBearish; - bool isSMHKSwitchedToBullish = - // - isCSMHKBullish && - isPSMHKBearish - // - ; - - // - bool isSMHKSwitchedToBearish = - // - isCSMHKBearish && - isPSMHKBullish - // - ; - - // - // XSTR ... - - // - ENUM_XSTR_TREND_STATES cStrState = str - .GetState(cIndex); - double cStrTrend = str.GetTrend(cIndex); - bool isCStrBullish = cStrState == X_STR_BULLISH; - bool isCStrBearish = cStrState == X_STR_BEARISH; - - // - ENUM_XSTR_TREND_STATES pStrState = str - .GetState(pIndex); - double pStrTrend = str.GetTrend(pIndex); - bool isPStrBullish = pStrState == X_STR_BULLISH; - bool isPStrBearish = pStrState == X_STR_BEARISH; - - // - bool isTrendBullish = isCStrBullish; - bool isTrendBearish = isCStrBearish; - - // - bool isTrendSwitchedToBullish = - // - isCStrBullish && - !isPStrBullish - // - ; - - // - bool isTrendSwitchedToBearish = - // - isCStrBearish && - !isPStrBearish - // - ; - - // - // XTD ... - - // - double cTDBullish = td.GetBullish(cIndex); - double pTDBullish = td.GetBullish(pIndex); - - // - double cTDBearish = td.GetBearish(cIndex); - double pTDBearish = td.GetBearish(pIndex); - - // - bool isCTDBullish = - // - cTDBullish > cTDBearish - // - ; - - // - bool isCTDBearish = - // - cTDBearish > cTDBullish - // - ; - - // - bool isPTDBullish = - // - pTDBullish > pTDBearish - // - ; - - // - bool isPTDBearish = - // - pTDBearish > pTDBullish - // - ; - - // - bool isTDBullish = isCTDBullish; - bool isTDBearish = isCTDBearish; - bool isTDSwitchedToBullish = - // - isCTDBullish && - !isPTDBullish - // - ; - bool isTDSwitchedToBearish = - // - isCTDBearish && - !isPTDBearish - // - ; - - // - // XCHE ... - - // - double cCHELongExit1 = che.GetLongExit1(cIndex); - double cCHELongExit2 = che.GetLongExit2(cIndex); - - // - double pCHELongExit1 = che.GetLongExit1(pIndex); - double pCHELongExit2 = che.GetLongExit2(pIndex); - - // - double cCHEShortExit1 = che.GetShortExit1(cIndex); - double cCHEShortExit2 = che.GetShortExit2(cIndex); - - // - double pCHEShortExit1 = che.GetShortExit1(pIndex); - double pCHEShortExit2 = che.GetShortExit2(pIndex); - - // - bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1); - bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2); - - // - bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1); - bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2); - - // - bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1); - bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2); - - // - bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1); - bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2); - - // - bool isCCHEBullish = - // - CCHEHasLongExit1 && - CCHEHasLongExit2 - // - ; - - // - bool isCCHEBearish = - // - CCHEHasShortExit1 && - CCHEHasShortExit2 - // - ; - - // - bool isPCHEBullish = - // - PCHEHasLongExit1 && - PCHEHasLongExit2 - // - ; - - // - bool isPCHEBearish = - // - PCHEHasShortExit1 && - PCHEHasShortExit2 - // - ; - - // - bool isCHEBullish = isCCHEBullish; - bool isCHEBearish = isCCHEBearish; - bool isCHESwitchedToBullish = - // - isCCHEBullish && - !isPCHEBullish - // - ; - bool isCHESwitchedToBearish = - // - isCCHEBearish && - !isPCHEBearish - // - ; - - // - double cDONUpperOpen = don.GetUpperO(cIndex); - double cDONUpperClose = don.GetUpperC(cIndex); - double cDONUpperHigh = don.GetUpperH(cIndex); - double cDONUpperLow = don.GetUpperL(cIndex); - - // - double cDONLowerOpen = don.GetLowerO(cIndex); - double cDONLowerClose = don.GetLowerC(cIndex); - double cDONLowerHigh = don.GetLowerH(cIndex); - double cDONLowerLow = don.GetLowerL(cIndex); - - // - double pDONUpperOpen = don.GetUpperO(pIndex); - double pDONUpperClose = don.GetUpperC(pIndex); - double pDONUpperHigh = don.GetUpperH(pIndex); - double pDONUpperLow = don.GetUpperL(pIndex); - - // - double pDONLowerOpen = don.GetLowerO(pIndex); - double pDONLowerClose = don.GetLowerC(pIndex); - double pDONLowerHigh = don.GetLowerH(pIndex); - double pDONLowerLow = don.GetLowerL(pIndex); - - // - bool isBarCrossedDownDONLowerHigh = - // - cBar.IsBreakDown(pDONLowerHigh) - // - ; - - // - bool isBarCrossedUpDONLowerHigh = - // - cBar.IsBreakUp(pDONLowerHigh) - // - ; - - // - result = - // - (isSMHKSwitchedToBullish && - (isTDBullish && - isCHEBullish && - isTrendBullish)) - // - || - // - (isTDSwitchedToBullish && - (isSMHKBullish && - isCHEBullish && - isTrendBullish)) - // - || - // - (isCHESwitchedToBullish && - (isTDBullish && - isSMHKBullish && - isTrendBullish)) - // - || - // - (isTrendSwitchedToBullish && - (isTDBullish && - isCHEBullish && - isSMHKBullish)) - // - ; + bool result; // return result; @@ -5322,399 +3580,6 @@ public: // bool result = false; - // - int zIndex = 0; - int cIndex = zIndex + 1; - int pIndex = cIndex + 1; - - // - XOHCL cBar = GetBar(cIndex); - XOHCL pBar = GetBar(pIndex); - - // - // XPV ... - - double cPVPeak = pv.GetPeak(cIndex); - double cPVVale = pv.GetVale(cIndex); - - // - double pPVPeak = pv.GetPeak(pIndex); - double pPVVale = pv.GetVale(pIndex); - - // - double cPVSup = pv.GetSupport(cIndex); - double pPVSup = pv.GetSupport(pIndex); - - // - double cPVRes = pv.GetResistance(cIndex); - double pPVRes = pv.GetResistance(pIndex); - - // - double cPVFib1 = pv.GetFib1(cIndex); - double cPVFib2 = pv.GetFib2(cIndex); - double cPVFib3 = pv.GetFib3(cIndex); - double cPVFib4 = pv.GetFib4(cIndex); - double cPVFib5 = pv.GetFib5(cIndex); - - // - double pPVFib1 = pv.GetFib1(pIndex); - double pPVFib2 = pv.GetFib2(pIndex); - double pPVFib3 = pv.GetFib3(pIndex); - double pPVFib4 = pv.GetFib4(pIndex); - double pPVFib5 = pv.GetFib5(pIndex); - - // - bool isNewPeak = cPVPeak != pPVPeak; - bool isNewPeakUnderLast = - // - isNewPeak && - cPVPeak < pPVPeak - // - ; - bool isNewPeakOverLast = - // - isNewPeak && - cPVPeak > pPVPeak - // - ; - - // - bool isNewVale = cPVVale != pPVVale; - bool isNewValeUnderLast = - // - isNewVale && - cPVVale < pPVVale - // - ; - bool isNewValeOverLast = - // - isNewVale && - cPVVale > pPVVale - // - ; - - // - bool isFiboIncreased = - // - cPVFib1 > pPVFib1 && - cPVFib2 > pPVFib2 && - cPVFib3 > pPVFib3 && - cPVFib4 > pPVFib4 && - cPVFib5 > pPVFib5 - // - ; - - // - bool isFiboDecreased = - // - cPVFib1 < pPVFib1 && - cPVFib2 < pPVFib2 && - cPVFib3 < pPVFib3 && - cPVFib4 < pPVFib4 && - cPVFib5 < pPVFib5 - // - ; - - // - bool isFiboSectionChanged = - // - (isFiboDecreased && - isNewPeakUnderLast) - // - || - // - (isFiboIncreased && - isNewValeOverLast) - // - ; - - // - // XHK ... - - // - XOHCL cSMHKBar; - hk.SMAsOHCL( - cSMHKBar, - cIndex // - ); - - // - XOHCL pSMHKBar; - hk.SMAsOHCL( - pSMHKBar, - pIndex // - ); - - // - bool isCSMHKBullish = cSMHKBar.IsBullish(); - bool isCSMHKBearish = cSMHKBar.IsBearish(); - - // - bool isPSMHKBullish = pSMHKBar.IsBullish(); - bool isPSMHKBearish = pSMHKBar.IsBearish(); - - // - bool isSMHKBullish = isCSMHKBullish; - bool isSMHKBearish = isCSMHKBearish; - bool isSMHKSwitchedToBullish = - // - isCSMHKBullish && - isPSMHKBearish - // - ; - - // - bool isSMHKSwitchedToBearish = - // - isCSMHKBearish && - isPSMHKBullish - // - ; - - // - // XSTR ... - - // - ENUM_XSTR_TREND_STATES cStrState = str - .GetState(cIndex); - double cStrTrend = str.GetTrend(cIndex); - bool isCStrBullish = cStrState == X_STR_BULLISH; - bool isCStrBearish = cStrState == X_STR_BEARISH; - - // - ENUM_XSTR_TREND_STATES pStrState = str - .GetState(pIndex); - double pStrTrend = str.GetTrend(pIndex); - bool isPStrBullish = pStrState == X_STR_BULLISH; - bool isPStrBearish = pStrState == X_STR_BEARISH; - - // - bool isTrendBullish = isCStrBullish; - bool isTrendBearish = isCStrBearish; - - // - bool isTrendSwitchedToBullish = - // - isCStrBullish && - !isPStrBullish - // - ; - - // - bool isTrendSwitchedToBearish = - // - isCStrBearish && - !isPStrBearish - // - ; - - // - // XTD ... - - // - double cTDBullish = td.GetBullish(cIndex); - double pTDBullish = td.GetBullish(pIndex); - - // - double cTDBearish = td.GetBearish(cIndex); - double pTDBearish = td.GetBearish(pIndex); - - // - bool isCTDBullish = - // - cTDBullish > cTDBearish - // - ; - - // - bool isCTDBearish = - // - cTDBearish > cTDBullish - // - ; - - // - bool isPTDBullish = - // - pTDBullish > pTDBearish - // - ; - - // - bool isPTDBearish = - // - pTDBearish > pTDBullish - // - ; - - // - bool isTDBullish = isCTDBullish; - bool isTDBearish = isCTDBearish; - bool isTDSwitchedToBullish = - // - isCTDBullish && - !isPTDBullish - // - ; - bool isTDSwitchedToBearish = - // - isCTDBearish && - !isPTDBearish - // - ; - - // - // XCHE ... - - // - double cCHELongExit1 = che.GetLongExit1(cIndex); - double cCHELongExit2 = che.GetLongExit2(cIndex); - - // - double pCHELongExit1 = che.GetLongExit1(pIndex); - double pCHELongExit2 = che.GetLongExit2(pIndex); - - // - double cCHEShortExit1 = che.GetShortExit1(cIndex); - double cCHEShortExit2 = che.GetShortExit2(cIndex); - - // - double pCHEShortExit1 = che.GetShortExit1(pIndex); - double pCHEShortExit2 = che.GetShortExit2(pIndex); - - // - bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1); - bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2); - - // - bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1); - bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2); - - // - bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1); - bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2); - - // - bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1); - bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2); - - // - bool isCCHEBullish = - // - CCHEHasLongExit1 && - CCHEHasLongExit2 - // - ; - - // - bool isCCHEBearish = - // - CCHEHasShortExit1 && - CCHEHasShortExit2 - // - ; - - // - bool isPCHEBullish = - // - PCHEHasLongExit1 && - PCHEHasLongExit2 - // - ; - - // - bool isPCHEBearish = - // - PCHEHasShortExit1 && - PCHEHasShortExit2 - // - ; - - // - bool isCHEBullish = isCCHEBullish; - bool isCHEBearish = isCCHEBearish; - bool isCHESwitchedToBullish = - // - isCCHEBullish && - !isPCHEBullish - // - ; - bool isCHESwitchedToBearish = - // - isCCHEBearish && - !isPCHEBearish - // - ; - - // - double cDONUpperOpen = don.GetUpperO(cIndex); - double cDONUpperClose = don.GetUpperC(cIndex); - double cDONUpperHigh = don.GetUpperH(cIndex); - double cDONUpperLow = don.GetUpperL(cIndex); - - // - double cDONLowerOpen = don.GetLowerO(cIndex); - double cDONLowerClose = don.GetLowerC(cIndex); - double cDONLowerHigh = don.GetLowerH(cIndex); - double cDONLowerLow = don.GetLowerL(cIndex); - - // - double pDONUpperOpen = don.GetUpperO(pIndex); - double pDONUpperClose = don.GetUpperC(pIndex); - double pDONUpperHigh = don.GetUpperH(pIndex); - double pDONUpperLow = don.GetUpperL(pIndex); - - // - double pDONLowerOpen = don.GetLowerO(pIndex); - double pDONLowerClose = don.GetLowerC(pIndex); - double pDONLowerHigh = don.GetLowerH(pIndex); - double pDONLowerLow = don.GetLowerL(pIndex); - - // - bool isBarCrossedDownDONLowerHigh = - // - cBar.IsBreakDown(pDONLowerHigh) - // - ; - - // - bool isBarCrossedUpDONLowerHigh = - // - cBar.IsBreakUp(pDONLowerHigh) - // - ; - - // - result = - // - (isSMHKSwitchedToBearish && - (isTDBearish && - isCHEBearish && - isTrendBearish)) - // - || - // - (isTDSwitchedToBearish && - (isSMHKBearish && - isCHEBearish && - isTrendBearish)) - // - || - // - (isCHESwitchedToBearish && - (isTDBearish && - isSMHKBearish && - isTrendBearish)) - // - || - // - (isTrendSwitchedToBearish && - (isTDBearish && - isCHEBearish && - isSMHKBearish)) - // - ; - // return result; } @@ -5726,360 +3591,6 @@ public: // bool result = false; - // - int zIndex = 0; - int cIndex = zIndex + 1; - int pIndex = cIndex + 1; - - // - XOHCL cBar = GetBar(cIndex); - XOHCL pBar = GetBar(pIndex); - - // - // XSTR ... - - // - ENUM_XSTR_TREND_STATES cStrState = str - .GetState(cIndex); - double cStrTrend = str.GetTrend(cIndex); - bool isCStrBullish = cStrState == X_STR_BULLISH; - bool isCStrBearish = cStrState == X_STR_BEARISH; - - // - ENUM_XSTR_TREND_STATES pStrState = str - .GetState(pIndex); - double pStrTrend = str.GetTrend(pIndex); - bool isPStrBullish = pStrState == X_STR_BULLISH; - bool isPStrBearish = pStrState == X_STR_BEARISH; - - // - bool isTrendBullish = isCStrBullish; - bool isTrendBearish = isCStrBearish; - - // - bool isTrendSwitchedToBullish = - // - isCStrBullish && - !isPStrBullish - // - ; - - // - bool isTrendSwitchedToBearish = - // - isCStrBearish && - !isPStrBearish - // - ; - - // - // XCHE ... - - // - double cCHELongExit1 = che.GetLongExit1(cIndex); - double cCHELongExit2 = che.GetLongExit2(cIndex); - - // - double pCHELongExit1 = che.GetLongExit1(pIndex); - double pCHELongExit2 = che.GetLongExit2(pIndex); - - // - double cCHEShortExit1 = che.GetShortExit1(cIndex); - double cCHEShortExit2 = che.GetShortExit2(cIndex); - - // - double pCHEShortExit1 = che.GetShortExit1(pIndex); - double pCHEShortExit2 = che.GetShortExit2(pIndex); - - // - bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1); - bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2); - - // - bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1); - bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2); - - // - bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1); - bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2); - - // - bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1); - bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2); - - // - bool isCCHEBullish = - // - CCHEHasLongExit1 && - CCHEHasLongExit2 - // - ; - - // - bool isCCHEBearish = - // - CCHEHasShortExit1 && - CCHEHasShortExit2 - // - ; - - // - bool isPCHEBullish = - // - PCHEHasLongExit1 && - PCHEHasLongExit2 - // - ; - - // - bool isPCHEBearish = - // - PCHEHasShortExit1 && - PCHEHasShortExit2 - // - ; - - // - bool isCHEBullish = isCCHEBullish; - bool isCHEBearish = isCCHEBearish; - bool isCHESwitchedToBullish = - // - isCCHEBullish && - !isPCHEBullish - // - ; - bool isCHESwitchedToBearish = - // - isCCHEBearish && - !isPCHEBearish - // - ; - - // - // XMC ... - - // - double cMCFast = mc.GetFast(cIndex); - double pMCFast = mc.GetFast(pIndex); - - // - double cMCSlow = mc.GetSlow(cIndex); - double pMCSlow = mc.GetSlow(pIndex); - - // - double cMCVerifier = mc.GetVerifier(cIndex); - double pMCVerifier = mc.GetVerifier(pIndex); - - // - bool isCMCFastOverSlow = cMCFast > cMCSlow; - bool isPMCFastOverSlow = pMCFast > pMCSlow; - - // - bool isCMCFastUnderSlow = cMCFast < cMCSlow; - bool isPMCFastUnderSlow = pMCFast < pMCSlow; - - // - bool isCMCFastOverVerifier = cMCFast > cMCVerifier; - bool isPMCFastOverVerifier = pMCFast > pMCVerifier; - - // - bool isCMCFastUnderVerifier = cMCFast < cMCVerifier; - bool isPMCFastUnderVerifier = pMCFast < pMCVerifier; - - // - bool isCMCSlowOverVerifier = cMCSlow > cMCVerifier; - bool isPMCSlowOverVerifier = pMCSlow > pMCVerifier; - - // - bool isCMCSlowUnderVerifier = cMCSlow < cMCVerifier; - bool isPMCSlowUnderVerifier = pMCSlow < pMCVerifier; - - // - bool isMCFastOverSlow = isCMCFastOverSlow; - bool isMCFastUnderSlow = isCMCFastUnderSlow; - bool isMCFastOverVerifier = isCMCFastOverVerifier; - bool isMCFastUnderVerifier = isCMCFastUnderVerifier; - bool isMCSlowOverVerifier = isCMCSlowOverVerifier; - bool isMCSlowUnderVerifier = isCMCSlowUnderVerifier; - - // - bool isMCFastCrossedOverSlow = - // - isCMCFastOverSlow && - !isPMCFastOverSlow - // - ; - bool isMCFastCrossedUnderSlow = - // - isCMCFastUnderSlow && - !isPMCFastUnderSlow - // - ; - - // - bool isMCFastCrossedOverVerifier = - // - isCMCFastOverVerifier && - !isPMCFastOverVerifier - // - ; - bool isMCFastCrossedUnderVerifier = - // - isCMCFastUnderVerifier && - !isPMCFastUnderVerifier - // - ; - - // - bool isMCSlowCrossedOverVerifier = - // - isCMCSlowOverVerifier && - !isPMCSlowOverVerifier - // - ; - bool isMCSlowCrossedUnderVerifier = - // - isCMCSlowUnderVerifier && - !isPMCSlowUnderVerifier - // - ; - - // - // XMRB ... - - // - double cMRBFast = mrb.GetFast(cIndex); - double pMRBFast = mrb.GetFast(pIndex); - - // - double cMRBSlow = mrb.GetSlow(cIndex); - double pMRBSlow = mrb.GetSlow(pIndex); - - // - bool isCMRBFastOverSlow = cMRBFast > cMRBSlow; - bool isPMRBFastOverSlow = pMRBFast > pMRBSlow; - - // - bool isCMRBFastUnderSlow = cMRBFast < cMRBSlow; - bool isPMRBFastUnderSlow = pMRBFast < pMRBSlow; - - // - bool isMRBFastOverSlow = isCMRBFastOverSlow; - bool isMRBFastUnderSlow = isCMRBFastUnderSlow; - - // - bool isMRBFastCrossedOverSlow = - // - isCMRBFastOverSlow && - !isPMRBFastOverSlow - // - ; - bool isMRBFastCrossedUnderSlow = - // - isCMRBFastUnderSlow && - !isPMRBFastUnderSlow - // - ; - - // - // Combine MRB and MC ... - - // - bool isCMRBFastOverVerifier = cMRBFast > cMCVerifier; - bool isPMRBFastOverVerifier = pMRBFast > pMCVerifier; - - // - bool isCMRBFastUnderVerifier = cMRBFast < cMCVerifier; - bool isPMRBFastUnderVerifier = pMRBFast < pMCVerifier; - - // - bool isCMRBSlowOverVerifier = cMRBSlow > cMCVerifier; - bool isPMRBSlowOverVerifier = pMRBSlow > pMCVerifier; - - // - bool isCMRBSlowUnderVerifier = cMRBSlow < cMCVerifier; - bool isPMRBSlowUnderVerifier = pMRBSlow < pMCVerifier; - - // - bool isMRBFastOverVerifier = isCMRBFastOverVerifier; - bool isMRBFastUnderVerifier = isCMRBFastUnderVerifier; - - // - bool isMRBFastCrossedtOverVerifier = - // - isCMRBFastOverVerifier && - !isPMRBFastOverVerifier - // - ; - - // - bool isMRBFastCrossedUnderVerifier = - // - isCMRBFastUnderVerifier && - !isPMRBFastUnderVerifier - // - ; - - // - bool isMRBSlowOverVerifier = isCMRBSlowOverVerifier; - bool isMRBSlowUnderVerifier = isCMRBSlowUnderVerifier; - - // - bool isMRBSlowCrossedtOverVerifier = - // - isCMRBSlowOverVerifier && - !isPMRBSlowOverVerifier - // - ; - - // - bool isMRBSlowCrossedUnderVerifier = - // - isCMRBSlowUnderVerifier && - !isPMRBSlowUnderVerifier - // - ; - - // - result = - // - (isMRBFastCrossedOverSlow && - (isCHEBullish && - isTrendBullish && - isMCFastOverSlow)) - // - || - // - (isMRBSlowCrossedtOverVerifier && - (isCHEBullish && - isTrendBullish && - isMCFastOverSlow && - isMRBFastOverSlow)) - // - || - // - (isCHESwitchedToBullish && - (isTrendBullish && - isMCFastOverSlow && - isMRBFastOverSlow)) - // - || - // - (isTrendSwitchedToBullish && - (isCHEBullish && - isMCFastOverSlow && - isMRBFastOverSlow)) - // - || - // - (isMCFastCrossedOverSlow && - (isCHEBullish && - isTrendBullish && - isMRBFastOverSlow && - isMCSlowOverVerifier)) - // - ; - // return result; } @@ -6091,360 +3602,6 @@ public: // bool result = false; - // - int zIndex = 0; - int cIndex = zIndex + 1; - int pIndex = cIndex + 1; - - // - XOHCL cBar = GetBar(cIndex); - XOHCL pBar = GetBar(pIndex); - - // - // XSTR ... - - // - ENUM_XSTR_TREND_STATES cStrState = str - .GetState(cIndex); - double cStrTrend = str.GetTrend(cIndex); - bool isCStrBullish = cStrState == X_STR_BULLISH; - bool isCStrBearish = cStrState == X_STR_BEARISH; - - // - ENUM_XSTR_TREND_STATES pStrState = str - .GetState(pIndex); - double pStrTrend = str.GetTrend(pIndex); - bool isPStrBullish = pStrState == X_STR_BULLISH; - bool isPStrBearish = pStrState == X_STR_BEARISH; - - // - bool isTrendBullish = isCStrBullish; - bool isTrendBearish = isCStrBearish; - - // - bool isTrendSwitchedToBullish = - // - isCStrBullish && - !isPStrBullish - // - ; - - // - bool isTrendSwitchedToBearish = - // - isCStrBearish && - !isPStrBearish - // - ; - - // - // XCHE ... - - // - double cCHELongExit1 = che.GetLongExit1(cIndex); - double cCHELongExit2 = che.GetLongExit2(cIndex); - - // - double pCHELongExit1 = che.GetLongExit1(pIndex); - double pCHELongExit2 = che.GetLongExit2(pIndex); - - // - double cCHEShortExit1 = che.GetShortExit1(cIndex); - double cCHEShortExit2 = che.GetShortExit2(cIndex); - - // - double pCHEShortExit1 = che.GetShortExit1(pIndex); - double pCHEShortExit2 = che.GetShortExit2(pIndex); - - // - bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1); - bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2); - - // - bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1); - bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2); - - // - bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1); - bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2); - - // - bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1); - bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2); - - // - bool isCCHEBullish = - // - CCHEHasLongExit1 && - CCHEHasLongExit2 - // - ; - - // - bool isCCHEBearish = - // - CCHEHasShortExit1 && - CCHEHasShortExit2 - // - ; - - // - bool isPCHEBullish = - // - PCHEHasLongExit1 && - PCHEHasLongExit2 - // - ; - - // - bool isPCHEBearish = - // - PCHEHasShortExit1 && - PCHEHasShortExit2 - // - ; - - // - bool isCHEBullish = isCCHEBullish; - bool isCHEBearish = isCCHEBearish; - bool isCHESwitchedToBullish = - // - isCCHEBullish && - !isPCHEBullish - // - ; - bool isCHESwitchedToBearish = - // - isCCHEBearish && - !isPCHEBearish - // - ; - - // - // XMC ... - - // - double cMCFast = mc.GetFast(cIndex); - double pMCFast = mc.GetFast(pIndex); - - // - double cMCSlow = mc.GetSlow(cIndex); - double pMCSlow = mc.GetSlow(pIndex); - - // - double cMCVerifier = mc.GetVerifier(cIndex); - double pMCVerifier = mc.GetVerifier(pIndex); - - // - bool isCMCFastOverSlow = cMCFast > cMCSlow; - bool isPMCFastOverSlow = pMCFast > pMCSlow; - - // - bool isCMCFastUnderSlow = cMCFast < cMCSlow; - bool isPMCFastUnderSlow = pMCFast < pMCSlow; - - // - bool isCMCFastOverVerifier = cMCFast > cMCVerifier; - bool isPMCFastOverVerifier = pMCFast > pMCVerifier; - - // - bool isCMCFastUnderVerifier = cMCFast < cMCVerifier; - bool isPMCFastUnderVerifier = pMCFast < pMCVerifier; - - // - bool isCMCSlowOverVerifier = cMCSlow > cMCVerifier; - bool isPMCSlowOverVerifier = pMCSlow > pMCVerifier; - - // - bool isCMCSlowUnderVerifier = cMCSlow < cMCVerifier; - bool isPMCSlowUnderVerifier = pMCSlow < pMCVerifier; - - // - bool isMCFastOverSlow = isCMCFastOverSlow; - bool isMCFastUnderSlow = isCMCFastUnderSlow; - bool isMCFastOverVerifier = isCMCFastOverVerifier; - bool isMCFastUnderVerifier = isCMCFastUnderVerifier; - bool isMCSlowOverVerifier = isCMCSlowOverVerifier; - bool isMCSlowUnderVerifier = isCMCSlowUnderVerifier; - - // - bool isMCFastCrossedOverSlow = - // - isCMCFastOverSlow && - !isPMCFastOverSlow - // - ; - bool isMCFastCrossedUnderSlow = - // - isCMCFastUnderSlow && - !isPMCFastUnderSlow - // - ; - - // - bool isMCFastCrossedOverVerifier = - // - isCMCFastOverVerifier && - !isPMCFastOverVerifier - // - ; - bool isMCFastCrossedUnderVerifier = - // - isCMCFastUnderVerifier && - !isPMCFastUnderVerifier - // - ; - - // - bool isMCSlowCrossedOverVerifier = - // - isCMCSlowOverVerifier && - !isPMCSlowOverVerifier - // - ; - bool isMCSlowCrossedUnderVerifier = - // - isCMCSlowUnderVerifier && - !isPMCSlowUnderVerifier - // - ; - - // - // XMRB ... - - // - double cMRBFast = mrb.GetFast(cIndex); - double pMRBFast = mrb.GetFast(pIndex); - - // - double cMRBSlow = mrb.GetSlow(cIndex); - double pMRBSlow = mrb.GetSlow(pIndex); - - // - bool isCMRBFastOverSlow = cMRBFast > cMRBSlow; - bool isPMRBFastOverSlow = pMRBFast > pMRBSlow; - - // - bool isCMRBFastUnderSlow = cMRBFast < cMRBSlow; - bool isPMRBFastUnderSlow = pMRBFast < pMRBSlow; - - // - bool isMRBFastOverSlow = isCMRBFastOverSlow; - bool isMRBFastUnderSlow = isCMRBFastUnderSlow; - - // - bool isMRBFastCrossedOverSlow = - // - isCMRBFastOverSlow && - !isPMRBFastOverSlow - // - ; - bool isMRBFastCrossedUnderSlow = - // - isCMRBFastUnderSlow && - !isPMRBFastUnderSlow - // - ; - - // - // Combine MRB and MC ... - - // - bool isCMRBFastOverVerifier = cMRBFast > cMCVerifier; - bool isPMRBFastOverVerifier = pMRBFast > pMCVerifier; - - // - bool isCMRBFastUnderVerifier = cMRBFast < cMCVerifier; - bool isPMRBFastUnderVerifier = pMRBFast < pMCVerifier; - - // - bool isCMRBSlowOverVerifier = cMRBSlow > cMCVerifier; - bool isPMRBSlowOverVerifier = pMRBSlow > pMCVerifier; - - // - bool isCMRBSlowUnderVerifier = cMRBSlow < cMCVerifier; - bool isPMRBSlowUnderVerifier = pMRBSlow < pMCVerifier; - - // - bool isMRBFastOverVerifier = isCMRBFastOverVerifier; - bool isMRBFastUnderVerifier = isCMRBFastUnderVerifier; - - // - bool isMRBFastCrossedtOverVerifier = - // - isCMRBFastOverVerifier && - !isPMRBFastOverVerifier - // - ; - - // - bool isMRBFastCrossedUnderVerifier = - // - isCMRBFastUnderVerifier && - !isPMRBFastUnderVerifier - // - ; - - // - bool isMRBSlowOverVerifier = isCMRBSlowOverVerifier; - bool isMRBSlowUnderVerifier = isCMRBSlowUnderVerifier; - - // - bool isMRBSlowCrossedtOverVerifier = - // - isCMRBSlowOverVerifier && - !isPMRBSlowOverVerifier - // - ; - - // - bool isMRBSlowCrossedUnderVerifier = - // - isCMRBSlowUnderVerifier && - !isPMRBSlowUnderVerifier - // - ; - - // - result = - // - (isMRBFastCrossedUnderSlow && - (isCHEBearish && - isTrendBearish && - isMCFastUnderSlow)) - // - || - // - (isMRBSlowCrossedUnderVerifier && - (isCHEBearish && - isTrendBearish && - isMCFastUnderSlow && - isMRBFastUnderSlow)) - // - || - // - (isCHESwitchedToBearish && - (isTrendBearish && - isMCFastUnderSlow && - isMRBFastUnderSlow)) - // - || - // - (isTrendSwitchedToBearish && - (isCHEBearish && - isMCFastUnderSlow && - isMRBFastUnderSlow)) - // - || - // - (isMCFastCrossedUnderSlow && - (isCHEBearish && - isTrendBearish && - isMRBFastUnderSlow && - isMCSlowUnderVerifier)) - // - ; - // return result; }