From 4fcc0bc70bd6b9a1726fa04872a84e0fce570dc4 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Tue, 6 Aug 2024 00:06:06 +0330 Subject: [PATCH] complete XCHICH Helper and Integrated it to XCH Strategy ... --- Documents/Temp/longs.conditions.mq5 | 1164 ------ Helpers/x-saherelm.xchich.helper.mq5 | 4917 +++++++++++++++++++++++- Indicators/x-saherelm.xchich.mq5 | 124 +- Indicators/x-saherelm.xchvlm.mq5 | 1 - Libraries/x-saherelm.common.lib.mq5 | 68 + Parsers/x-saherelm.xch.parser.mq5 | 60 +- Strategies/x-saherelm.xch.strategy.mq5 | 72 +- 7 files changed, 4998 insertions(+), 1408 deletions(-) diff --git a/Documents/Temp/longs.conditions.mq5 b/Documents/Temp/longs.conditions.mq5 index 4237f84c..e69de29b 100644 --- a/Documents/Temp/longs.conditions.mq5 +++ b/Documents/Temp/longs.conditions.mq5 @@ -1,1164 +0,0 @@ -( -// --------------- -// Scores: -// --------------- -// Bullish: 54.0 -// Bearish: 12.0 -// --------------- -// Time: 2017.02.24 15:55:00 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCBearish && -conditions.pvConditions.isSCHHBearish && -conditions.pvConditions.isSCLLBearish && -conditions.pvConditions.isSCSwitchedToBearish && -conditions.pvConditions.isSCLLSwitchedToBeraish && -conditions.pvConditions.isLCLLBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isBullishPowerDecreasing && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedUnderCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isBullishPowerDecreasing && -conditions.chhkConditions.isCBearish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isCSwitchedToBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isBullishPowerUp && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isCSwitchedToBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBearish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBearish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.isMBearish && -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 67.0 -// Bearish: 1.0 -// --------------- -// Time: 2019.05.27 02:05:09 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCBullish && -conditions.pvConditions.isSCHHBullish && -conditions.pvConditions.isSCLLBullish && -conditions.pvConditions.isSCSwitchedToBullish && -conditions.pvConditions.isSCHHSwitchedToBullish && -conditions.pvConditions.isSCLLSwitchedToBullish && -conditions.pvConditions.isMCBullish && -conditions.pvConditions.isMCHHBullish && -conditions.pvConditions.isMCLLBullish && -conditions.pvConditions.isMCSwitchedToBullish && -conditions.pvConditions.isMCHHSwitchedToBullish && -conditions.pvConditions.isLCLLBullish && -conditions.pvConditions.isLCSwitchedToBullish && -conditions.pvConditions.isLCLLSwitchedToBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish -// -// XCHVWAP ... -// -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 55.0 -// Bearish: 10.0 -// --------------- -// Time: 2019.07.11 07:20:07 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCBearish && -conditions.pvConditions.isSCHHBearish && -conditions.pvConditions.isSCLLBearish && -conditions.pvConditions.isMCHHBearish && -conditions.pvConditions.isMCSwitchedToBearish && -conditions.pvConditions.isMCHHSwitchedToBearish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedUnderCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.hasBullishPower && -conditions.chvwapConditions.isSBearish && -conditions.chvwapConditions.isSSwitchedToBearish && -conditions.chvwapConditions.isLBullish && -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 58.0 -// Bearish: 4.0 -// --------------- -// Time: 2019.07.19 01:00:00 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCHHBullish && -conditions.pvConditions.isSCHHSwitchedToBullish && -conditions.pvConditions.isSCLLBearish && -conditions.pvConditions.isSCLLSwitchedToBeraish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isBullishPowerIncreasing && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isBullishPowerDecreasing && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isCSwitchedToBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 61.0 -// Bearish: 1.0 -// --------------- -// Time: 2019.12.31 15:40:00 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCHHBullish && -conditions.pvConditions.isSCSwitchedToBullish && -conditions.pvConditions.isSCHHSwitchedToBullish && -conditions.pvConditions.isMCLLBullish && -conditions.pvConditions.isLCLLBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.hasBullishPower && -conditions.chvwapConditions.isLBullish && -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 57.0 -// Bearish: 4.0 -// --------------- -// Time: 2021.02.19 13:10:04 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCLLBearish && -conditions.pvConditions.isSCSwitchedToBearish && -conditions.pvConditions.isSCLLSwitchedToBeraish && -conditions.pvConditions.isHCLLBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isBullishPowerIncreasing && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBearish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.hasBullishPower && -conditions.chvwapConditions.isLBullish && -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 51.0 -// Bearish: 9.0 -// --------------- -// Time: 2021.07.15 01:10:00 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCHHBearish && -conditions.pvConditions.isSCSwitchedToBearish && -conditions.pvConditions.isSCHHSwitchedToBearish && -conditions.pvConditions.isHCLLBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isBearishPowerDecreasing && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastUnderSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastUnderSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBearish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBearish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBearish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 62.0 -// Bearish: 1.0 -// --------------- -// Time: 2021.12.23 07:10:04 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCHHBullish && -conditions.pvConditions.isSCSwitchedToBullish && -conditions.pvConditions.isSCHHSwitchedToBullish && -conditions.pvConditions.isMCHHBullish && -conditions.pvConditions.isMCSwitchedToBullish && -conditions.pvConditions.isMCHHSwitchedToBullish && -conditions.pvConditions.isHCLLBullish && -conditions.pvConditions.isHCSwitchedToBullish && -conditions.pvConditions.isHCLLSwitchedToBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish -// -// XCHVWAP ... -// -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 60.0 -// Bearish: 3.0 -// --------------- -// Time: 2022.08.04 22:30:00 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCLLBullish && -conditions.pvConditions.isMCLLBullish && -conditions.pvConditions.isLCLLBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isBullishPowerIncreasing && -conditions.chmConditions.isBearishPowerDecreasing && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastUnderSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.hasBullishPower && -conditions.chvwapConditions.isSBearish && -conditions.chvwapConditions.isSSwitchedToBearish && -conditions.chvwapConditions.isLBullish && -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 55.0 -// Bearish: 3.0 -// --------------- -// Time: 2023.11.06 08:05:00 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCHHBullish && -conditions.pvConditions.isSCHHSwitchedToBullish && -conditions.pvConditions.isSCLLBearish && -conditions.pvConditions.isSCLLSwitchedToBeraish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isCSwitchedToBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isHBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isMSwitchedToBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.isHBullish -// -) -// -|| -// -( -// --------------- -// Scores: -// --------------- -// Bullish: 62.0 -// Bearish: 3.0 -// --------------- -// Time: 2024.02.12 02:20:06 -// --------------- -// -// XPV ... -// -conditions.pvConditions.isCloseOverFib1 && -conditions.pvConditions.isCloseOverFib2 && -conditions.pvConditions.isCloseOverFib3 && -conditions.pvConditions.isCloseOverFib4 && -conditions.pvConditions.isCloseOverFib5 && -conditions.pvConditions.isSCLLBearish && -conditions.pvConditions.isMCLLBullish && -conditions.pvConditions.isLCLLBullish && -// -// XCHM ... -// -conditions.chmConditions.hasBullishPower && -conditions.chmConditions.isBullishPowerIncreasing && -conditions.chmConditions.isFastOverSlow && -conditions.chmConditions.isClosedOverFast && -conditions.chmConditions.isCFastOverSlow && -conditions.chmConditions.isClosedOverCFast && -conditions.chmConditions.isSFastOverSlow && -conditions.chmConditions.isClosedOverSFast && -conditions.chmConditions.isMFastOverSlow && -conditions.chmConditions.isClosedOverMFast && -conditions.chmConditions.isLFastOverSlow && -conditions.chmConditions.isClosedOverLFast && -conditions.chmConditions.isHFastOverSlow && -conditions.chmConditions.isClosedOverHFast && -// -// XCHHK ... -// -conditions.chhkConditions.hasBullishPower && -conditions.chhkConditions.isBullishPowerDecreasing && -conditions.chhkConditions.isCBullish && -conditions.chhkConditions.isCloseOverCHigh && -conditions.chhkConditions.isSBullish && -conditions.chhkConditions.isCloseOverSHigh && -conditions.chhkConditions.isMBullish && -conditions.chhkConditions.isCloseOverMHigh && -conditions.chhkConditions.isLBullish && -conditions.chhkConditions.isCloseOverLHigh && -conditions.chhkConditions.isHBullish && -conditions.chhkConditions.isCloseOverHHigh && -// -// XCHTD ... -// -conditions.chtdConditions.hasBullishPower && -conditions.chtdConditions.isCBullish && -conditions.chtdConditions.isSBullish && -conditions.chtdConditions.isMBullish && -conditions.chtdConditions.isLBullish && -conditions.chtdConditions.isHBullish && -// -// XCHCHE ... -// -conditions.chcheConditions.hasBullishPower && -conditions.chcheConditions.isBullishPowerDecreasing && -conditions.chcheConditions.isCBullish && -conditions.chcheConditions.isCStrongBullish && -conditions.chcheConditions.isSBullish && -conditions.chcheConditions.isSStrongBullish && -conditions.chcheConditions.isMBullish && -conditions.chcheConditions.isMStrongBullish && -conditions.chcheConditions.isLBullish && -conditions.chcheConditions.isLStrongBullish && -conditions.chcheConditions.isHBullish && -conditions.chcheConditions.isHStrongBullish && -// -// XCHSTR ... -// -conditions.chstrConditions.hasBullishPower && -conditions.chstrConditions.isBullishPowerIncreasing && -conditions.chstrConditions.isCBullish && -conditions.chstrConditions.isSBullish && -conditions.chstrConditions.isMBullish && -conditions.chstrConditions.isLBullish && -conditions.chstrConditions.isHBullish && -// -// XCHVLM ... -// -conditions.chvlmConditions.hasBullishPower && -conditions.chvlmConditions.isCBullish && -conditions.chvlmConditions.isSBullish && -conditions.chvlmConditions.isMBullish && -conditions.chvlmConditions.isLBullish && -conditions.chvlmConditions.isHBullish && -// -// XCHVWAP ... -// -conditions.chvwapConditions.hasBullishPower && -conditions.chvwapConditions.isBullishPowerIncreasing && -conditions.chvwapConditions.isMBullish && -conditions.chvwapConditions.isLBullish && -conditions.chvwapConditions.isHBullish -// -) - diff --git a/Helpers/x-saherelm.xchich.helper.mq5 b/Helpers/x-saherelm.xchich.helper.mq5 index fc3574ba..e12bb338 100644 --- a/Helpers/x-saherelm.xchich.helper.mq5 +++ b/Helpers/x-saherelm.xchich.helper.mq5 @@ -141,63 +141,21 @@ struct XCHICHInputs // Presentation ... // - // All Cycles ... + // Ichimoku ... bool showTenkanSen; // Show Tenkan Sen bool showKijunSen; // Show Kijun Sen bool showChikouSpan; // Show Chikou Span bool showSenkouSpanA; // Show Senkou Span A bool showSenkouSpanB; // Show Senkou Span B bool showKumo; // Show Kumo + bool shiftKumo; // Shift Kumo to Future // - // Current ... - bool showCTenkanSen; // Show Tenkan Sen - bool showCKijunSen; // Show Kijun Sen - bool showCChikouSpan; // Show Chikou Span - bool showCSenkouSpanA; // Show Senkou Span A - bool showCSenkouSpanB; // Show Senkou Span B - bool showCKumo; // Show Kumo - bool shiftCKumo; // Shift Kumo to Future - - // - // Short ... - bool showSTenkanSen; // Show Tenkan Sen - bool showSKijunSen; // Show Kijun Sen - bool showSChikouSpan; // Show Chikou Span - bool showSSenkouSpanA; // Show Senkou Span A - bool showSSenkouSpanB; // Show Senkou Span B - bool showSKumo; // Show Kumo - bool shiftSKumo; // Shift Kumo to Future - - // - // Medium ... - bool showMTenkanSen; // Show Tenkan Sen - bool showMKijunSen; // Show Kijun Sen - bool showMChikouSpan; // Show Chikou Span - bool showMSenkouSpanA; // Show Senkou Span A - bool showMSenkouSpanB; // Show Senkou Span B - bool showMKumo; // Show Kumo - bool shiftMKumo; // Shift Kumo to Future - - // - // Long ... - bool showLTenkanSen; // Show Tenkan Sen - bool showLKijunSen; // Show Kijun Sen - bool showLChikouSpan; // Show Chikou Span - bool showLSenkouSpanA; // Show Senkou Span A - bool showLSenkouSpanB; // Show Senkou Span B - bool showLKumo; // Show Kumo - bool shiftLKumo; // Shift Kumo to Future - - // - // Hind ... - bool showHTenkanSen; // Show Tenkan Sen - bool showHKijunSen; // Show Kijun Sen - bool showHChikouSpan; // Show Chikou Span - bool showHSenkouSpanA; // Show Senkou Span A - bool showHSenkouSpanB; // Show Senkou Span B - bool showHKumo; // Show Kumo - bool shiftHKumo; // Shift Kumo to Future + bool showCurrent; // Show Current Cycle + bool showShort; // Show Short Cycle + bool showMedium; // Show Medium Cycle + bool showLong; // Show Long Cycle + bool showHind; // Show Hind Cycle // // Constructor(s) ... @@ -240,51 +198,14 @@ struct XCHICHInputs showSenkouSpanA = false; showSenkouSpanB = false; showKumo = false; + shiftKumo = true; // - showCTenkanSen = false; - showCKijunSen = false; - showCChikouSpan = false; - showCSenkouSpanA = false; - showCSenkouSpanB = false; - showCKumo = false; - shiftCKumo = true; - - // - showSTenkanSen = false; - showSKijunSen = false; - showSChikouSpan = false; - showSSenkouSpanA = false; - showSSenkouSpanB = false; - showSKumo = false; - shiftSKumo = true; - - // - showMTenkanSen = false; - showMKijunSen = false; - showMChikouSpan = false; - showMSenkouSpanA = false; - showMSenkouSpanB = false; - showMKumo = false; - shiftMKumo = true; - - // - showLTenkanSen = false; - showLKijunSen = false; - showLChikouSpan = false; - showLSenkouSpanA = false; - showLSenkouSpanB = false; - showLKumo = false; - shiftLKumo = true; - - // - showHTenkanSen = false; - showHKijunSen = false; - showHChikouSpan = false; - showHSenkouSpanA = false; - showHSenkouSpanB = false; - showHKumo = false; - shiftHKumo = true; + showCurrent = false; + showShort = false; + showMedium = false; + showLong = false; + showHind = false; } // @@ -317,51 +238,14 @@ struct XCHICHInputs showSenkouSpanA = true; showSenkouSpanB = true; showKumo = true; + shiftKumo = true; // - showCTenkanSen = true; - showCKijunSen = true; - showCChikouSpan = true; - showCSenkouSpanA = true; - showCSenkouSpanB = true; - showCKumo = true; - shiftCKumo = true; - - // - showSTenkanSen = true; - showSKijunSen = true; - showSChikouSpan = true; - showSSenkouSpanA = true; - showSSenkouSpanB = true; - showSKumo = true; - shiftSKumo = true; - - // - showMTenkanSen = true; - showMKijunSen = true; - showMChikouSpan = true; - showMSenkouSpanA = true; - showMSenkouSpanB = true; - showMKumo = true; - shiftMKumo = true; - - // - showLTenkanSen = true; - showLKijunSen = true; - showLChikouSpan = true; - showLSenkouSpanA = true; - showLSenkouSpanB = true; - showLKumo = true; - shiftLKumo = true; - - // - showHTenkanSen = true; - showHKijunSen = true; - showHChikouSpan = true; - showHSenkouSpanA = true; - showHSenkouSpanB = true; - showHKumo = true; - shiftHKumo = true; + showCurrent = true; + showShort = true; + showMedium = true; + showLong = true; + showHind = true; } // @@ -427,6 +311,8 @@ struct XCHICHConditions double cChik[]; double cSSA[]; double cSSB[]; + double cFSSA[]; + double cFSSB[]; // // Short ... @@ -435,6 +321,8 @@ struct XCHICHConditions double sChik[]; double sSSA[]; double sSSB[]; + double sFSSA[]; + double sFSSB[]; // // Medium ... @@ -443,6 +331,8 @@ struct XCHICHConditions double mChik[]; double mSSA[]; double mSSB[]; + double mFSSA[]; + double mFSSB[]; // // Long ... @@ -451,6 +341,8 @@ struct XCHICHConditions double lChik[]; double lSSA[]; double lSSB[]; + double lFSSA[]; + double lFSSB[]; // // Hind ... @@ -459,6 +351,166 @@ struct XCHICHConditions double hChik[]; double hSSA[]; double hSSB[]; + double hFSSA[]; + double hFSSB[]; + + // + // Conditions ... + + // + // Current ... + + // + bool isCClosedOverKijunSen; + bool isCClosedUnderKijunSen; + bool isCTenkanSenOverKijunSen; + bool isCTenkanSenUnderKijunSen; + bool isCTenkanSenCrossedOverKijunSen; + bool isCTenkanSenCrossedUnderKijunSen; + + // + bool isCSenkouSpanAOverB; + bool isCSenkouSpanAUnderB; + bool isCSenkouSpanAOverLast; + bool isCSenkouSpanAUnderLast; + bool isCFutureSenkouSpanAOverB; + bool isCFutureSenkouSpanAUnderB; + bool isCFutureSenkouSpanAOverLast; + bool isCFutureSenkouSpanAUnderLast; + + // + bool isCSenkouSpanACrossedOverB; + bool isCSenkouSpanACrossedUnderB; + bool isCSenkouSpanACrossedOverLast; + bool isCSenkouSpanACrossedUnderLast; + bool isCFutureSenkouSpanACrossedOverB; + bool isCFutureSenkouSpanACrossedUnderB; + bool isCFutureSenkouSpanACrossedOverLast; + bool isCFutureSenkouSpanACrossedUnderLast; + + // + // Short ... + + // + bool isSClosedOverKijunSen; + bool isSClosedUnderKijunSen; + bool isSTenkanSenOverKijunSen; + bool isSTenkanSenUnderKijunSen; + bool isSTenkanSenCrossedOverKijunSen; + bool isSTenkanSenCrossedUnderKijunSen; + + // + bool isSSenkouSpanAOverB; + bool isSSenkouSpanAUnderB; + bool isSSenkouSpanAOverLast; + bool isSSenkouSpanAUnderLast; + bool isSFutureSenkouSpanAOverB; + bool isSFutureSenkouSpanAUnderB; + bool isSFutureSenkouSpanAOverLast; + bool isSFutureSenkouSpanAUnderLast; + + // + bool isSSenkouSpanACrossedOverB; + bool isSSenkouSpanACrossedUnderB; + bool isSSenkouSpanACrossedOverLast; + bool isSSenkouSpanACrossedUnderLast; + bool isSFutureSenkouSpanACrossedOverB; + bool isSFutureSenkouSpanACrossedUnderB; + bool isSFutureSenkouSpanACrossedOverLast; + bool isSFutureSenkouSpanACrossedUnderLast; + + // + // Medium ... + + // + bool isMClosedOverKijunSen; + bool isMClosedUnderKijunSen; + bool isMTenkanSenOverKijunSen; + bool isMTenkanSenUnderKijunSen; + bool isMTenkanSenCrossedOverKijunSen; + bool isMTenkanSenCrossedUnderKijunSen; + + // + bool isMSenkouSpanAOverB; + bool isMSenkouSpanAUnderB; + bool isMSenkouSpanAOverLast; + bool isMSenkouSpanAUnderLast; + bool isMFutureSenkouSpanAOverB; + bool isMFutureSenkouSpanAUnderB; + bool isMFutureSenkouSpanAOverLast; + bool isMFutureSenkouSpanAUnderLast; + + // + bool isMSenkouSpanACrossedOverB; + bool isMSenkouSpanACrossedUnderB; + bool isMSenkouSpanACrossedOverLast; + bool isMSenkouSpanACrossedUnderLast; + bool isMFutureSenkouSpanACrossedOverB; + bool isMFutureSenkouSpanACrossedUnderB; + bool isMFutureSenkouSpanACrossedOverLast; + bool isMFutureSenkouSpanACrossedUnderLast; + + // + // Long ... + + // + bool isLClosedOverKijunSen; + bool isLClosedUnderKijunSen; + bool isLTenkanSenOverKijunSen; + bool isLTenkanSenUnderKijunSen; + bool isLTenkanSenCrossedOverKijunSen; + bool isLTenkanSenCrossedUnderKijunSen; + + // + bool isLSenkouSpanAOverB; + bool isLSenkouSpanAUnderB; + bool isLSenkouSpanAOverLast; + bool isLSenkouSpanAUnderLast; + bool isLFutureSenkouSpanAOverB; + bool isLFutureSenkouSpanAUnderB; + bool isLFutureSenkouSpanAOverLast; + bool isLFutureSenkouSpanAUnderLast; + + // + bool isLSenkouSpanACrossedOverB; + bool isLSenkouSpanACrossedUnderB; + bool isLSenkouSpanACrossedOverLast; + bool isLSenkouSpanACrossedUnderLast; + bool isLFutureSenkouSpanACrossedOverB; + bool isLFutureSenkouSpanACrossedUnderB; + bool isLFutureSenkouSpanACrossedOverLast; + bool isLFutureSenkouSpanACrossedUnderLast; + + // + // Hind ... + + // + bool isHClosedOverKijunSen; + bool isHClosedUnderKijunSen; + bool isHTenkanSenOverKijunSen; + bool isHTenkanSenUnderKijunSen; + bool isHTenkanSenCrossedOverKijunSen; + bool isHTenkanSenCrossedUnderKijunSen; + + // + bool isHSenkouSpanAOverB; + bool isHSenkouSpanAUnderB; + bool isHSenkouSpanAOverLast; + bool isHSenkouSpanAUnderLast; + bool isHFutureSenkouSpanAOverB; + bool isHFutureSenkouSpanAUnderB; + bool isHFutureSenkouSpanAOverLast; + bool isHFutureSenkouSpanAUnderLast; + + // + bool isHSenkouSpanACrossedOverB; + bool isHSenkouSpanACrossedUnderB; + bool isHSenkouSpanACrossedOverLast; + bool isHSenkouSpanACrossedUnderLast; + bool isHFutureSenkouSpanACrossedOverB; + bool isHFutureSenkouSpanACrossedUnderB; + bool isHFutureSenkouSpanACrossedOverLast; + bool isHFutureSenkouSpanACrossedUnderLast; // void Clean() @@ -470,26 +522,36 @@ struct XCHICHConditions Clean(cChik); Clean(cSSA); Clean(cSSB); + Clean(cFSSA); + Clean(cFSSB); Clean(sTK); Clean(sKJ); Clean(sChik); Clean(sSSA); Clean(sSSB); + Clean(sFSSA); + Clean(sFSSB); Clean(mTK); Clean(mKJ); Clean(mChik); Clean(mSSA); Clean(mSSB); + Clean(mFSSA); + Clean(mFSSB); Clean(lTK); Clean(lKJ); Clean(lChik); Clean(lSSA); Clean(lSSB); + Clean(lFSSA); + Clean(lFSSB); Clean(hTK); Clean(hKJ); Clean(hChik); Clean(hSSA); Clean(hSSB); + Clean(hFSSA); + Clean(hFSSB); // ArraySetAsSeries(cTK, true); @@ -497,26 +559,171 @@ struct XCHICHConditions ArraySetAsSeries(cChik, true); ArraySetAsSeries(cSSA, true); ArraySetAsSeries(cSSB, true); + ArraySetAsSeries(cFSSA, true); + ArraySetAsSeries(cFSSB, true); ArraySetAsSeries(sTK, true); ArraySetAsSeries(sKJ, true); ArraySetAsSeries(sChik, true); ArraySetAsSeries(sSSA, true); ArraySetAsSeries(sSSB, true); + ArraySetAsSeries(sFSSA, true); + ArraySetAsSeries(sFSSB, true); ArraySetAsSeries(mTK, true); ArraySetAsSeries(mKJ, true); ArraySetAsSeries(mChik, true); ArraySetAsSeries(mSSA, true); ArraySetAsSeries(mSSB, true); + ArraySetAsSeries(mFSSA, true); + ArraySetAsSeries(mFSSB, true); ArraySetAsSeries(lTK, true); ArraySetAsSeries(lKJ, true); ArraySetAsSeries(lChik, true); ArraySetAsSeries(lSSA, true); ArraySetAsSeries(lSSB, true); + ArraySetAsSeries(lFSSA, true); + ArraySetAsSeries(lFSSB, true); ArraySetAsSeries(hTK, true); ArraySetAsSeries(hKJ, true); ArraySetAsSeries(hChik, true); ArraySetAsSeries(hSSA, true); ArraySetAsSeries(hSSB, true); + ArraySetAsSeries(hFSSA, true); + ArraySetAsSeries(hFSSB, true); + + // + // Current ... + + // + isCClosedOverKijunSen = false; + isCClosedUnderKijunSen = false; + isCTenkanSenOverKijunSen = false; + isCTenkanSenUnderKijunSen = false; + isCTenkanSenCrossedOverKijunSen = false; + isCTenkanSenCrossedUnderKijunSen = false; + isCSenkouSpanAOverB = false; + isCSenkouSpanAUnderB = false; + isCSenkouSpanAOverLast = false; + isCSenkouSpanAUnderLast = false; + isCFutureSenkouSpanAOverB = false; + isCFutureSenkouSpanAUnderB = false; + isCFutureSenkouSpanAOverLast = false; + isCFutureSenkouSpanAUnderLast = false; + isCSenkouSpanACrossedOverB = false; + isCSenkouSpanACrossedUnderB = false; + isCSenkouSpanACrossedOverLast = false; + isCSenkouSpanACrossedUnderLast = false; + isCFutureSenkouSpanACrossedOverB = false; + isCFutureSenkouSpanACrossedUnderB = false; + isCFutureSenkouSpanACrossedOverLast = false; + isCFutureSenkouSpanACrossedUnderLast = false; + + // + // Short ... + + // + isSClosedOverKijunSen = false; + isSClosedUnderKijunSen = false; + isSTenkanSenOverKijunSen = false; + isSTenkanSenUnderKijunSen = false; + isSTenkanSenCrossedOverKijunSen = false; + isSTenkanSenCrossedUnderKijunSen = false; + isSSenkouSpanAOverB = false; + isSSenkouSpanAUnderB = false; + isSSenkouSpanAOverLast = false; + isSSenkouSpanAUnderLast = false; + isSFutureSenkouSpanAOverB = false; + isSFutureSenkouSpanAUnderB = false; + isSFutureSenkouSpanAOverLast = false; + isSFutureSenkouSpanAUnderLast = false; + isSSenkouSpanACrossedOverB = false; + isSSenkouSpanACrossedUnderB = false; + isSSenkouSpanACrossedOverLast = false; + isSSenkouSpanACrossedUnderLast = false; + isSFutureSenkouSpanACrossedOverB = false; + isSFutureSenkouSpanACrossedUnderB = false; + isSFutureSenkouSpanACrossedOverLast = false; + isSFutureSenkouSpanACrossedUnderLast = false; + + // + // Medium ... + + // + isMClosedOverKijunSen = false; + isMClosedUnderKijunSen = false; + isMTenkanSenOverKijunSen = false; + isMTenkanSenUnderKijunSen = false; + isMTenkanSenCrossedOverKijunSen = false; + isMTenkanSenCrossedUnderKijunSen = false; + isMSenkouSpanAOverB = false; + isMSenkouSpanAUnderB = false; + isMSenkouSpanAOverLast = false; + isMSenkouSpanAUnderLast = false; + isMFutureSenkouSpanAOverB = false; + isMFutureSenkouSpanAUnderB = false; + isMFutureSenkouSpanAOverLast = false; + isMFutureSenkouSpanAUnderLast = false; + isMSenkouSpanACrossedOverB = false; + isMSenkouSpanACrossedUnderB = false; + isMSenkouSpanACrossedOverLast = false; + isMSenkouSpanACrossedUnderLast = false; + isMFutureSenkouSpanACrossedOverB = false; + isMFutureSenkouSpanACrossedUnderB = false; + isMFutureSenkouSpanACrossedOverLast = false; + isMFutureSenkouSpanACrossedUnderLast = false; + + // + // Long ... + + // + isLClosedOverKijunSen = false; + isLClosedUnderKijunSen = false; + isLTenkanSenOverKijunSen = false; + isLTenkanSenUnderKijunSen = false; + isLTenkanSenCrossedOverKijunSen = false; + isLTenkanSenCrossedUnderKijunSen = false; + isLSenkouSpanAOverB = false; + isLSenkouSpanAUnderB = false; + isLSenkouSpanAOverLast = false; + isLSenkouSpanAUnderLast = false; + isLFutureSenkouSpanAOverB = false; + isLFutureSenkouSpanAUnderB = false; + isLFutureSenkouSpanAOverLast = false; + isLFutureSenkouSpanAUnderLast = false; + isLSenkouSpanACrossedOverB = false; + isLSenkouSpanACrossedUnderB = false; + isLSenkouSpanACrossedOverLast = false; + isLSenkouSpanACrossedUnderLast = false; + isLFutureSenkouSpanACrossedOverB = false; + isLFutureSenkouSpanACrossedUnderB = false; + isLFutureSenkouSpanACrossedOverLast = false; + isLFutureSenkouSpanACrossedUnderLast = false; + + // + // Hind ... + + // + isHClosedOverKijunSen = false; + isHClosedUnderKijunSen = false; + isHTenkanSenOverKijunSen = false; + isHTenkanSenUnderKijunSen = false; + isHTenkanSenCrossedOverKijunSen = false; + isHTenkanSenCrossedUnderKijunSen = false; + isHSenkouSpanAOverB = false; + isHSenkouSpanAUnderB = false; + isHSenkouSpanAOverLast = false; + isHSenkouSpanAUnderLast = false; + isHFutureSenkouSpanAOverB = false; + isHFutureSenkouSpanAUnderB = false; + isHFutureSenkouSpanAOverLast = false; + isHFutureSenkouSpanAUnderLast = false; + isHSenkouSpanACrossedOverB = false; + isHSenkouSpanACrossedUnderB = false; + isHSenkouSpanACrossedOverLast = false; + isHSenkouSpanACrossedUnderLast = false; + isHFutureSenkouSpanACrossedOverB = false; + isHFutureSenkouSpanACrossedUnderB = false; + isHFutureSenkouSpanACrossedOverLast = false; + isHFutureSenkouSpanACrossedUnderLast = false; } // @@ -528,6 +735,481 @@ struct XCHICHConditions // bullishScore = 0; bearishScore = 0; + + // + // Current ... + + // + if (isCClosedOverKijunSen) + { + bullishScore++; + } + if (isCTenkanSenOverKijunSen) + { + bullishScore++; + } + if (isCTenkanSenCrossedOverKijunSen) + { + bullishScore++; + } + if (isCSenkouSpanAOverB) + { + bullishScore++; + } + if (isCSenkouSpanAOverLast) + { + bullishScore++; + } + if (isCFutureSenkouSpanAOverB) + { + bullishScore++; + } + if (isCFutureSenkouSpanAOverLast) + { + bullishScore++; + } + if (isCSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isCSenkouSpanACrossedOverLast) + { + bullishScore++; + } + if (isCFutureSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isCFutureSenkouSpanACrossedOverLast) + { + bullishScore++; + } + + // + if (isCClosedUnderKijunSen) + { + bearishScore++; + } + if (isCTenkanSenUnderKijunSen) + { + bearishScore++; + } + if (isCTenkanSenCrossedUnderKijunSen) + { + bearishScore++; + } + if (isCSenkouSpanAUnderB) + { + bearishScore++; + } + if (isCSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isCFutureSenkouSpanAUnderB) + { + bearishScore++; + } + if (isCFutureSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isCSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isCSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + if (isCFutureSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isCFutureSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + + // + // Short ... + + // + if (isSClosedOverKijunSen) + { + bullishScore++; + } + if (isSTenkanSenOverKijunSen) + { + bullishScore++; + } + if (isSTenkanSenCrossedOverKijunSen) + { + bullishScore++; + } + if (isSSenkouSpanAOverB) + { + bullishScore++; + } + if (isSSenkouSpanAOverLast) + { + bullishScore++; + } + if (isSFutureSenkouSpanAOverB) + { + bullishScore++; + } + if (isSFutureSenkouSpanAOverLast) + { + bullishScore++; + } + if (isSSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isSSenkouSpanACrossedOverLast) + { + bullishScore++; + } + if (isSFutureSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isSFutureSenkouSpanACrossedOverLast) + { + bullishScore++; + } + + // + if (isSClosedUnderKijunSen) + { + bearishScore++; + } + if (isSTenkanSenUnderKijunSen) + { + bearishScore++; + } + if (isSTenkanSenCrossedUnderKijunSen) + { + bearishScore++; + } + if (isSSenkouSpanAUnderB) + { + bearishScore++; + } + if (isSSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isSFutureSenkouSpanAUnderB) + { + bearishScore++; + } + if (isSFutureSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isSSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isSSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + if (isSFutureSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isSFutureSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + + // + // Medium ... + + // + if (isMClosedOverKijunSen) + { + bullishScore++; + } + if (isMTenkanSenOverKijunSen) + { + bullishScore++; + } + if (isMTenkanSenCrossedOverKijunSen) + { + bullishScore++; + } + if (isMSenkouSpanAOverB) + { + bullishScore++; + } + if (isMSenkouSpanAOverLast) + { + bullishScore++; + } + if (isMFutureSenkouSpanAOverB) + { + bullishScore++; + } + if (isMFutureSenkouSpanAOverLast) + { + bullishScore++; + } + if (isMSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isMSenkouSpanACrossedOverLast) + { + bullishScore++; + } + if (isMFutureSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isMFutureSenkouSpanACrossedOverLast) + { + bullishScore++; + } + + // + if (isMClosedUnderKijunSen) + { + bearishScore++; + } + if (isMTenkanSenUnderKijunSen) + { + bearishScore++; + } + if (isMTenkanSenCrossedUnderKijunSen) + { + bearishScore++; + } + if (isMSenkouSpanAUnderB) + { + bearishScore++; + } + if (isMSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isMFutureSenkouSpanAUnderB) + { + bearishScore++; + } + if (isMFutureSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isMSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isMSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + if (isMFutureSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isMFutureSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + + // + // Long ... + + // + if (isLClosedOverKijunSen) + { + bullishScore++; + } + if (isLTenkanSenOverKijunSen) + { + bullishScore++; + } + if (isLTenkanSenCrossedOverKijunSen) + { + bullishScore++; + } + if (isLSenkouSpanAOverB) + { + bullishScore++; + } + if (isLSenkouSpanAOverLast) + { + bullishScore++; + } + if (isLFutureSenkouSpanAOverB) + { + bullishScore++; + } + if (isLFutureSenkouSpanAOverLast) + { + bullishScore++; + } + if (isLSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isLSenkouSpanACrossedOverLast) + { + bullishScore++; + } + if (isLFutureSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isLFutureSenkouSpanACrossedOverLast) + { + bullishScore++; + } + + // + if (isLClosedUnderKijunSen) + { + bearishScore++; + } + if (isLTenkanSenUnderKijunSen) + { + bearishScore++; + } + if (isLTenkanSenCrossedUnderKijunSen) + { + bearishScore++; + } + if (isLSenkouSpanAUnderB) + { + bearishScore++; + } + if (isLSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isLFutureSenkouSpanAUnderB) + { + bearishScore++; + } + if (isLFutureSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isLSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isLSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + if (isLFutureSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isLFutureSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + + // + // Hind ... + + // + if (isHClosedOverKijunSen) + { + bullishScore++; + } + if (isHTenkanSenOverKijunSen) + { + bullishScore++; + } + if (isHTenkanSenCrossedOverKijunSen) + { + bullishScore++; + } + if (isHSenkouSpanAOverB) + { + bullishScore++; + } + if (isHSenkouSpanAOverLast) + { + bullishScore++; + } + if (isHFutureSenkouSpanAOverB) + { + bullishScore++; + } + if (isHFutureSenkouSpanAOverLast) + { + bullishScore++; + } + if (isHSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isHSenkouSpanACrossedOverLast) + { + bullishScore++; + } + if (isHFutureSenkouSpanACrossedOverB) + { + bullishScore++; + } + if (isHFutureSenkouSpanACrossedOverLast) + { + bullishScore++; + } + + // + if (isHClosedUnderKijunSen) + { + bearishScore++; + } + if (isHTenkanSenUnderKijunSen) + { + bearishScore++; + } + if (isHTenkanSenCrossedUnderKijunSen) + { + bearishScore++; + } + if (isHSenkouSpanAUnderB) + { + bearishScore++; + } + if (isHSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isHFutureSenkouSpanAUnderB) + { + bearishScore++; + } + if (isHFutureSenkouSpanAUnderLast) + { + bearishScore++; + } + if (isHSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isHSenkouSpanACrossedUnderLast) + { + bearishScore++; + } + if (isHFutureSenkouSpanACrossedUnderB) + { + bearishScore++; + } + if (isHFutureSenkouSpanACrossedUnderLast) + { + bearishScore++; + } } // @@ -572,14 +1254,124 @@ struct XCHICHConditions string conditionsStr = // // Current ... + ToString("isCClosedOverKijunSen", isCClosedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isCClosedUnderKijunSen", isCClosedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isCTenkanSenOverKijunSen", isCTenkanSenOverKijunSen, ignoreFalseConditions, separator) + + ToString("isCTenkanSenUnderKijunSen", isCTenkanSenUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isCTenkanSenCrossedOverKijunSen", isCTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isCTenkanSenCrossedUnderKijunSen", isCTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanAOverB", isCSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanAUnderB", isCSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanAOverLast", isCSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanAUnderLast", isCSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanAOverB", isCFutureSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanAUnderB", isCFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanAOverLast", isCFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanAUnderLast", isCFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanACrossedOverB", isCSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanACrossedUnderB", isCSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanACrossedOverLast", isCSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isCSenkouSpanACrossedUnderLast", isCSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanACrossedOverB", isCFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanACrossedUnderB", isCFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanACrossedOverLast", isCFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isCFutureSenkouSpanACrossedUnderLast", isCFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + // // Short ... + ToString("isSClosedOverKijunSen", isSClosedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isSClosedUnderKijunSen", isSClosedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isSTenkanSenOverKijunSen", isSTenkanSenOverKijunSen, ignoreFalseConditions, separator) + + ToString("isSTenkanSenUnderKijunSen", isSTenkanSenUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isSTenkanSenCrossedOverKijunSen", isSTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isSTenkanSenCrossedUnderKijunSen", isSTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanAOverB", isSSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanAUnderB", isSSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanAOverLast", isSSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanAUnderLast", isSSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanAOverB", isSFutureSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanAUnderB", isSFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanAOverLast", isSFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanAUnderLast", isSFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanACrossedOverB", isSSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanACrossedUnderB", isSSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanACrossedOverLast", isSSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isSSenkouSpanACrossedUnderLast", isSSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanACrossedOverB", isSFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanACrossedUnderB", isSFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanACrossedOverLast", isSFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isSFutureSenkouSpanACrossedUnderLast", isSFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + // // Medium ... + ToString("isMClosedOverKijunSen", isMClosedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isMClosedUnderKijunSen", isMClosedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isMTenkanSenOverKijunSen", isMTenkanSenOverKijunSen, ignoreFalseConditions, separator) + + ToString("isMTenkanSenUnderKijunSen", isMTenkanSenUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isMTenkanSenCrossedOverKijunSen", isMTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isMTenkanSenCrossedUnderKijunSen", isMTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanAOverB", isMSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanAUnderB", isMSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanAOverLast", isMSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanAUnderLast", isMSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanAOverB", isMFutureSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanAUnderB", isMFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanAOverLast", isMFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanAUnderLast", isMFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanACrossedOverB", isMSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanACrossedUnderB", isMSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanACrossedOverLast", isMSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isMSenkouSpanACrossedUnderLast", isMSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanACrossedOverB", isMFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanACrossedUnderB", isMFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanACrossedOverLast", isMFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isMFutureSenkouSpanACrossedUnderLast", isMFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + // // Long ... + ToString("isLClosedOverKijunSen", isLClosedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isLClosedUnderKijunSen", isLClosedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isLTenkanSenOverKijunSen", isLTenkanSenOverKijunSen, ignoreFalseConditions, separator) + + ToString("isLTenkanSenUnderKijunSen", isLTenkanSenUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isLTenkanSenCrossedOverKijunSen", isLTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isLTenkanSenCrossedUnderKijunSen", isLTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanAOverB", isLSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanAUnderB", isLSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanAOverLast", isLSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanAUnderLast", isLSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanAOverB", isLFutureSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanAUnderB", isLFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanAOverLast", isLFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanAUnderLast", isLFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanACrossedOverB", isLSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanACrossedUnderB", isLSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanACrossedOverLast", isLSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isLSenkouSpanACrossedUnderLast", isLSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanACrossedOverB", isLFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanACrossedUnderB", isLFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanACrossedOverLast", isLFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isLFutureSenkouSpanACrossedUnderLast", isLFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + // // Hind ... + ToString("isHClosedOverKijunSen", isHClosedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isHClosedUnderKijunSen", isHClosedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isHTenkanSenOverKijunSen", isHTenkanSenOverKijunSen, ignoreFalseConditions, separator) + + ToString("isHTenkanSenUnderKijunSen", isHTenkanSenUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isHTenkanSenCrossedOverKijunSen", isHTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) + + ToString("isHTenkanSenCrossedUnderKijunSen", isHTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanAOverB", isHSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanAUnderB", isHSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanAOverLast", isHSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanAUnderLast", isHSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanAOverB", isHFutureSenkouSpanAOverB, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanAUnderB", isHFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanAOverLast", isHFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanAUnderLast", isHFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanACrossedOverB", isHSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanACrossedUnderB", isHSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanACrossedOverLast", isHSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isHSenkouSpanACrossedUnderLast", isHSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanACrossedOverB", isHFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanACrossedUnderB", isHFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanACrossedOverLast", isHFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) + + ToString("isHFutureSenkouSpanACrossedUnderLast", isHFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) + // "" // @@ -770,18 +1562,21 @@ public: // Presentation ... "", // - // All Cycles ... - "", + // Ichimoku ... mInputs.showTenkanSen, // Show Tenkan Sen mInputs.showKijunSen, // Show Kijun Sen mInputs.showChikouSpan, // Show Chikou Span mInputs.showSenkouSpanA, // Show Senkou Span A mInputs.showSenkouSpanB, // Show Senkou Span B mInputs.showKumo, // Show Kumo + mInputs.shiftKumo, // Shift Kumo to Future // - // Current ... - "", - + // Cycles ... + mInputs.showCurrent, // Show Current Cycle + mInputs.showShort, // Show Short Cycle + mInputs.showMedium, // Show Medium Cycle + mInputs.showLong, // Show Long Cycle + mInputs.showHind // Show Hind Cycle // ); result = mHandler != INVALID_HANDLE; @@ -794,6 +1589,3848 @@ public: return result; } + // + // Buffers ... + + // + // Current ... + + // + // TENKANSEN ... + + // + double GetCTenkanSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cTKBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCTenkanSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + cTKBuffer, + buffer, + forceClean + // + ); + } + + // + // KIJUNSEN ... + + // + double GetCKijunSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cKJBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCKijunSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + cKJBuffer, + buffer, + forceClean + // + ); + } + + // + // CHIKOUSPAN ... + + // + double GetCChikouSpan( + int barIndex // Bar Index + ) + { + // + barIndex -= mInputs.kijunSenLength; + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cChikBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCChikouSpan( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - mInputs.kijunSenLength, + count, + cChikBuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANA ... + + // + double GetCSenkouSpanA( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + cSSABuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANB ... + + // + double GetCSenkouSpanB( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + cSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANA ... + + // + double GetCFutureSenkouSpanA( + int barIndex // Bar Index + ) + { + // + barIndex -= mInputs.kijunSenLength; + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCFutureSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - mInputs.kijunSenLength, + count, + cSSABuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANB ... + + // + double GetCFutureSenkouSpanB( + int barIndex // Bar Index + ) + { + // + barIndex -= mInputs.kijunSenLength; + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return cSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyCFutureSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - mInputs.kijunSenLength, + count, + cSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // Short ... + + // + // TENKANSEN ... + + // + double GetSTenkanSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sTKBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySTenkanSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + sTKBuffer, + buffer, + forceClean + // + ); + } + + // + // KIJUNSEN ... + + // + double GetSKijunSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sKJBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySKijunSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + sKJBuffer, + buffer, + forceClean + // + ); + } + + // + // CHIKOUSPAN ... + + // + double GetSChikouSpan( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_SHORT, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sChikBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySChikouSpan( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_SHORT, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + sChikBuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANA ... + + // + double GetSSenkouSpanA( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + sSSABuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANB ... + + // + double GetSSenkouSpanB( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + sSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANA ... + + // + double GetSFutureSenkouSpanA( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_SHORT, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySFutureSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_SHORT, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + sSSABuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANB ... + + // + double GetSFutureSenkouSpanB( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_SHORT, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return sSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopySFutureSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_SHORT, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + sSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // Medium ... + + // + // TENKANSEN ... + + // + double GetMTenkanSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mTKBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMTenkanSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + mTKBuffer, + buffer, + forceClean + // + ); + } + + // + // KIJUNSEN ... + + // + double GetMKijunSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mKJBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMKijunSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + mKJBuffer, + buffer, + forceClean + // + ); + } + + // + // CHIKOUSPAN ... + + // + double GetMChikouSpan( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_MEDIUM, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mChikBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMChikouSpan( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_MEDIUM, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + mChikBuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANA ... + + // + double GetMSenkouSpanA( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + mSSABuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANB ... + + // + double GetMSenkouSpanB( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + mSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANA ... + + // + double GetMFutureSenkouSpanA( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_MEDIUM, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMFutureSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_MEDIUM, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + mSSABuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANB ... + + // + double GetMFutureSenkouSpanB( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_MEDIUM, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return mSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyMFutureSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_MEDIUM, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + mSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // Long ... + + // + // TENKANSEN ... + + // + double GetLTenkanSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lTKBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLTenkanSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + lTKBuffer, + buffer, + forceClean + // + ); + } + + // + // KIJUNSEN ... + + // + double GetLKijunSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lKJBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLKijunSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + lKJBuffer, + buffer, + forceClean + // + ); + } + + // + // CHIKOUSPAN ... + + // + double GetLChikouSpan( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_LONG, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lChikBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLChikouSpan( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_LONG, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + lChikBuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANA ... + + // + double GetLSenkouSpanA( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + lSSABuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANB ... + + // + double GetLSenkouSpanB( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + lSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANA ... + + // + double GetLFutureSenkouSpanA( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_LONG, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLFutureSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_LONG, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + lSSABuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANB ... + + // + double GetLFutureSenkouSpanB( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_LONG, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return lSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyLFutureSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_LONG, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + lSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // Hind ... + + // + // TENKANSEN ... + + // + double GetHTenkanSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hTKBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHTenkanSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + hTKBuffer, + buffer, + forceClean + // + ); + } + + // + // KIJUNSEN ... + + // + double GetHKijunSen( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hKJBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHKijunSen( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + hKJBuffer, + buffer, + forceClean + // + ); + } + + // + // CHIKOUSPAN ... + + // + double GetHChikouSpan( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_HIND, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hChikBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHChikouSpan( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_HIND, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + hChikBuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANA ... + + // + double GetHSenkouSpanA( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + hSSABuffer, + buffer, + forceClean + // + ); + } + + // + // SENKOUSPANB ... + + // + double GetHSenkouSpanB( + int barIndex // Bar Index + ) + { + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start, + count, + hSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANA ... + + // + double GetHFutureSenkouSpanA( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_HIND, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hSSABuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHFutureSenkouSpanA( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_HIND, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + hSSABuffer, + buffer, + forceClean + // + ); + } + + // + // FUTURESENKOUSPANB ... + + // + double GetHFutureSenkouSpanB( + int barIndex // Bar Index + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_HIND, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + barIndex -= (mInputs.kijunSenLength * cycleLength); + if (barIndex < 0) + { + barIndex = 0; + } + + // + Calculate(); + + // + return hSSBBuffer[barIndex]; + } + + // + // Copy Required Buffer ... + int CopyHFutureSenkouSpanB( + int start, // Start + int count, // Number of Items for read + double &buffer[], // Dest Buffer + bool forceClean = true // Force To Clean buffer + ) + { + // + int cycleLength = GetCycleLengthOn( + mPeriod, // Host + X_MARKET_CYCLE_HIND, // Cycle + mInputs.scMethod, // Method + mInputs.scPeriod // Period + ); + if (cycleLength <= 0) + { + cycleLength = 1; + } + + // + // Update Calculations ... + Calculate(); + + // + // Copy Items ... + return Copy( + start - (mInputs.kijunSenLength * cycleLength), + count, + hSSBBuffer, + buffer, + forceClean + // + ); + } + + // + // Tools ... + + // + void GetCycleValues( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES cycle, // Cycle + // + double &tenkanSen, + double &kijunSen, + double &chikouSpan, + double &senkouSpanA, + double &senkouSpanB, + double &futureSenkouSpanA, + double &futureSenkouSpanB // + ) + { + // + tenkanSen = 0; + kijunSen = 0; + chikouSpan = 0; + senkouSpanA = 0; + senkouSpanB = 0; + futureSenkouSpanA = 0; + futureSenkouSpanB = 0; + + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + switch (cycle) + { + // + // Current ... + case X_MARKET_CYCLE_UNKNOWN: + // + tenkanSen = GetCTenkanSen(barIndex); + kijunSen = GetCKijunSen(barIndex); + chikouSpan = GetCChikouSpan(barIndex); + senkouSpanA = GetCSenkouSpanA(barIndex); + senkouSpanB = GetCSenkouSpanB(barIndex); + futureSenkouSpanA = GetCFutureSenkouSpanA(barIndex); + futureSenkouSpanB = GetCFutureSenkouSpanB(barIndex); + break; + + // + // Short ... + case X_MARKET_CYCLE_SHORT: + // + tenkanSen = GetSTenkanSen(barIndex); + kijunSen = GetSKijunSen(barIndex); + chikouSpan = GetSChikouSpan(barIndex); + senkouSpanA = GetSSenkouSpanA(barIndex); + senkouSpanB = GetSSenkouSpanB(barIndex); + futureSenkouSpanA = GetSFutureSenkouSpanA(barIndex); + futureSenkouSpanB = GetSFutureSenkouSpanB(barIndex); + break; + + // + // Medium ... + case X_MARKET_CYCLE_MEDIUM: + // + tenkanSen = GetMTenkanSen(barIndex); + kijunSen = GetMKijunSen(barIndex); + chikouSpan = GetMChikouSpan(barIndex); + senkouSpanA = GetMSenkouSpanA(barIndex); + senkouSpanB = GetMSenkouSpanB(barIndex); + futureSenkouSpanA = GetMFutureSenkouSpanA(barIndex); + futureSenkouSpanB = GetMFutureSenkouSpanB(barIndex); + break; + + // + // Long ... + case X_MARKET_CYCLE_LONG: + // + tenkanSen = GetLTenkanSen(barIndex); + kijunSen = GetLKijunSen(barIndex); + chikouSpan = GetLChikouSpan(barIndex); + senkouSpanA = GetLSenkouSpanA(barIndex); + senkouSpanB = GetLSenkouSpanB(barIndex); + futureSenkouSpanA = GetLFutureSenkouSpanA(barIndex); + futureSenkouSpanB = GetLFutureSenkouSpanB(barIndex); + break; + + // + // Hind ... + case X_MARKET_CYCLE_HIND: + // + tenkanSen = GetHTenkanSen(barIndex); + kijunSen = GetHKijunSen(barIndex); + chikouSpan = GetHChikouSpan(barIndex); + senkouSpanA = GetHSenkouSpanA(barIndex); + senkouSpanB = GetHSenkouSpanB(barIndex); + futureSenkouSpanA = GetHFutureSenkouSpanA(barIndex); + futureSenkouSpanB = GetHFutureSenkouSpanB(barIndex); + break; + } + } + + // + int GetTenkanSenOverKijunSenCycles( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + int result = 0; + + // + Clean(cycles); + + // + ENUM_X_MARKET_CYCLES allCycles[]; + int allCyclesCount = GetAllMarketCycles(allCycles); + if (!IsValidSize(allCyclesCount)) + { + return result; + } + + // + for (int i = 0; i < allCyclesCount; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + allCycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + bool isPassed = + iTenkanSen > iKijunSen; + if (isPassed) + { + // + Add( + allCycles[i], + cycles // + ); + } + } + + // + result = ArraySize(cycles); + + // + return result; + } + + // + int GetTenkanSenUnderKijunSenCycles( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + int result = 0; + + // + Clean(cycles); + + // + ENUM_X_MARKET_CYCLES allCycles[]; + int allCyclesCount = GetAllMarketCycles(allCycles); + if (!IsValidSize(allCyclesCount)) + { + return result; + } + + // + for (int i = 0; i < allCyclesCount; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + allCycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + bool isPassed = + iTenkanSen < iKijunSen; + if (isPassed) + { + // + Add( + allCycles[i], + cycles // + ); + } + } + + // + result = ArraySize(cycles); + + // + return result; + } + + // + int GetSenkouSpanAOverBCycles( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + int result = 0; + + // + Clean(cycles); + + // + ENUM_X_MARKET_CYCLES allCycles[]; + int allCyclesCount = GetAllMarketCycles(allCycles); + if (!IsValidSize(allCyclesCount)) + { + return result; + } + + // + for (int i = 0; i < allCyclesCount; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + allCycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + bool isPassed = + iSenkouSpanA > iSenkouSpanB; + if (isPassed) + { + // + Add( + allCycles[i], + cycles // + ); + } + } + + // + result = ArraySize(cycles); + + // + return result; + } + + // + int GetSenkouSpanAUnderBCycles( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + int result = 0; + + // + Clean(cycles); + + // + ENUM_X_MARKET_CYCLES allCycles[]; + int allCyclesCount = GetAllMarketCycles(allCycles); + if (!IsValidSize(allCyclesCount)) + { + return result; + } + + // + for (int i = 0; i < allCyclesCount; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + allCycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + bool isPassed = + iSenkouSpanA < iSenkouSpanB; + if (isPassed) + { + // + Add( + allCycles[i], + cycles // + ); + } + } + + // + result = ArraySize(cycles); + + // + return result; + } + + // + int GetFutureSenkouSpanAOverBCycles( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + int result = 0; + + // + Clean(cycles); + + // + ENUM_X_MARKET_CYCLES allCycles[]; + int allCyclesCount = GetAllMarketCycles(allCycles); + if (!IsValidSize(allCyclesCount)) + { + return result; + } + + // + for (int i = 0; i < allCyclesCount; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + allCycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + bool isPassed = + iFutureSenkouSpanA > iFutureSenkouSpanB; + if (isPassed) + { + // + Add( + allCycles[i], + cycles // + ); + } + } + + // + result = ArraySize(cycles); + + // + return result; + } + + // + int GetFutureSenkouSpanAUnderBCycles( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + int result = 0; + + // + Clean(cycles); + + // + ENUM_X_MARKET_CYCLES allCycles[]; + int allCyclesCount = GetAllMarketCycles(allCycles); + if (!IsValidSize(allCyclesCount)) + { + return result; + } + + // + for (int i = 0; i < allCyclesCount; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + allCycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + bool isPassed = + iFutureSenkouSpanA < iFutureSenkouSpanB; + if (isPassed) + { + // + Add( + allCycles[i], + cycles // + ); + } + } + + // + result = ArraySize(cycles); + + // + return result; + } + + // + double GetCyclesTenkanSensMax( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iTenkanSen, + values // + ); + } + + // + result = GetSpecifiedMax(values); + + // + return result; + } + + // + double GetCyclesTenkanSensMin( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iTenkanSen, + values // + ); + } + + // + result = GetSpecifiedMin(values); + + // + return result; + } + + // + double GetCyclesKijunSensMax( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iKijunSen, + values // + ); + } + + // + result = GetSpecifiedMax(values); + + // + return result; + } + + // + double GetCyclesKijunSensMin( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iKijunSen, + values // + ); + } + + // + result = GetSpecifiedMin(values); + + // + return result; + } + + // + double GetCyclesSenkouSpanAMax( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iSenkouSpanA, + values // + ); + } + + // + result = GetSpecifiedMax(values); + + // + return result; + } + + // + double GetCyclesSenkouSpanAMin( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iSenkouSpanA, + values // + ); + } + + // + result = GetSpecifiedMin(values); + + // + return result; + } + + // + double GetCyclesSenkouSpanBMax( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iSenkouSpanB, + values // + ); + } + + // + result = GetSpecifiedMax(values); + + // + return result; + } + + // + double GetCyclesSenkouSpanBMin( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iSenkouSpanB, + values // + ); + } + + // + result = GetSpecifiedMin(values); + + // + return result; + } + + // + double GetCyclesFutureSenkouSpanAMax( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iFutureSenkouSpanA, + values // + ); + } + + // + result = GetSpecifiedMax(values); + + // + return result; + } + + // + double GetCyclesFutureSenkouSpanAMin( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iFutureSenkouSpanA, + values // + ); + } + + // + result = GetSpecifiedMin(values); + + // + return result; + } + + // + double GetCyclesFutureSenkouSpanBMax( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iFutureSenkouSpanB, + values // + ); + } + + // + result = GetSpecifiedMax(values); + + // + return result; + } + + // + double GetCyclesFutureSenkouSpanBMin( + int barIndex, // Bar Index + ENUM_X_MARKET_CYCLES &cycles[] // Result + ) + { + // + double result = 0; + + // + int count = ArraySize(cycles); + if (!IsValidSize(count)) + { + return result; + } + + // + double values[]; + + // + for (int i = 0; i < count; i++) + { + // + double iTenkanSen = 0; + double iKijunSen = 0; + double iChikouSpan = 0; + double iSenkouSpanA = 0; + double iSenkouSpanB = 0; + double iFutureSenkouSpanA = 0; + double iFutureSenkouSpanB = 0; + GetCycleValues( + barIndex, + cycles[i], + iTenkanSen, + iKijunSen, + iChikouSpan, + iSenkouSpanA, + iSenkouSpanB, + iFutureSenkouSpanA, + iFutureSenkouSpanB // + ); + + // + Add( + iFutureSenkouSpanB, + values // + ); + } + + // + result = GetSpecifiedMin(values); + + // + return result; + } + + // + // Conditions ... + + // + bool GetConditions( + XCHICHConditions &conditions, // + int barIndex = 0, // + int loopback = 5 // + ) + { + // + bool result = true; + + // + if (loopback < 5) + { + loopback = 5; + } + + // + conditions.Clean(); + + // + conditions.symbol = mSymbol; + conditions.period = mPeriod; + conditions.time = TimeCurrent(); + + // + int zIndex = barIndex; + int cIndex = zIndex + 1; + int pIndex = cIndex + 1; + int ppIndex = pIndex + 1; + + // + // Buffers ... + + // + // Current ... + CopyCTenkanSen( + zIndex, + loopback, + conditions.cTK // + ); + CopyCKijunSen( + zIndex, + loopback, + conditions.cKJ // + ); + CopyCChikouSpan( + zIndex, + loopback, + conditions.cChik // + ); + CopyCSenkouSpanA( + zIndex, + loopback, + conditions.cSSA // + ); + CopyCSenkouSpanB( + zIndex, + loopback, + conditions.cSSB // + ); + CopyCFutureSenkouSpanA( + zIndex, + loopback, + conditions.cFSSA // + ); + CopyCFutureSenkouSpanB( + zIndex, + loopback, + conditions.cFSSB // + ); + + // + // Short ... + CopySTenkanSen( + zIndex, + loopback, + conditions.sTK // + ); + CopySKijunSen( + zIndex, + loopback, + conditions.sKJ // + ); + CopySChikouSpan( + zIndex, + loopback, + conditions.sChik // + ); + CopySSenkouSpanA( + zIndex, + loopback, + conditions.sSSA // + ); + CopySSenkouSpanB( + zIndex, + loopback, + conditions.sSSB // + ); + CopySFutureSenkouSpanA( + zIndex, + loopback, + conditions.sFSSA // + ); + CopySFutureSenkouSpanB( + zIndex, + loopback, + conditions.sFSSB // + ); + + // + // Medium ... + CopyMTenkanSen( + zIndex, + loopback, + conditions.mTK // + ); + CopyMKijunSen( + zIndex, + loopback, + conditions.mKJ // + ); + CopyMChikouSpan( + zIndex, + loopback, + conditions.mChik // + ); + CopyMSenkouSpanA( + zIndex, + loopback, + conditions.mSSA // + ); + CopyMSenkouSpanB( + zIndex, + loopback, + conditions.mSSB // + ); + CopyMFutureSenkouSpanA( + zIndex, + loopback, + conditions.mFSSA // + ); + CopyMFutureSenkouSpanB( + zIndex, + loopback, + conditions.mFSSB // + ); + + // + // Long ... + CopyLTenkanSen( + zIndex, + loopback, + conditions.lTK // + ); + CopyLKijunSen( + zIndex, + loopback, + conditions.lKJ // + ); + CopyLChikouSpan( + zIndex, + loopback, + conditions.lChik // + ); + CopyLSenkouSpanA( + zIndex, + loopback, + conditions.lSSA // + ); + CopyLSenkouSpanB( + zIndex, + loopback, + conditions.lSSB // + ); + CopyLFutureSenkouSpanA( + zIndex, + loopback, + conditions.lFSSA // + ); + CopyLFutureSenkouSpanB( + zIndex, + loopback, + conditions.lFSSB // + ); + + // + // Hind ... + CopyHTenkanSen( + zIndex, + loopback, + conditions.hTK // + ); + CopyHKijunSen( + zIndex, + loopback, + conditions.hKJ // + ); + CopyHChikouSpan( + zIndex, + loopback, + conditions.hChik // + ); + CopyHSenkouSpanA( + zIndex, + loopback, + conditions.hSSA // + ); + CopyHSenkouSpanB( + zIndex, + loopback, + conditions.hSSB // + ); + CopyHFutureSenkouSpanA( + zIndex, + loopback, + conditions.hFSSA // + ); + CopyHFutureSenkouSpanB( + zIndex, + loopback, + conditions.hFSSB // + ); + + // + // Conditions ... + + // + XOHCL cBar; + result = cBar.Init( + mSymbol, + mPeriod, + cIndex // + ); + if (!result) + { + return result; + } + + // + XOHCL pBar; + result = pBar.Init( + mSymbol, + mPeriod, + pIndex // + ); + if (!result) + { + return result; + } + + // + // Conditions ... + + // + // Current ... + + // + bool isCClosedOverKijunSen = cBar.low > conditions.cTK[cIndex]; + bool isCClosedUnderKijunSen = cBar.high < conditions.cTK[cIndex]; + + // + bool isCTenkanSenOverKijunSen = conditions.cTK[cIndex] > conditions.cKJ[cIndex]; + bool isCTenkanSenOverKijunSenPrev = conditions.cTK[pIndex] > conditions.cKJ[pIndex]; + + // + bool isCTenkanSenUnderKijunSen = conditions.cTK[cIndex] < conditions.cKJ[cIndex]; + bool isCTenkanSenUnderKijunSenPrev = conditions.cTK[pIndex] < conditions.cKJ[pIndex]; + + // + bool isCTenkanSenCrossedOverKijunSen = isCTenkanSenOverKijunSen && + !isCTenkanSenOverKijunSenPrev; + bool isCTenkanSenCrossedUnderKijunSen = isCTenkanSenUnderKijunSen && + !isCTenkanSenUnderKijunSenPrev; + + // + bool isCSenkouSpanAOverB = conditions.cSSA[cIndex] > conditions.cSSB[cIndex]; + bool isCSenkouSpanAOverBPrev = conditions.cSSA[pIndex] > conditions.cSSB[pIndex]; + + // + bool isCSenkouSpanAUnderB = conditions.cSSA[cIndex] < conditions.cSSB[cIndex]; + bool isCSenkouSpanAUnderBPrev = conditions.cSSA[pIndex] < conditions.cSSB[pIndex]; + + // + bool isCSenkouSpanAOverLast = conditions.cSSA[cIndex] > conditions.cSSA[pIndex]; + bool isCSenkouSpanAOverLastPrev = conditions.cSSA[pIndex] > conditions.cSSA[ppIndex]; + + // + bool isCSenkouSpanAUnderLast = conditions.cSSA[cIndex] < conditions.cSSA[pIndex]; + bool isCSenkouSpanAUnderLastPrev = conditions.cSSA[pIndex] < conditions.cSSA[ppIndex]; + + // + bool isCFutureSenkouSpanAOverB = conditions.cFSSA[cIndex] > conditions.cFSSB[cIndex]; + bool isCFutureSenkouSpanAOverBPrev = conditions.cFSSA[pIndex] > conditions.cFSSB[pIndex]; + + // + bool isCFutureSenkouSpanAUnderB = conditions.cFSSA[cIndex] < conditions.cFSSB[cIndex]; + bool isCFutureSenkouSpanAUnderBPrev = conditions.cFSSA[pIndex] < conditions.cFSSB[pIndex]; + + // + bool isCFutureSenkouSpanAOverLast = conditions.cFSSA[cIndex] > conditions.cFSSA[pIndex]; + bool isCFutureSenkouSpanAOverLastPrev = conditions.cFSSA[pIndex] > conditions.cFSSA[ppIndex]; + + // + bool isCFutureSenkouSpanAUnderLast = conditions.cFSSA[cIndex] < conditions.cFSSA[pIndex]; + bool isCFutureSenkouSpanAUnderLastPrev = conditions.cFSSA[pIndex] < conditions.cFSSA[ppIndex]; + + // + bool isCSenkouSpanACrossedOverB = isCSenkouSpanAOverB && + !isCSenkouSpanAOverBPrev; + bool isCSenkouSpanACrossedUnderB = isCSenkouSpanAUnderB && + !isCSenkouSpanAUnderBPrev; + bool isCSenkouSpanACrossedOverLast = isCSenkouSpanAOverLast && + !isCSenkouSpanAOverLastPrev; + bool isCSenkouSpanACrossedUnderLast = isCSenkouSpanAUnderLast && + !isCSenkouSpanAUnderLastPrev; + bool isCFutureSenkouSpanACrossedOverB = isCFutureSenkouSpanAOverB && + !isCFutureSenkouSpanAOverBPrev; + bool isCFutureSenkouSpanACrossedUnderB = isCFutureSenkouSpanAUnderB && + !isCFutureSenkouSpanAUnderBPrev; + bool isCFutureSenkouSpanACrossedOverLast = isCFutureSenkouSpanAOverLast && + !isCFutureSenkouSpanAOverLastPrev; + bool isCFutureSenkouSpanACrossedUnderLast = isCFutureSenkouSpanAUnderLast && + !isCFutureSenkouSpanAUnderLastPrev; + + // + conditions.isCClosedOverKijunSen = isCClosedOverKijunSen; + conditions.isCClosedUnderKijunSen = isCClosedUnderKijunSen; + conditions.isCTenkanSenOverKijunSen = isCTenkanSenOverKijunSen; + conditions.isCTenkanSenUnderKijunSen = isCTenkanSenUnderKijunSen; + conditions.isCTenkanSenCrossedOverKijunSen = isCTenkanSenCrossedOverKijunSen; + conditions.isCTenkanSenCrossedUnderKijunSen = isCTenkanSenCrossedUnderKijunSen; + + // + conditions.isCSenkouSpanAOverB = isCSenkouSpanAOverB; + conditions.isCSenkouSpanAUnderB = isCSenkouSpanAUnderB; + conditions.isCSenkouSpanAOverLast = isCSenkouSpanAOverLast; + conditions.isCSenkouSpanAUnderLast = isCSenkouSpanAUnderLast; + conditions.isCFutureSenkouSpanAOverB = isCFutureSenkouSpanAOverB; + conditions.isCFutureSenkouSpanAUnderB = isCFutureSenkouSpanAUnderB; + conditions.isCFutureSenkouSpanAOverLast = isCFutureSenkouSpanAOverLast; + conditions.isCFutureSenkouSpanAUnderLast = isCFutureSenkouSpanAUnderLast; + + // + conditions.isCSenkouSpanACrossedOverB = isCSenkouSpanACrossedOverB; + conditions.isCSenkouSpanACrossedUnderB = isCSenkouSpanACrossedUnderB; + conditions.isCSenkouSpanACrossedOverLast = isCSenkouSpanACrossedOverLast; + conditions.isCSenkouSpanACrossedUnderLast = isCSenkouSpanACrossedUnderLast; + conditions.isCFutureSenkouSpanACrossedOverB = isCFutureSenkouSpanACrossedOverB; + conditions.isCFutureSenkouSpanACrossedUnderB = isCFutureSenkouSpanACrossedUnderB; + conditions.isCFutureSenkouSpanACrossedOverLast = isCFutureSenkouSpanACrossedOverLast; + conditions.isCFutureSenkouSpanACrossedUnderLast = isCFutureSenkouSpanACrossedUnderLast; + + // + // Short ... + + // + bool isSClosedOverKijunSen = cBar.low > conditions.sTK[cIndex]; + bool isSClosedUnderKijunSen = cBar.high < conditions.sTK[cIndex]; + + // + bool isSTenkanSenOverKijunSen = conditions.sTK[cIndex] > conditions.sKJ[cIndex]; + bool isSTenkanSenOverKijunSenPrev = conditions.sTK[pIndex] > conditions.sKJ[pIndex]; + + // + bool isSTenkanSenUnderKijunSen = conditions.sTK[cIndex] < conditions.sKJ[cIndex]; + bool isSTenkanSenUnderKijunSenPrev = conditions.sTK[pIndex] < conditions.sKJ[pIndex]; + + // + bool isSTenkanSenCrossedOverKijunSen = isSTenkanSenOverKijunSen && + !isSTenkanSenOverKijunSenPrev; + bool isSTenkanSenCrossedUnderKijunSen = isSTenkanSenUnderKijunSen && + !isSTenkanSenUnderKijunSenPrev; + + // + bool isSSenkouSpanAOverB = conditions.sSSA[cIndex] > conditions.sSSB[cIndex]; + bool isSSenkouSpanAOverBPrev = conditions.sSSA[pIndex] > conditions.sSSB[pIndex]; + + // + bool isSSenkouSpanAUnderB = conditions.sSSA[cIndex] < conditions.sSSB[cIndex]; + bool isSSenkouSpanAUnderBPrev = conditions.sSSA[pIndex] < conditions.sSSB[pIndex]; + + // + bool isSSenkouSpanAOverLast = conditions.sSSA[cIndex] > conditions.sSSA[pIndex]; + bool isSSenkouSpanAOverLastPrev = conditions.sSSA[pIndex] > conditions.sSSA[ppIndex]; + + // + bool isSSenkouSpanAUnderLast = conditions.sSSA[cIndex] < conditions.sSSA[pIndex]; + bool isSSenkouSpanAUnderLastPrev = conditions.sSSA[pIndex] < conditions.sSSA[ppIndex]; + + // + bool isSFutureSenkouSpanAOverB = conditions.sFSSA[cIndex] > conditions.sFSSB[cIndex]; + bool isSFutureSenkouSpanAOverBPrev = conditions.sFSSA[pIndex] > conditions.sFSSB[pIndex]; + + // + bool isSFutureSenkouSpanAUnderB = conditions.sFSSA[cIndex] < conditions.sFSSB[cIndex]; + bool isSFutureSenkouSpanAUnderBPrev = conditions.sFSSA[pIndex] < conditions.sFSSB[pIndex]; + + // + bool isSFutureSenkouSpanAOverLast = conditions.sFSSA[cIndex] > conditions.sFSSA[pIndex]; + bool isSFutureSenkouSpanAOverLastPrev = conditions.sFSSA[pIndex] > conditions.sFSSA[ppIndex]; + + // + bool isSFutureSenkouSpanAUnderLast = conditions.sFSSA[cIndex] < conditions.sFSSA[pIndex]; + bool isSFutureSenkouSpanAUnderLastPrev = conditions.sFSSA[pIndex] < conditions.sFSSA[ppIndex]; + + // + bool isSSenkouSpanACrossedOverB = isSSenkouSpanAOverB && + !isSSenkouSpanAOverBPrev; + bool isSSenkouSpanACrossedUnderB = isSSenkouSpanAUnderB && + !isSSenkouSpanAUnderBPrev; + bool isSSenkouSpanACrossedOverLast = isSSenkouSpanAOverLast && + !isSSenkouSpanAOverLastPrev; + bool isSSenkouSpanACrossedUnderLast = isSSenkouSpanAUnderLast && + !isSSenkouSpanAUnderLastPrev; + bool isSFutureSenkouSpanACrossedOverB = isSFutureSenkouSpanAOverB && + !isSFutureSenkouSpanAOverBPrev; + bool isSFutureSenkouSpanACrossedUnderB = isSFutureSenkouSpanAUnderB && + !isSFutureSenkouSpanAUnderBPrev; + bool isSFutureSenkouSpanACrossedOverLast = isSFutureSenkouSpanAOverLast && + !isSFutureSenkouSpanAOverLastPrev; + bool isSFutureSenkouSpanACrossedUnderLast = isSFutureSenkouSpanAUnderLast && + !isSFutureSenkouSpanAUnderLastPrev; + + // + conditions.isSClosedOverKijunSen = isSClosedOverKijunSen; + conditions.isSClosedUnderKijunSen = isSClosedUnderKijunSen; + conditions.isSTenkanSenOverKijunSen = isSTenkanSenOverKijunSen; + conditions.isSTenkanSenUnderKijunSen = isSTenkanSenUnderKijunSen; + conditions.isSTenkanSenCrossedOverKijunSen = isSTenkanSenCrossedOverKijunSen; + conditions.isSTenkanSenCrossedUnderKijunSen = isSTenkanSenCrossedUnderKijunSen; + + // + conditions.isSSenkouSpanAOverB = isSSenkouSpanAOverB; + conditions.isSSenkouSpanAUnderB = isSSenkouSpanAUnderB; + conditions.isSSenkouSpanAOverLast = isSSenkouSpanAOverLast; + conditions.isSSenkouSpanAUnderLast = isSSenkouSpanAUnderLast; + conditions.isSFutureSenkouSpanAOverB = isSFutureSenkouSpanAOverB; + conditions.isSFutureSenkouSpanAUnderB = isSFutureSenkouSpanAUnderB; + conditions.isSFutureSenkouSpanAOverLast = isSFutureSenkouSpanAOverLast; + conditions.isSFutureSenkouSpanAUnderLast = isSFutureSenkouSpanAUnderLast; + + // + conditions.isSSenkouSpanACrossedOverB = isSSenkouSpanACrossedOverB; + conditions.isSSenkouSpanACrossedUnderB = isSSenkouSpanACrossedUnderB; + conditions.isSSenkouSpanACrossedOverLast = isSSenkouSpanACrossedOverLast; + conditions.isSSenkouSpanACrossedUnderLast = isSSenkouSpanACrossedUnderLast; + conditions.isSFutureSenkouSpanACrossedOverB = isSFutureSenkouSpanACrossedOverB; + conditions.isSFutureSenkouSpanACrossedUnderB = isSFutureSenkouSpanACrossedUnderB; + conditions.isSFutureSenkouSpanACrossedOverLast = isSFutureSenkouSpanACrossedOverLast; + conditions.isSFutureSenkouSpanACrossedUnderLast = isSFutureSenkouSpanACrossedUnderLast; + + // + // Medium ... + + // + bool isMClosedOverKijunSen = cBar.low > conditions.mTK[cIndex]; + bool isMClosedUnderKijunSen = cBar.high < conditions.mTK[cIndex]; + + // + bool isMTenkanSenOverKijunSen = conditions.mTK[cIndex] > conditions.mKJ[cIndex]; + bool isMTenkanSenOverKijunSenPrev = conditions.mTK[pIndex] > conditions.mKJ[pIndex]; + + // + bool isMTenkanSenUnderKijunSen = conditions.mTK[cIndex] < conditions.mKJ[cIndex]; + bool isMTenkanSenUnderKijunSenPrev = conditions.mTK[pIndex] < conditions.mKJ[pIndex]; + + // + bool isMTenkanSenCrossedOverKijunSen = isMTenkanSenOverKijunSen && + !isMTenkanSenOverKijunSenPrev; + bool isMTenkanSenCrossedUnderKijunSen = isMTenkanSenUnderKijunSen && + !isMTenkanSenUnderKijunSenPrev; + + // + bool isMSenkouSpanAOverB = conditions.mSSA[cIndex] > conditions.mSSB[cIndex]; + bool isMSenkouSpanAOverBPrev = conditions.mSSA[pIndex] > conditions.mSSB[pIndex]; + + // + bool isMSenkouSpanAUnderB = conditions.mSSA[cIndex] < conditions.mSSB[cIndex]; + bool isMSenkouSpanAUnderBPrev = conditions.mSSA[pIndex] < conditions.mSSB[pIndex]; + + // + bool isMSenkouSpanAOverLast = conditions.mSSA[cIndex] > conditions.mSSA[pIndex]; + bool isMSenkouSpanAOverLastPrev = conditions.mSSA[pIndex] > conditions.mSSA[ppIndex]; + + // + bool isMSenkouSpanAUnderLast = conditions.mSSA[cIndex] < conditions.mSSA[pIndex]; + bool isMSenkouSpanAUnderLastPrev = conditions.mSSA[pIndex] < conditions.mSSA[ppIndex]; + + // + bool isMFutureSenkouSpanAOverB = conditions.mFSSA[cIndex] > conditions.mFSSB[cIndex]; + bool isMFutureSenkouSpanAOverBPrev = conditions.mFSSA[pIndex] > conditions.mFSSB[pIndex]; + + // + bool isMFutureSenkouSpanAUnderB = conditions.mFSSA[cIndex] < conditions.mFSSB[cIndex]; + bool isMFutureSenkouSpanAUnderBPrev = conditions.mFSSA[pIndex] < conditions.mFSSB[pIndex]; + + // + bool isMFutureSenkouSpanAOverLast = conditions.mFSSA[cIndex] > conditions.mFSSA[pIndex]; + bool isMFutureSenkouSpanAOverLastPrev = conditions.mFSSA[pIndex] > conditions.mFSSA[ppIndex]; + + // + bool isMFutureSenkouSpanAUnderLast = conditions.mFSSA[cIndex] < conditions.mFSSA[pIndex]; + bool isMFutureSenkouSpanAUnderLastPrev = conditions.mFSSA[pIndex] < conditions.mFSSA[ppIndex]; + + // + bool isMSenkouSpanACrossedOverB = isMSenkouSpanAOverB && + !isMSenkouSpanAOverBPrev; + bool isMSenkouSpanACrossedUnderB = isMSenkouSpanAUnderB && + !isMSenkouSpanAUnderBPrev; + bool isMSenkouSpanACrossedOverLast = isMSenkouSpanAOverLast && + !isMSenkouSpanAOverLastPrev; + bool isMSenkouSpanACrossedUnderLast = isMSenkouSpanAUnderLast && + !isMSenkouSpanAUnderLastPrev; + bool isMFutureSenkouSpanACrossedOverB = isMFutureSenkouSpanAOverB && + !isMFutureSenkouSpanAOverBPrev; + bool isMFutureSenkouSpanACrossedUnderB = isMFutureSenkouSpanAUnderB && + !isMFutureSenkouSpanAUnderBPrev; + bool isMFutureSenkouSpanACrossedOverLast = isMFutureSenkouSpanAOverLast && + !isMFutureSenkouSpanAOverLastPrev; + bool isMFutureSenkouSpanACrossedUnderLast = isMFutureSenkouSpanAUnderLast && + !isMFutureSenkouSpanAUnderLastPrev; + + // + conditions.isMClosedOverKijunSen = isMClosedOverKijunSen; + conditions.isMClosedUnderKijunSen = isMClosedUnderKijunSen; + conditions.isMTenkanSenOverKijunSen = isMTenkanSenOverKijunSen; + conditions.isMTenkanSenUnderKijunSen = isMTenkanSenUnderKijunSen; + conditions.isMTenkanSenCrossedOverKijunSen = isMTenkanSenCrossedOverKijunSen; + conditions.isMTenkanSenCrossedUnderKijunSen = isMTenkanSenCrossedUnderKijunSen; + + // + conditions.isMSenkouSpanAOverB = isMSenkouSpanAOverB; + conditions.isMSenkouSpanAUnderB = isMSenkouSpanAUnderB; + conditions.isMSenkouSpanAOverLast = isMSenkouSpanAOverLast; + conditions.isMSenkouSpanAUnderLast = isMSenkouSpanAUnderLast; + conditions.isMFutureSenkouSpanAOverB = isMFutureSenkouSpanAOverB; + conditions.isMFutureSenkouSpanAUnderB = isMFutureSenkouSpanAUnderB; + conditions.isMFutureSenkouSpanAOverLast = isMFutureSenkouSpanAOverLast; + conditions.isMFutureSenkouSpanAUnderLast = isMFutureSenkouSpanAUnderLast; + + // + conditions.isMSenkouSpanACrossedOverB = isMSenkouSpanACrossedOverB; + conditions.isMSenkouSpanACrossedUnderB = isMSenkouSpanACrossedUnderB; + conditions.isMSenkouSpanACrossedOverLast = isMSenkouSpanACrossedOverLast; + conditions.isMSenkouSpanACrossedUnderLast = isMSenkouSpanACrossedUnderLast; + conditions.isMFutureSenkouSpanACrossedOverB = isMFutureSenkouSpanACrossedOverB; + conditions.isMFutureSenkouSpanACrossedUnderB = isMFutureSenkouSpanACrossedUnderB; + conditions.isMFutureSenkouSpanACrossedOverLast = isMFutureSenkouSpanACrossedOverLast; + conditions.isMFutureSenkouSpanACrossedUnderLast = isMFutureSenkouSpanACrossedUnderLast; + + // + // Long ... + + // + bool isLClosedOverKijunSen = cBar.low > conditions.lTK[cIndex]; + bool isLClosedUnderKijunSen = cBar.high < conditions.lTK[cIndex]; + + // + bool isLTenkanSenOverKijunSen = conditions.lTK[cIndex] > conditions.lKJ[cIndex]; + bool isLTenkanSenOverKijunSenPrev = conditions.lTK[pIndex] > conditions.lKJ[pIndex]; + + // + bool isLTenkanSenUnderKijunSen = conditions.lTK[cIndex] < conditions.lKJ[cIndex]; + bool isLTenkanSenUnderKijunSenPrev = conditions.lTK[pIndex] < conditions.lKJ[pIndex]; + + // + bool isLTenkanSenCrossedOverKijunSen = isLTenkanSenOverKijunSen && + !isLTenkanSenOverKijunSenPrev; + bool isLTenkanSenCrossedUnderKijunSen = isLTenkanSenUnderKijunSen && + !isLTenkanSenUnderKijunSenPrev; + + // + bool isLSenkouSpanAOverB = conditions.lSSA[cIndex] > conditions.lSSB[cIndex]; + bool isLSenkouSpanAOverBPrev = conditions.lSSA[pIndex] > conditions.lSSB[pIndex]; + + // + bool isLSenkouSpanAUnderB = conditions.lSSA[cIndex] < conditions.lSSB[cIndex]; + bool isLSenkouSpanAUnderBPrev = conditions.lSSA[pIndex] < conditions.lSSB[pIndex]; + + // + bool isLSenkouSpanAOverLast = conditions.lSSA[cIndex] > conditions.lSSA[pIndex]; + bool isLSenkouSpanAOverLastPrev = conditions.lSSA[pIndex] > conditions.lSSA[ppIndex]; + + // + bool isLSenkouSpanAUnderLast = conditions.lSSA[cIndex] < conditions.lSSA[pIndex]; + bool isLSenkouSpanAUnderLastPrev = conditions.lSSA[pIndex] < conditions.lSSA[ppIndex]; + + // + bool isLFutureSenkouSpanAOverB = conditions.lFSSA[cIndex] > conditions.lFSSB[cIndex]; + bool isLFutureSenkouSpanAOverBPrev = conditions.lFSSA[pIndex] > conditions.lFSSB[pIndex]; + + // + bool isLFutureSenkouSpanAUnderB = conditions.lFSSA[cIndex] < conditions.lFSSB[cIndex]; + bool isLFutureSenkouSpanAUnderBPrev = conditions.lFSSA[pIndex] < conditions.lFSSB[pIndex]; + + // + bool isLFutureSenkouSpanAOverLast = conditions.lFSSA[cIndex] > conditions.lFSSA[pIndex]; + bool isLFutureSenkouSpanAOverLastPrev = conditions.lFSSA[pIndex] > conditions.lFSSA[ppIndex]; + + // + bool isLFutureSenkouSpanAUnderLast = conditions.lFSSA[cIndex] < conditions.lFSSA[pIndex]; + bool isLFutureSenkouSpanAUnderLastPrev = conditions.lFSSA[pIndex] < conditions.lFSSA[ppIndex]; + + // + bool isLSenkouSpanACrossedOverB = isLSenkouSpanAOverB && + !isLSenkouSpanAOverBPrev; + bool isLSenkouSpanACrossedUnderB = isLSenkouSpanAUnderB && + !isLSenkouSpanAUnderBPrev; + bool isLSenkouSpanACrossedOverLast = isLSenkouSpanAOverLast && + !isLSenkouSpanAOverLastPrev; + bool isLSenkouSpanACrossedUnderLast = isLSenkouSpanAUnderLast && + !isLSenkouSpanAUnderLastPrev; + bool isLFutureSenkouSpanACrossedOverB = isLFutureSenkouSpanAOverB && + !isLFutureSenkouSpanAOverBPrev; + bool isLFutureSenkouSpanACrossedUnderB = isLFutureSenkouSpanAUnderB && + !isLFutureSenkouSpanAUnderBPrev; + bool isLFutureSenkouSpanACrossedOverLast = isLFutureSenkouSpanAOverLast && + !isLFutureSenkouSpanAOverLastPrev; + bool isLFutureSenkouSpanACrossedUnderLast = isLFutureSenkouSpanAUnderLast && + !isLFutureSenkouSpanAUnderLastPrev; + + // + conditions.isLClosedOverKijunSen = isLClosedOverKijunSen; + conditions.isLClosedUnderKijunSen = isLClosedUnderKijunSen; + conditions.isLTenkanSenOverKijunSen = isLTenkanSenOverKijunSen; + conditions.isLTenkanSenUnderKijunSen = isLTenkanSenUnderKijunSen; + conditions.isLTenkanSenCrossedOverKijunSen = isLTenkanSenCrossedOverKijunSen; + conditions.isLTenkanSenCrossedUnderKijunSen = isLTenkanSenCrossedUnderKijunSen; + + // + conditions.isLSenkouSpanAOverB = isLSenkouSpanAOverB; + conditions.isLSenkouSpanAUnderB = isLSenkouSpanAUnderB; + conditions.isLSenkouSpanAOverLast = isLSenkouSpanAOverLast; + conditions.isLSenkouSpanAUnderLast = isLSenkouSpanAUnderLast; + conditions.isLFutureSenkouSpanAOverB = isLFutureSenkouSpanAOverB; + conditions.isLFutureSenkouSpanAUnderB = isLFutureSenkouSpanAUnderB; + conditions.isLFutureSenkouSpanAOverLast = isLFutureSenkouSpanAOverLast; + conditions.isLFutureSenkouSpanAUnderLast = isLFutureSenkouSpanAUnderLast; + + // + conditions.isLSenkouSpanACrossedOverB = isLSenkouSpanACrossedOverB; + conditions.isLSenkouSpanACrossedUnderB = isLSenkouSpanACrossedUnderB; + conditions.isLSenkouSpanACrossedOverLast = isLSenkouSpanACrossedOverLast; + conditions.isLSenkouSpanACrossedUnderLast = isLSenkouSpanACrossedUnderLast; + conditions.isLFutureSenkouSpanACrossedOverB = isLFutureSenkouSpanACrossedOverB; + conditions.isLFutureSenkouSpanACrossedUnderB = isLFutureSenkouSpanACrossedUnderB; + conditions.isLFutureSenkouSpanACrossedOverLast = isLFutureSenkouSpanACrossedOverLast; + conditions.isLFutureSenkouSpanACrossedUnderLast = isLFutureSenkouSpanACrossedUnderLast; + + // + // Hind ... + + // + bool isHClosedOverKijunSen = cBar.low > conditions.hTK[cIndex]; + bool isHClosedUnderKijunSen = cBar.high < conditions.hTK[cIndex]; + + // + bool isHTenkanSenOverKijunSen = conditions.hTK[cIndex] > conditions.hKJ[cIndex]; + bool isHTenkanSenOverKijunSenPrev = conditions.hTK[pIndex] > conditions.hKJ[pIndex]; + + // + bool isHTenkanSenUnderKijunSen = conditions.hTK[cIndex] < conditions.hKJ[cIndex]; + bool isHTenkanSenUnderKijunSenPrev = conditions.hTK[pIndex] < conditions.hKJ[pIndex]; + + // + bool isHTenkanSenCrossedOverKijunSen = isHTenkanSenOverKijunSen && + !isHTenkanSenOverKijunSenPrev; + bool isHTenkanSenCrossedUnderKijunSen = isHTenkanSenUnderKijunSen && + !isHTenkanSenUnderKijunSenPrev; + + // + bool isHSenkouSpanAOverB = conditions.hSSA[cIndex] > conditions.hSSB[cIndex]; + bool isHSenkouSpanAOverBPrev = conditions.hSSA[pIndex] > conditions.hSSB[pIndex]; + + // + bool isHSenkouSpanAUnderB = conditions.hSSA[cIndex] < conditions.hSSB[cIndex]; + bool isHSenkouSpanAUnderBPrev = conditions.hSSA[pIndex] < conditions.hSSB[pIndex]; + + // + bool isHSenkouSpanAOverLast = conditions.hSSA[cIndex] > conditions.hSSA[pIndex]; + bool isHSenkouSpanAOverLastPrev = conditions.hSSA[pIndex] > conditions.hSSA[ppIndex]; + + // + bool isHSenkouSpanAUnderLast = conditions.hSSA[cIndex] < conditions.hSSA[pIndex]; + bool isHSenkouSpanAUnderLastPrev = conditions.hSSA[pIndex] < conditions.hSSA[ppIndex]; + + // + bool isHFutureSenkouSpanAOverB = conditions.hFSSA[cIndex] > conditions.hFSSB[cIndex]; + bool isHFutureSenkouSpanAOverBPrev = conditions.hFSSA[pIndex] > conditions.hFSSB[pIndex]; + + // + bool isHFutureSenkouSpanAUnderB = conditions.hFSSA[cIndex] < conditions.hFSSB[cIndex]; + bool isHFutureSenkouSpanAUnderBPrev = conditions.hFSSA[pIndex] < conditions.hFSSB[pIndex]; + + // + bool isHFutureSenkouSpanAOverLast = conditions.hFSSA[cIndex] > conditions.hFSSA[pIndex]; + bool isHFutureSenkouSpanAOverLastPrev = conditions.hFSSA[pIndex] > conditions.hFSSA[ppIndex]; + + // + bool isHFutureSenkouSpanAUnderLast = conditions.hFSSA[cIndex] < conditions.hFSSA[pIndex]; + bool isHFutureSenkouSpanAUnderLastPrev = conditions.hFSSA[pIndex] < conditions.hFSSA[ppIndex]; + + // + bool isHSenkouSpanACrossedOverB = isHSenkouSpanAOverB && + !isHSenkouSpanAOverBPrev; + bool isHSenkouSpanACrossedUnderB = isHSenkouSpanAUnderB && + !isHSenkouSpanAUnderBPrev; + bool isHSenkouSpanACrossedOverLast = isHSenkouSpanAOverLast && + !isHSenkouSpanAOverLastPrev; + bool isHSenkouSpanACrossedUnderLast = isHSenkouSpanAUnderLast && + !isHSenkouSpanAUnderLastPrev; + bool isHFutureSenkouSpanACrossedOverB = isHFutureSenkouSpanAOverB && + !isHFutureSenkouSpanAOverBPrev; + bool isHFutureSenkouSpanACrossedUnderB = isHFutureSenkouSpanAUnderB && + !isHFutureSenkouSpanAUnderBPrev; + bool isHFutureSenkouSpanACrossedOverLast = isHFutureSenkouSpanAOverLast && + !isHFutureSenkouSpanAOverLastPrev; + bool isHFutureSenkouSpanACrossedUnderLast = isHFutureSenkouSpanAUnderLast && + !isHFutureSenkouSpanAUnderLastPrev; + + // + conditions.isHClosedOverKijunSen = isHClosedOverKijunSen; + conditions.isHClosedUnderKijunSen = isHClosedUnderKijunSen; + conditions.isHTenkanSenOverKijunSen = isHTenkanSenOverKijunSen; + conditions.isHTenkanSenUnderKijunSen = isHTenkanSenUnderKijunSen; + conditions.isHTenkanSenCrossedOverKijunSen = isHTenkanSenCrossedOverKijunSen; + conditions.isHTenkanSenCrossedUnderKijunSen = isHTenkanSenCrossedUnderKijunSen; + + // + conditions.isHSenkouSpanAOverB = isHSenkouSpanAOverB; + conditions.isHSenkouSpanAUnderB = isHSenkouSpanAUnderB; + conditions.isHSenkouSpanAOverLast = isHSenkouSpanAOverLast; + conditions.isHSenkouSpanAUnderLast = isHSenkouSpanAUnderLast; + conditions.isHFutureSenkouSpanAOverB = isHFutureSenkouSpanAOverB; + conditions.isHFutureSenkouSpanAUnderB = isHFutureSenkouSpanAUnderB; + conditions.isHFutureSenkouSpanAOverLast = isHFutureSenkouSpanAOverLast; + conditions.isHFutureSenkouSpanAUnderLast = isHFutureSenkouSpanAUnderLast; + + // + conditions.isHSenkouSpanACrossedOverB = isHSenkouSpanACrossedOverB; + conditions.isHSenkouSpanACrossedUnderB = isHSenkouSpanACrossedUnderB; + conditions.isHSenkouSpanACrossedOverLast = isHSenkouSpanACrossedOverLast; + conditions.isHSenkouSpanACrossedUnderLast = isHSenkouSpanACrossedUnderLast; + conditions.isHFutureSenkouSpanACrossedOverB = isHFutureSenkouSpanACrossedOverB; + conditions.isHFutureSenkouSpanACrossedUnderB = isHFutureSenkouSpanACrossedUnderB; + conditions.isHFutureSenkouSpanACrossedOverLast = isHFutureSenkouSpanACrossedOverLast; + conditions.isHFutureSenkouSpanACrossedUnderLast = isHFutureSenkouSpanACrossedUnderLast; + + // + return result; + } + // // Protected ... protected: diff --git a/Indicators/x-saherelm.xchich.mq5 b/Indicators/x-saherelm.xchich.mq5 index 427dabbb..f468e31d 100644 --- a/Indicators/x-saherelm.xchich.mq5 +++ b/Indicators/x-saherelm.xchich.mq5 @@ -91,63 +91,21 @@ input ENUM_TIMEFRAMES hcPeriod = NULL; // Time Period input group "Presentation"; // -input group "All Cycles"; input bool showTenkanSen = true; // Show Tenkan Sen input bool showKijunSen = true; // Show Kijun Sen input bool showChikouSpan = true; // Show Chikou Span input bool showSenkouSpanA = true; // Show Senkou Span A input bool showSenkouSpanB = true; // Show Senkou Span B input bool showKumo = true; // Show Kumo +input bool shiftKumo = true; // Shift Kumo to Future // -input group "Current"; -input bool showCTenkanSen = true; // Show Tenkan Sen -input bool showCKijunSen = true; // Show Kijun Sen -input bool showCChikouSpan = true; // Show Chikou Span -input bool showCSenkouSpanA = true; // Show Senkou Span A -input bool showCSenkouSpanB = true; // Show Senkou Span B -input bool showCKumo = true; // Show Kumo -input bool shiftCKumo = true; // Shift Kumo to Future +input bool showCurrent = true; // Show Current Cycle +input bool showShort = true; // Show Short Cycle +input bool showMedium = true; // Show Medium Cycle +input bool showLong = true; // Show Long Cycle +input bool showHind = true; // Show Hind Cycle -// -input group "Short"; -input bool showSTenkanSen = true; // Show Tenkan Sen -input bool showSKijunSen = true; // Show Kijun Sen -input bool showSChikouSpan = true; // Show Chikou Span -input bool showSSenkouSpanA = true; // Show Senkou Span A -input bool showSSenkouSpanB = true; // Show Senkou Span B -input bool showSKumo = true; // Show Kumo -input bool shiftSKumo = true; // Shift Kumo to Future - -// -input group "Medium"; -input bool showMTenkanSen = true; // Show Tenkan Sen -input bool showMKijunSen = true; // Show Kijun Sen -input bool showMChikouSpan = true; // Show Chikou Span -input bool showMSenkouSpanA = true; // Show Senkou Span A -input bool showMSenkouSpanB = true; // Show Senkou Span B -input bool showMKumo = true; // Show Kumo -input bool shiftMKumo = true; // Shift Kumo to Future - -// -input group "Long"; -input bool showLTenkanSen = true; // Show Tenkan Sen -input bool showLKijunSen = true; // Show Kijun Sen -input bool showLChikouSpan = true; // Show Chikou Span -input bool showLSenkouSpanA = true; // Show Senkou Span A -input bool showLSenkouSpanB = true; // Show Senkou Span B -input bool showLKumo = true; // Show Kumo -input bool shiftLKumo = true; // Shift Kumo to Future - -// -input group "Hind"; -input bool showHTenkanSen = true; // Show Tenkan Sen -input bool showHKijunSen = true; // Show Kijun Sen -input bool showHChikouSpan = true; // Show Chikou Span -input bool showHSenkouSpanA = true; // Show Senkou Span A -input bool showHSenkouSpanB = true; // Show Senkou Span B -input bool showHKumo = true; // Show Kumo -input bool shiftHKumo = true; // Shift Kumo to Future // // Buffers ... @@ -1000,7 +958,7 @@ void DefineBuffers() // TENKANSEN ... // - bool canCShowTenkanSen = showTenkanSen && showCTenkanSen; + bool canCShowTenkanSen = showTenkanSen && showCurrent; ENUM_DRAW_TYPE cTenkanSenDrawType = canCShowTenkanSen ? DRAW_LINE : DRAW_NONE; // @@ -1014,7 +972,7 @@ void DefineBuffers() // KIJUNSEN ... // - bool canCShowKijunSen = showKijunSen && showCKijunSen; + bool canCShowKijunSen = showKijunSen && showCurrent; ENUM_DRAW_TYPE cKijunSenDrawType = canCShowKijunSen ? DRAW_LINE : DRAW_NONE; // @@ -1028,7 +986,7 @@ void DefineBuffers() // CHIKOUSPAN ... // - bool canCShowChikouSpan = showChikouSpan && showCChikouSpan; + bool canCShowChikouSpan = showChikouSpan && showCurrent; ENUM_DRAW_TYPE cChikouSpanDrawType = canCShowChikouSpan ? DRAW_LINE : DRAW_NONE; // @@ -1041,11 +999,11 @@ void DefineBuffers() // // SENKOUSPAN A and B ... - int cShiftSize = shiftCKumo ? mCKijunSenLength : 0; + int cShiftSize = shiftKumo ? mCKijunSenLength : 0; // // SENKOUSPANA ... - bool canCShowSenkouSpanA = showSenkouSpanA && showCSenkouSpanA; + bool canCShowSenkouSpanA = showSenkouSpanA && showCurrent; ENUM_DRAW_TYPE cSenkouSpanADrawType = canCShowSenkouSpanA ? DRAW_LINE : DRAW_NONE; // @@ -1057,7 +1015,7 @@ void DefineBuffers() // // SENKOUSPANB ... - bool canCShowSenkouSpanB = showSenkouSpanB && showCSenkouSpanB; + bool canCShowSenkouSpanB = showSenkouSpanB && showCurrent; ENUM_DRAW_TYPE cSenkouSpanBDrawType = canCShowSenkouSpanB ? DRAW_LINE : DRAW_NONE; // @@ -1074,7 +1032,7 @@ void DefineBuffers() // TENKANSEN ... // - bool canSShowTenkanSen = showTenkanSen && showSTenkanSen; + bool canSShowTenkanSen = showTenkanSen && showShort; ENUM_DRAW_TYPE sTenkanSenDrawType = canSShowTenkanSen ? DRAW_LINE : DRAW_NONE; // @@ -1088,7 +1046,7 @@ void DefineBuffers() // KIJUNSEN ... // - bool canSShowKijunSen = showKijunSen && showSKijunSen; + bool canSShowKijunSen = showKijunSen && showShort; ENUM_DRAW_TYPE sKijunSenDrawType = canSShowKijunSen ? DRAW_LINE : DRAW_NONE; // @@ -1102,7 +1060,7 @@ void DefineBuffers() // CHIKOUSPAN ... // - bool canSShowChikouSpan = showChikouSpan && showSChikouSpan; + bool canSShowChikouSpan = showChikouSpan && showShort; ENUM_DRAW_TYPE sChikouSpanDrawType = canSShowChikouSpan ? DRAW_LINE : DRAW_NONE; // @@ -1115,11 +1073,11 @@ void DefineBuffers() // // SENKOUSPAN A and B ... - int sShiftSize = shiftSKumo ? mSKijunSenLength : 0; + int sShiftSize = shiftKumo ? mSKijunSenLength : 0; // // SENKOUSPANA ... - bool canSShowSenkouSpanA = showSenkouSpanA && showSSenkouSpanA; + bool canSShowSenkouSpanA = showSenkouSpanA && showShort; ENUM_DRAW_TYPE sSenkouSpanADrawType = canSShowSenkouSpanA ? DRAW_LINE : DRAW_NONE; // @@ -1131,7 +1089,7 @@ void DefineBuffers() // // SENKOUSPANB ... - bool canSShowSenkouSpanB = showSenkouSpanB && showSSenkouSpanB; + bool canSShowSenkouSpanB = showSenkouSpanB && showShort; ENUM_DRAW_TYPE sSenkouSpanBDrawType = canSShowSenkouSpanB ? DRAW_LINE : DRAW_NONE; // @@ -1148,7 +1106,7 @@ void DefineBuffers() // TENKANSEN ... // - bool canMShowTenkanSen = showTenkanSen && showMTenkanSen; + bool canMShowTenkanSen = showTenkanSen && showMedium; ENUM_DRAW_TYPE mTenkanSenDrawType = canMShowTenkanSen ? DRAW_LINE : DRAW_NONE; // @@ -1162,7 +1120,7 @@ void DefineBuffers() // KIJUNSEN ... // - bool canMShowKijunSen = showKijunSen && showMKijunSen; + bool canMShowKijunSen = showKijunSen && showMedium; ENUM_DRAW_TYPE mKijunSenDrawType = canMShowKijunSen ? DRAW_LINE : DRAW_NONE; // @@ -1176,7 +1134,7 @@ void DefineBuffers() // CHIKOUSPAN ... // - bool canMShowChikouSpan = showChikouSpan && showMChikouSpan; + bool canMShowChikouSpan = showChikouSpan && showMedium; ENUM_DRAW_TYPE mChikouSpanDrawType = canMShowChikouSpan ? DRAW_LINE : DRAW_NONE; // @@ -1189,11 +1147,11 @@ void DefineBuffers() // // SENKOUSPAN A and B ... - int mShiftSize = shiftMKumo ? mMKijunSenLength : 0; + int mShiftSize = shiftKumo ? mMKijunSenLength : 0; // // SENKOUSPANA ... - bool canMShowSenkouSpanA = showSenkouSpanA && showMSenkouSpanA; + bool canMShowSenkouSpanA = showSenkouSpanA && showMedium; ENUM_DRAW_TYPE mSenkouSpanADrawType = canMShowSenkouSpanA ? DRAW_LINE : DRAW_NONE; // @@ -1205,7 +1163,7 @@ void DefineBuffers() // // SENKOUSPANB ... - bool canMShowSenkouSpanB = showSenkouSpanB && showMSenkouSpanB; + bool canMShowSenkouSpanB = showSenkouSpanB && showMedium; ENUM_DRAW_TYPE mSenkouSpanBDrawType = canMShowSenkouSpanB ? DRAW_LINE : DRAW_NONE; // @@ -1222,7 +1180,7 @@ void DefineBuffers() // TENKANSEN ... // - bool canLShowTenkanSen = showTenkanSen && showLTenkanSen; + bool canLShowTenkanSen = showTenkanSen && showLong; ENUM_DRAW_TYPE lTenkanSenDrawType = canLShowTenkanSen ? DRAW_LINE : DRAW_NONE; // @@ -1236,7 +1194,7 @@ void DefineBuffers() // KIJUNSEN ... // - bool canLShowKijunSen = showKijunSen && showLKijunSen; + bool canLShowKijunSen = showKijunSen && showLong; ENUM_DRAW_TYPE lKijunSenDrawType = canLShowKijunSen ? DRAW_LINE : DRAW_NONE; // @@ -1250,7 +1208,7 @@ void DefineBuffers() // CHIKOUSPAN ... // - bool canLShowChikouSpan = showChikouSpan && showLChikouSpan; + bool canLShowChikouSpan = showChikouSpan && showLong; ENUM_DRAW_TYPE lChikouSpanDrawType = canLShowChikouSpan ? DRAW_LINE : DRAW_NONE; // @@ -1263,11 +1221,11 @@ void DefineBuffers() // // SENKOUSPAN A and B ... - int lShiftSize = shiftLKumo ? mLKijunSenLength : 0; + int lShiftSize = shiftKumo ? mLKijunSenLength : 0; // // SENKOUSPANA ... - bool canLShowSenkouSpanA = showSenkouSpanA && showLSenkouSpanA; + bool canLShowSenkouSpanA = showSenkouSpanA && showLong; ENUM_DRAW_TYPE lSenkouSpanADrawType = canLShowSenkouSpanA ? DRAW_LINE : DRAW_NONE; // @@ -1279,7 +1237,7 @@ void DefineBuffers() // // SENKOUSPANB ... - bool canLShowSenkouSpanB = showSenkouSpanB && showLSenkouSpanB; + bool canLShowSenkouSpanB = showSenkouSpanB && showLong; ENUM_DRAW_TYPE lSenkouSpanBDrawType = canLShowSenkouSpanB ? DRAW_LINE : DRAW_NONE; // @@ -1296,7 +1254,7 @@ void DefineBuffers() // TENKANSEN ... // - bool canHShowTenkanSen = showTenkanSen && showHTenkanSen; + bool canHShowTenkanSen = showTenkanSen && showHind; ENUM_DRAW_TYPE hTenkanSenDrawType = canHShowTenkanSen ? DRAW_LINE : DRAW_NONE; // @@ -1310,7 +1268,7 @@ void DefineBuffers() // KIJUNSEN ... // - bool canHShowKijunSen = showKijunSen && showHKijunSen; + bool canHShowKijunSen = showKijunSen && showHind; ENUM_DRAW_TYPE hKijunSenDrawType = canHShowKijunSen ? DRAW_LINE : DRAW_NONE; // @@ -1324,7 +1282,7 @@ void DefineBuffers() // CHIKOUSPAN ... // - bool canHShowChikouSpan = showChikouSpan && showHChikouSpan; + bool canHShowChikouSpan = showChikouSpan && showHind; ENUM_DRAW_TYPE hChikouSpanDrawType = canHShowChikouSpan ? DRAW_LINE : DRAW_NONE; // @@ -1337,11 +1295,11 @@ void DefineBuffers() // // SENKOUSPAN A and B ... - int hShiftSize = shiftHKumo ? mHKijunSenLength : 0; + int hShiftSize = shiftKumo ? mHKijunSenLength : 0; // // SENKOUSPANA ... - bool canHShowSenkouSpanA = showSenkouSpanA && showHSenkouSpanA; + bool canHShowSenkouSpanA = showSenkouSpanA && showHind; ENUM_DRAW_TYPE hSenkouSpanADrawType = canHShowSenkouSpanA ? DRAW_LINE : DRAW_NONE; // @@ -1353,7 +1311,7 @@ void DefineBuffers() // // SENKOUSPANB ... - bool canHShowSenkouSpanB = showSenkouSpanB && showHSenkouSpanB; + bool canHShowSenkouSpanB = showSenkouSpanB && showHind; ENUM_DRAW_TYPE hSenkouSpanBDrawType = canHShowSenkouSpanB ? DRAW_LINE : DRAW_NONE; // @@ -1371,7 +1329,7 @@ void DefineBuffers() // // Current ... - bool cCanShowKumo = showKumo && showCKumo; + bool cCanShowKumo = showKumo && showCurrent; ENUM_DRAW_TYPE cKumoDrawType = cCanShowKumo ? DRAW_FILLING : DRAW_NONE; // @@ -1393,7 +1351,7 @@ void DefineBuffers() // // Short ... - bool sCanShowKumo = showKumo && showSKumo; + bool sCanShowKumo = showKumo && showShort; ENUM_DRAW_TYPE sKumoDrawType = sCanShowKumo ? DRAW_FILLING : DRAW_NONE; // @@ -1415,7 +1373,7 @@ void DefineBuffers() // // Medium ... - bool mCanShowKumo = showKumo && showMKumo; + bool mCanShowKumo = showKumo && showMedium; ENUM_DRAW_TYPE mKumoDrawType = mCanShowKumo ? DRAW_FILLING : DRAW_NONE; // @@ -1437,7 +1395,7 @@ void DefineBuffers() // // Long ... - bool lCanShowKumo = showKumo && showLKumo; + bool lCanShowKumo = showKumo && showLong; ENUM_DRAW_TYPE lKumoDrawType = lCanShowKumo ? DRAW_FILLING : DRAW_NONE; // @@ -1459,7 +1417,7 @@ void DefineBuffers() // // Hind ... - bool hCanShowKumo = showKumo && showHKumo; + bool hCanShowKumo = showKumo && showHind; ENUM_DRAW_TYPE hKumoDrawType = hCanShowKumo ? DRAW_FILLING : DRAW_NONE; // diff --git a/Indicators/x-saherelm.xchvlm.mq5 b/Indicators/x-saherelm.xchvlm.mq5 index 2f04a893..dd1105e9 100644 --- a/Indicators/x-saherelm.xchvlm.mq5 +++ b/Indicators/x-saherelm.xchvlm.mq5 @@ -60,7 +60,6 @@ input ENUM_TIMEFRAMES hcPeriod = NULL; // Time Period input group "Presentation"; // -// Current ... input bool showCurrent = true; // Show Current Cycle input bool showShort = true; // Show Short Cycle input bool showMedium = true; // Show Medium Cycle diff --git a/Libraries/x-saherelm.common.lib.mq5 b/Libraries/x-saherelm.common.lib.mq5 index 895069bb..8ef8b9ba 100644 --- a/Libraries/x-saherelm.common.lib.mq5 +++ b/Libraries/x-saherelm.common.lib.mq5 @@ -11333,4 +11333,72 @@ ENUM_TIMEFRAMES GetCyclePeriod( return result; } +// +// Calculate a Cycle Length based on Host Period ... +int GetCycleLengthOn( + ENUM_TIMEFRAMES _hostPeriod, + ENUM_X_MARKET_CYCLES _cycle, + ENUM_X_PERIOD_METHOD _method, + ENUM_TIMEFRAMES _period // +) +{ + // + int result = 0; + + // + // Validate ... + bool isValid = + // + IsValid(_hostPeriod) && + IsValid(_method, _Period) + // + ; + if (!isValid) + { + return result; + } + + // + // Calculate Period ... + isValid = + _method != X_PERIOD_NOTHING && + _cycle != X_MARKET_CYCLE_UNKNOWN; + if (!isValid) + { + return result; + } + + // + if (_method == X_PERIOD_AUTO) + { + // + _period = GetCyclePeriod( + _cycle, + _hostPeriod // + ); + } + isValid = IsValid(_period); + if (!isValid) + { + return result; + } + + // + int _hostPeriodSeconds = PeriodSeconds(_hostPeriod); + int _periodSeconds = PeriodSeconds(_period); + + // + isValid = _periodSeconds >= _hostPeriodSeconds; + if (!isValid) + { + return result; + } + + // + result = _periodSeconds / _hostPeriodSeconds; + + // + return result; +} + // \ No newline at end of file diff --git a/Parsers/x-saherelm.xch.parser.mq5 b/Parsers/x-saherelm.xch.parser.mq5 index a3a64e65..dcc24425 100644 --- a/Parsers/x-saherelm.xch.parser.mq5 +++ b/Parsers/x-saherelm.xch.parser.mq5 @@ -797,7 +797,8 @@ struct XCHStartegyConditionsParser // Filter Long Signals ... bool IsLongFiltered( XSignal &signal, - XCHStrategyConditions &conditions // + XCHStrategyConditions &conditions, + bool force = false // ) { // @@ -808,17 +809,34 @@ struct XCHStartegyConditionsParser bool isGBPUSD = _symbolParser.IsGBPUSD(signal.symbol); // - if (isEURUSD) + if (!force) { // - result = - _eurusdLongParser.IsFiltered(conditions); + if (isEURUSD) + { + // + result = + _eurusdLongParser.IsFiltered(conditions); + } + else if (isGBPUSD) + { + // + result = + _gbpusdLongParser.IsFiltered(conditions); + } } - else if (isGBPUSD) + else { // result = - _gbpusdLongParser.IsFiltered(conditions); + // + _eurusdLongParser.IsFiltered(conditions) + // + || + // + _gbpusdLongParser.IsFiltered(conditions) + // + ; } // @@ -829,7 +847,8 @@ struct XCHStartegyConditionsParser // Filter Short Signals ... bool IsShortFiltered( XSignal &signal, - XCHStrategyConditions &conditions // + XCHStrategyConditions &conditions, + bool force = false // ) { // @@ -840,17 +859,34 @@ struct XCHStartegyConditionsParser bool isGBPUSD = _symbolParser.IsGBPUSD(signal.symbol); // - if (isEURUSD) + if (!force) { // - result = - _eurusdShortParser.IsFiltered(conditions); + if (isEURUSD) + { + // + result = + _eurusdShortParser.IsFiltered(conditions); + } + else if (isGBPUSD) + { + // + result = + _gbpusdShortParser.IsFiltered(conditions); + } } - else if (isGBPUSD) + else { // result = - _gbpusdShortParser.IsFiltered(conditions); + // + _eurusdShortParser.IsFiltered(conditions) + // + || + // + _gbpusdShortParser.IsFiltered(conditions) + // + ; } // diff --git a/Strategies/x-saherelm.xch.strategy.mq5 b/Strategies/x-saherelm.xch.strategy.mq5 index 65fc9ec7..26b58561 100644 --- a/Strategies/x-saherelm.xch.strategy.mq5 +++ b/Strategies/x-saherelm.xch.strategy.mq5 @@ -31,6 +31,7 @@ #include "../Helpers/x-saherelm.xchche.helper.mq5" #include "../Helpers/x-saherelm.xchstr.helper.mq5" #include "../Helpers/x-saherelm.xchvlm.helper.mq5" +#include "../Helpers/x-saherelm.xchich.helper.mq5" #include "../Helpers/x-saherelm.xchvwap.helper.mq5" #include "../Helpers/x-saherelm.xchswings.helper.mq5" @@ -95,6 +96,7 @@ struct XCHStrategyConditions XCHCHEConditions chcheConditions; XCHSTRConditions chstrConditions; XCHVLMConditions chvlmConditions; + XCHICHConditions chichConditions; XCHVWAPConditions chvwapConditions; // @@ -630,6 +632,15 @@ public: return result; } + // + // XCHICH ... + XCHICHConditions chichConditions; + result = chichHelper.GetConditions(chichConditions); + if (!result) + { + return result; + } + // // XCHVWAP ... XCHVWAPConditions chvwapConditions; @@ -686,6 +697,7 @@ public: conditions.chstrConditions = chstrConditions; conditions.chcheConditions = chcheConditions; conditions.chvlmConditions = chvlmConditions; + conditions.chichConditions = chichConditions; conditions.chvwapConditions = chvwapConditions; // @@ -926,7 +938,7 @@ public: notHaveBearishPower && cBar.low > chmMinBullishFast && chmConditions.isBullishPowerUp && - chcheConditions.isCStrongBullish + chcheConditions.isCStrongBullish // ; @@ -1171,7 +1183,7 @@ public: chcheMinCBullish > 0 && chcheConditions.hasBullishPower && chcheConditions.isCStrongBullish && - chcheMinCBullish > GetMaxCHCHECLast() + chcheMinCBullish > GetMaxCHCHECLast() // ; @@ -1380,6 +1392,11 @@ protected: XCHVLMInputs chvlmInputs; XSCXCHVLMHelper *chvlmHelper; + // + // XCHICH ... + XCHICHInputs chichInputs; + XSCXCHICHHelper *chichHelper; + // // XCHVWAP ... XCHVWAPInputs chvwapInputs; @@ -1719,18 +1736,51 @@ private: chvlmInputs // ); + // + // XCHICH ... + + // + chichInputs.Default(); + + // + chichInputs.scMethod = scMethod; + chichInputs.scPeriod = scPeriod; + chichInputs.mcMethod = mcMethod; + chichInputs.mcPeriod = mcPeriod; + chichInputs.lcMethod = lcMethod; + chichInputs.lcPeriod = lcPeriod; + chichInputs.hcMethod = hcMethod; + chichInputs.hcPeriod = hcPeriod; + + // + chichInputs.showTenkanSen = false; + chichInputs.showKijunSen = false; + chichInputs.showChikouSpan = false; + chichInputs.showSenkouSpanA = false; + chichInputs.showSenkouSpanB = false; + chichInputs.showKumo = false; + + // + chichInputs.showCurrent = false; + chichInputs.showShort = false; + chichInputs.showMedium = false; + chichInputs.showLong = false; + chichInputs.showHind = false; + + // + chichHelper = new XSCXCHICHHelper(); + chichHelper.Init( + mSymbol, + mPeriod, + chichInputs // + ); + // // XCHVWAP ... // chvwapInputs.Default(); - // - chvwapInputs.showShort = false; - chvwapInputs.showMedium = false; - chvwapInputs.showLong = false; - chvwapInputs.showHind = false; - // chvwapInputs.scMethod = scMethod; chvwapInputs.scPeriod = scPeriod; @@ -1741,6 +1791,12 @@ private: chvwapInputs.hcMethod = hcMethod; chvwapInputs.hcPeriod = hcPeriod; + // + chvwapInputs.showShort = false; + chvwapInputs.showMedium = false; + chvwapInputs.showLong = false; + chvwapInputs.showHind = false; + // chvwapHelper = new XSCXCHVWAPHelper(); chvwapHelper.Init(