4949 lines
149 KiB
Plaintext
4949 lines
149 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Helper Class Library
|
|
// ----------------------------------------------
|
|
// Name: XCX121Helper
|
|
// Description: provides all Indicator
|
|
// Helper requirements ...
|
|
//
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
// Imports ...
|
|
#include "../Helpers/x-saherelm.x121.x3ma.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xatr.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xcc.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xche.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xdelta.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xdon.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xhk.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xich.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xmas.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xpv.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xstr.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xvolume.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xvwap.helper.mq5"
|
|
|
|
//
|
|
// Inputs ...
|
|
struct X121Inputs
|
|
{
|
|
//
|
|
// Props ...
|
|
bool showRSI;
|
|
X121XCCInputs xccInputs;
|
|
X121XPVInputs xpvInputs;
|
|
X121XHKInputs xhkInputs;
|
|
X121XICHInputs xichInputs;
|
|
X121XMASInputs xmasInputs;
|
|
X121XATRInputs xatrInputs;
|
|
X121XSTRInputs xstrInputs;
|
|
X121XCHEInputs xcheInputs;
|
|
X121XDONInputs xdonInputs;
|
|
X121X3MAInputs x3maInputs;
|
|
X121XVWAPInputs xvwapInputs;
|
|
X121XDELTAInputs xdeltaInputs;
|
|
X121XVOLUMEInputs xvolumeInputs;
|
|
|
|
//
|
|
// Constructor ...
|
|
X121Inputs()
|
|
{
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Cleaning Up ...
|
|
*/
|
|
void Clean()
|
|
{
|
|
//
|
|
xccInputs.Clean();
|
|
xpvInputs.Clean();
|
|
xhkInputs.Clean();
|
|
xichInputs.Clean();
|
|
xmasInputs.Clean();
|
|
xatrInputs.Clean();
|
|
xstrInputs.Clean();
|
|
xcheInputs.Clean();
|
|
xdonInputs.Clean();
|
|
xvwapInputs.Clean();
|
|
xdeltaInputs.Clean();
|
|
xvolumeInputs.Clean();
|
|
|
|
//
|
|
ZeroMemory(this);
|
|
}
|
|
|
|
/**
|
|
* Set Default Values ...
|
|
*/
|
|
void Default()
|
|
{
|
|
//
|
|
xccInputs.Default();
|
|
xpvInputs.Default();
|
|
xhkInputs.Default();
|
|
xichInputs.Default();
|
|
xmasInputs.Default();
|
|
xatrInputs.Default();
|
|
xstrInputs.Default();
|
|
xcheInputs.Default();
|
|
xdonInputs.Default();
|
|
x3maInputs.Default();
|
|
xvwapInputs.Default();
|
|
xdeltaInputs.Default();
|
|
xvolumeInputs.Default();
|
|
}
|
|
|
|
/**
|
|
* Validate ...
|
|
*
|
|
* @return ( bool )
|
|
*/
|
|
bool IsValid()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
xccInputs.IsValid() &&
|
|
xpvInputs.IsValid() &&
|
|
xhkInputs.IsValid() &&
|
|
xichInputs.IsValid() &&
|
|
xmasInputs.IsValid() &&
|
|
xatrInputs.IsValid() &&
|
|
xstrInputs.IsValid() &&
|
|
xcheInputs.IsValid() &&
|
|
xdonInputs.IsValid() &&
|
|
xvwapInputs.IsValid() &&
|
|
xdeltaInputs.IsValid() &&
|
|
xvolumeInputs.IsValid()
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Extract Max Input Length ...
|
|
*
|
|
* @return ( int )
|
|
*/
|
|
int Max()
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
int xpvMax = xpvInputs.Max();
|
|
int xhkMax = xhkInputs.Max();
|
|
int xmasMax = xmasInputs.Max();
|
|
int xatrMax = xatrInputs.Max();
|
|
int xstrMax = xstrInputs.Max();
|
|
int xcheMax = xcheInputs.Max();
|
|
int xdonMax = xdonInputs.Max();
|
|
int xichMax = xichInputs.Max();
|
|
int xvwapMax = xvwapInputs.Max();
|
|
int xdeltaMax = xdeltaInputs.Max();
|
|
int xvolumeMax = xvolumeInputs.Max();
|
|
|
|
//
|
|
result = MathMax(xpvMax, xhkMax);
|
|
result = MathMax(result, xmasMax);
|
|
result = MathMax(result, xatrMax);
|
|
result = MathMax(result, xstrMax);
|
|
result = MathMax(result, xcheMax);
|
|
result = MathMax(result, xdonMax);
|
|
result = MathMax(result, xichMax);
|
|
result = MathMax(result, xvwapMax);
|
|
result = MathMax(result, xdeltaMax);
|
|
result = MathMax(result, xvolumeMax);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
};
|
|
|
|
//
|
|
// Conditions ...
|
|
struct X121Conditions
|
|
{
|
|
//
|
|
// Common ...
|
|
string symbol;
|
|
ENUM_TIMEFRAMES period;
|
|
datetime time;
|
|
|
|
//
|
|
// Buffers ...
|
|
double maBuffer[];
|
|
double rsiBuffer[];
|
|
double atrBuffer[];
|
|
double strBuffer[];
|
|
double le1Buffer[];
|
|
double se1Buffer[];
|
|
double le2Buffer[];
|
|
double se2Buffer[];
|
|
double sarBuffer[];
|
|
double cHHBuffer[];
|
|
double cLLBuffer[];
|
|
double sHHBuffer[];
|
|
double sLLBuffer[];
|
|
double mHHBuffer[];
|
|
double mLLBuffer[];
|
|
double lHHBuffer[];
|
|
double lLLBuffer[];
|
|
double hHHBuffer[];
|
|
double hLLBuffer[];
|
|
double upTBuffer[];
|
|
double adxBuffer[];
|
|
double adxPBuffer[];
|
|
double adxMBuffer[];
|
|
long volumeBuffer[];
|
|
double peaksBuffer[];
|
|
double valesBuffer[];
|
|
double strUpBuffer[];
|
|
double downTBuffer[];
|
|
double deltaBuffer[];
|
|
double masMidBuffer[];
|
|
double deltaMaBuffer[];
|
|
double strDownBuffer[];
|
|
double vwapMidBuffer[];
|
|
double upTrendBuffer[];
|
|
double x3maMidBuffer[];
|
|
double masUpperBuffer[];
|
|
double masLowerBuffer[];
|
|
double kijunSenBuffer[];
|
|
double le1StartBuffer[];
|
|
double se1StartBuffer[];
|
|
double le2StartBuffer[];
|
|
double se2StartBuffer[];
|
|
double strPriceBuffer[];
|
|
double atrUpperBuffer[];
|
|
double atrLowerBuffer[];
|
|
double strStateBuffer[];
|
|
double vwapFastBuffer[];
|
|
double vwapSlowBuffer[];
|
|
double xhkSMLowBuffer[];
|
|
double x3maFastBuffer[];
|
|
double x3maSlowBuffer[];
|
|
double supportsBuffer[];
|
|
double tenkanSenBuffer[];
|
|
double downTrendBuffer[];
|
|
double vwapPriceBuffer[];
|
|
double xhkRawLowBuffer[];
|
|
double xhkSMOpenBuffer[];
|
|
double xhkSMHighBuffer[];
|
|
double deltaStateBuffer[];
|
|
double xhkRawOpenBuffer[];
|
|
double xhkRawHighBuffer[];
|
|
double xhkSMCloseBuffer[];
|
|
double vwapVolumeBuffer[];
|
|
double chikouSpanBuffer[];
|
|
double senkouSpanABuffer[];
|
|
double senkouSpanBBuffer[];
|
|
double peaksGoldenBuffer[];
|
|
double valesGoldenBuffer[];
|
|
double xhkRawCloseBuffer[];
|
|
double atrUpperRawBuffer[];
|
|
double atrLowerRawBuffer[];
|
|
double donLowUpperBuffer[];
|
|
double donLowLowerBuffer[];
|
|
double resistancesBuffer[];
|
|
double vwapMidStateBuffer[];
|
|
double donOpenUpperBuffer[];
|
|
double donOpenLowerBuffer[];
|
|
double donHighUpperBuffer[];
|
|
double donHighLowerBuffer[];
|
|
double x3maMidStateBuffer[];
|
|
double bullishVolumeBuffer[];
|
|
double bearishVolumeBuffer[];
|
|
double fractalsUpperBuffer[];
|
|
double fractalsLowerBuffer[];
|
|
double vwapFastStateBuffer[];
|
|
double vwapSlowStateBuffer[];
|
|
double donCloseUpperBuffer[];
|
|
double donCloseLowerBuffer[];
|
|
double x3maFastStateBuffer[];
|
|
double x3maSlowStateBuffer[];
|
|
double bullishVolumeMaBuffer[];
|
|
double bearishVolumeMaBuffer[];
|
|
|
|
//
|
|
double rsiSlope;
|
|
double strSlope;
|
|
double atrUpperSlope;
|
|
double atrLowerSlope;
|
|
double vwapFastSlope;
|
|
double vwapMidSlope;
|
|
double vwapSlowSlope;
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
bool isRsiSlopeBullish;
|
|
bool isStrSlopeBullish;
|
|
bool isAtrUpperSlopeBullish;
|
|
bool isAtrLowerSlopeBullish;
|
|
bool isVwapFastSlopeBullish;
|
|
bool isVwapMidSlopeBullish;
|
|
bool isVwapSlowSlopeBullish;
|
|
|
|
//
|
|
bool isRsiSlopeBearish;
|
|
bool isStrSlopeBearish;
|
|
bool isAtrUpperSlopeBearish;
|
|
bool isAtrLowerSlopeBearish;
|
|
bool isVwapFastSlopeBearish;
|
|
bool isVwapMidSlopeBearish;
|
|
bool isVwapSlowSlopeBearish;
|
|
|
|
//
|
|
bool isRsiOverSold;
|
|
bool isRsiOverBought;
|
|
bool isRsiCrossedOverOverSold;
|
|
bool isRsiCrossedUnderOverSold;
|
|
bool isRsiCrossedOverOverBought;
|
|
bool isRsiCrossedUnderOverBought;
|
|
|
|
//
|
|
bool isClosedOverAtrUpper;
|
|
bool isClosedOverAtrLower;
|
|
bool isClosedUnderAtrUpper;
|
|
bool isClosedUnderAtrLower;
|
|
|
|
//
|
|
bool isSarBullish;
|
|
bool isSarBearish;
|
|
bool isSarSwitchedToBullish;
|
|
bool isSarSwitchedToBearish;
|
|
|
|
//
|
|
bool isNewPeak;
|
|
bool isNewPeakOverLast;
|
|
bool isNewPeakUnderLast;
|
|
|
|
//
|
|
bool isNewVale;
|
|
bool isNewValeOverLast;
|
|
bool isNewValeUnderLast;
|
|
|
|
//
|
|
bool isStrBullish;
|
|
bool isStrBearish;
|
|
bool isStrSwitchedToBullish;
|
|
bool isStrSwitchedToBearish;
|
|
|
|
//
|
|
bool isChe1Bullish;
|
|
bool isChe1Bearish;
|
|
bool isChe1SwitchedToBullish;
|
|
bool isChe1SwitchedToBearish;
|
|
|
|
//
|
|
bool isChe2Bullish;
|
|
bool isChe2Bearish;
|
|
bool isChe2SwitchedToBullish;
|
|
bool isChe2SwitchedToBearish;
|
|
|
|
//
|
|
bool isCheBullish;
|
|
bool isCheBearish;
|
|
bool isCheSwitchedToBullish;
|
|
bool isCheSwitchedToBearish;
|
|
|
|
//
|
|
bool isVWapMidBullish;
|
|
bool isVWapMidBearish;
|
|
bool isVWapFastBullish;
|
|
bool isVWapFastBearish;
|
|
bool isVWapMidNeutural;
|
|
bool isVWapSlowBullish;
|
|
bool isVWapSlowBearish;
|
|
bool isVWapFastOverMid;
|
|
bool isVWapMidOverSlow;
|
|
bool isVWapFastNeutural;
|
|
bool isVWapSlowNeutural;
|
|
bool isVWapFastUnderMid;
|
|
bool isVWapMidUnderSlow;
|
|
bool isVWapBullishState;
|
|
bool isVWapBearishState;
|
|
bool isVWapNeuturalState;
|
|
bool isVWapBullishOrdered;
|
|
bool isVWapBearishOrdered;
|
|
bool isVWapSwitchedToBullishState;
|
|
bool isVWapSwitchedToBearishState;
|
|
bool isVWapSwitchedToNeuturalState;
|
|
bool isVWapSwitchedToBullishOrdered;
|
|
bool isVWapSwitchedToBearishOrdered;
|
|
|
|
//
|
|
bool isX3MaMidBullish;
|
|
bool isX3MaMidBearish;
|
|
bool isX3MaFastBullish;
|
|
bool isX3MaFastBearish;
|
|
bool isX3MaMidNeutural;
|
|
bool isX3MaSlowBullish;
|
|
bool isX3MaSlowBearish;
|
|
bool isX3MaFastOverMid;
|
|
bool isX3MaMidOverSlow;
|
|
bool isX3MaFastNeutural;
|
|
bool isX3MaSlowNeutural;
|
|
bool isX3MaFastUnderMid;
|
|
bool isX3MaMidUnderSlow;
|
|
bool isX3MaBullishState;
|
|
bool isX3MaBearishState;
|
|
bool isX3MaNeuturalState;
|
|
bool isX3MaBullishOrdered;
|
|
bool isX3MaBearishOrdered;
|
|
bool isX3MaSwitchedToBullishState;
|
|
bool isX3MaSwitchedToBearishState;
|
|
bool isX3MaSwitchedToNeuturalState;
|
|
bool isX3MaSwitchedToBullishOrdered;
|
|
bool isX3MaSwitchedToBearishOrdered;
|
|
|
|
//
|
|
bool isSMHKBullish;
|
|
bool isRawHKBullish;
|
|
bool isSMHKBearish;
|
|
bool isRawHKBearish;
|
|
bool isClosedOverSMHK;
|
|
bool isClosedUnderSMHK;
|
|
bool isClosedOverRawHK;
|
|
bool isClosedUnderRawHK;
|
|
bool isRawHKClosedOverSMHK;
|
|
bool isRawHKClosedUnderSMHK;
|
|
bool isSMHKSwitchedToBullish;
|
|
bool isSMHKSwitchedToBearish;
|
|
bool isRawHKSwitchedToBearish;
|
|
bool isRawHKSwitchedToBullish;
|
|
|
|
//
|
|
// XICH ...
|
|
|
|
//
|
|
bool isSenkouSpanAOverB;
|
|
bool isSenkouSpanAUnderB;
|
|
bool isTenkanSenOverKijunSen;
|
|
bool isTenkanSenUnderKijunSen;
|
|
bool isSenkouSpanACrossedOverB;
|
|
bool isSenkouSpanACrossedUnderB;
|
|
bool isTenkanSenCrossedOverKijunSen;
|
|
bool isTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
// XDELTA ...
|
|
|
|
//
|
|
bool isDeltaBullish;
|
|
bool isDeltaBearish;
|
|
bool isDeltaSwitchedToBullish;
|
|
bool isDeltaSwitchedToBearish;
|
|
|
|
//
|
|
bool isDeltaOverMa;
|
|
bool isDeltaUnderMa;
|
|
bool isDeltaCrossedOverMa;
|
|
bool isDeltaCrossedUnderMa;
|
|
|
|
//
|
|
// XVOLUME ...
|
|
|
|
bool isBullishVolumeOverMa;
|
|
bool isBullishVolumeCrossedOverMa;
|
|
|
|
//
|
|
bool isBullishVolumeUnderMa;
|
|
bool isBullishVolumeCrossedUnderMa;
|
|
|
|
//
|
|
bool isBullishVolumeIncreased;
|
|
bool isBullishVolumeSwitchedToIncreased;
|
|
|
|
//
|
|
bool isBullishVolumeDecreased;
|
|
bool isBullishVolumeSwitchedToDecreased;
|
|
|
|
//
|
|
bool isBearishVolumeOverMa;
|
|
bool isBearishVolumeCrossedOverMa;
|
|
|
|
//
|
|
bool isBearishVolumeUnderMa;
|
|
bool isBearishVolumeCrossedUnderMa;
|
|
|
|
//
|
|
bool isBearishVolumeIncreased;
|
|
bool isBearishVolumeSwitchedToIncreased;
|
|
|
|
//
|
|
bool isBearishVolumeDecreased;
|
|
bool isBearishVolumeSwitchedToDecreased;
|
|
|
|
//
|
|
bool isVolumeSwitchedToBullish;
|
|
bool isVolumeSwitchedToBearish;
|
|
|
|
//
|
|
bool isBullishVolumeMaOverBearishVolumeMa;
|
|
bool isBullishVolumeMaUnderBearishVolumeMa;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
double cheMin;
|
|
double cheMax;
|
|
double x3maMin;
|
|
double x3maMax;
|
|
double vwapMin;
|
|
double vwapMax;
|
|
double senkouMax;
|
|
double senkouMin;
|
|
double tenKijMax;
|
|
double tenKijMin;
|
|
|
|
//
|
|
bool isSarIncreased;
|
|
bool isSarDecreased;
|
|
bool isX3MaFatsOverMid;
|
|
bool isSarEqualsToPeak;
|
|
bool isSarEqualsToVale;
|
|
bool isStrEqualsToPeak;
|
|
bool isStrEqualsToVale;
|
|
bool isX3MaFatsUnderMid;
|
|
bool isX3MaFatsOverSlow;
|
|
bool isAtrUpperOverPeak;
|
|
bool isPeakOverAtrUpper;
|
|
bool isStrUpperOverPeak;
|
|
bool isStrLowerOverVale;
|
|
bool isClosedOverCheMin;
|
|
bool isClosedOverCheMax;
|
|
bool isX3MaFatsUnderSlow;
|
|
bool isAtrLowerUnderVale;
|
|
bool isClosedOverX3MaMin;
|
|
bool isClosedOverX3MaMax;
|
|
bool isValeUnderAtrLower;
|
|
bool isStrUpperUnderPeak;
|
|
bool isStrLowerUnderVale;
|
|
bool isClosedUnderCheMin;
|
|
bool isClosedUnderCheMax;
|
|
bool isClosedOverVWapMin;
|
|
bool isClosedOverVWapMax;
|
|
bool isClosedUnderX3MaMin;
|
|
bool isClosedUnderX3MaMax;
|
|
bool isStrCrossedOverVale;
|
|
bool isSarCrossedOverVale;
|
|
bool isClosedUnderVWapMin;
|
|
bool isClosedUnderVWapMax;
|
|
bool isX3MaFatsOverMidPrev;
|
|
bool isSarCrossedUnderPeak;
|
|
bool isStrCrossedUnderPeak;
|
|
bool isNewPeakOverAtrUpper;
|
|
bool isX3MaFatsUnderMidPrev;
|
|
bool isX3MaFatsOverSlowPrev;
|
|
bool isAtrUpperEqualsToPeak;
|
|
bool isAtrLowerEqualsToVale;
|
|
bool isStrUpperOverAtrUpper;
|
|
bool isStrLowerOverAtrLower;
|
|
bool isNewValeUnderAtrLower;
|
|
bool isAtrUpperCrossedUpPeak;
|
|
bool isAtrLowerCrossedUpVale;
|
|
bool isStrUpperUnderAtrUpper;
|
|
bool isStrLowerUnderAtrLower;
|
|
bool isX3MaFatsUnderSlowPrev;
|
|
bool isX3MaFastCrossedOverMid;
|
|
bool isVWapFastCrossedOverMid;
|
|
bool isX3MaFastCrossedUnderMid;
|
|
bool isX3MaFastCrossedOverSlow;
|
|
bool isAtrUpperCrossedDownPeak;
|
|
bool isAtrLowerCrossedDownVale;
|
|
bool isStrLowerOverDonLowLower;
|
|
bool isVWapFastCrossedUnderMid;
|
|
bool isStrUpperCrossedOverPeak;
|
|
bool isStrLowerCrossedOverVale;
|
|
bool isDonLowLowerEqualsToVale;
|
|
bool isVWapFastCrossedOverSlow;
|
|
bool isX3MaFastCrossedUnderSlow;
|
|
bool isStrUpperOverDonHighUpper;
|
|
bool isStrLowerUnderDonLowLower;
|
|
bool isVWapFastCrossedUnderSlow;
|
|
bool isStrUpperCrossedUnderPeak;
|
|
bool isStrLowerCrossedUnderVale;
|
|
bool isDonHighUpperEqualsToPeak;
|
|
bool isStrUpperUnderDonHighUpper;
|
|
bool isStrUpperCrossedOverAtrUpper;
|
|
bool isStrLowerCrossedOverAtrLower;
|
|
bool isStrUpperCrossedUnderAtrUpper;
|
|
bool isStrLowerCrossedUnderAtrLower;
|
|
bool isStrLowerCrossedOverDonLowLower;
|
|
bool isStrUpperCrossedOverDonHighUpper;
|
|
bool isStrLowerCrossedUnderDonLowLower;
|
|
bool isStrUpperCrossedUnderDonHighUpper;
|
|
|
|
//
|
|
// Constructor ...
|
|
X121Conditions()
|
|
{
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Cleaning Up ...
|
|
*/
|
|
void Clean()
|
|
{
|
|
//
|
|
// Commons ...
|
|
symbol = NULL;
|
|
period = NULL;
|
|
time = NULL;
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Clean(maBuffer);
|
|
Clean(rsiBuffer);
|
|
Clean(atrBuffer);
|
|
Clean(strBuffer);
|
|
Clean(le1Buffer);
|
|
Clean(se1Buffer);
|
|
Clean(le2Buffer);
|
|
Clean(se2Buffer);
|
|
Clean(sarBuffer);
|
|
Clean(cHHBuffer);
|
|
Clean(cLLBuffer);
|
|
Clean(sHHBuffer);
|
|
Clean(sLLBuffer);
|
|
Clean(mHHBuffer);
|
|
Clean(mLLBuffer);
|
|
Clean(lHHBuffer);
|
|
Clean(lLLBuffer);
|
|
Clean(hHHBuffer);
|
|
Clean(hLLBuffer);
|
|
Clean(upTBuffer);
|
|
Clean(adxBuffer);
|
|
Clean(adxPBuffer);
|
|
Clean(adxMBuffer);
|
|
Clean(peaksBuffer);
|
|
Clean(valesBuffer);
|
|
Clean(strUpBuffer);
|
|
Clean(downTBuffer);
|
|
Clean(deltaBuffer);
|
|
Clean(volumeBuffer);
|
|
Clean(masMidBuffer);
|
|
Clean(strDownBuffer);
|
|
Clean(vwapMidBuffer);
|
|
Clean(upTrendBuffer);
|
|
Clean(x3maMidBuffer);
|
|
Clean(deltaMaBuffer);
|
|
Clean(masUpperBuffer);
|
|
Clean(masLowerBuffer);
|
|
Clean(le1StartBuffer);
|
|
Clean(se1StartBuffer);
|
|
Clean(le2StartBuffer);
|
|
Clean(se2StartBuffer);
|
|
Clean(strPriceBuffer);
|
|
Clean(atrUpperBuffer);
|
|
Clean(atrLowerBuffer);
|
|
Clean(strStateBuffer);
|
|
Clean(vwapFastBuffer);
|
|
Clean(vwapSlowBuffer);
|
|
Clean(xhkSMLowBuffer);
|
|
Clean(x3maFastBuffer);
|
|
Clean(x3maSlowBuffer);
|
|
Clean(supportsBuffer);
|
|
Clean(kijunSenBuffer);
|
|
Clean(tenkanSenBuffer);
|
|
Clean(downTrendBuffer);
|
|
Clean(vwapPriceBuffer);
|
|
Clean(xhkRawLowBuffer);
|
|
Clean(xhkSMOpenBuffer);
|
|
Clean(xhkSMHighBuffer);
|
|
Clean(chikouSpanBuffer);
|
|
Clean(xhkRawOpenBuffer);
|
|
Clean(xhkRawHighBuffer);
|
|
Clean(xhkSMCloseBuffer);
|
|
Clean(vwapVolumeBuffer);
|
|
Clean(deltaStateBuffer);
|
|
Clean(senkouSpanABuffer);
|
|
Clean(senkouSpanBBuffer);
|
|
Clean(peaksGoldenBuffer);
|
|
Clean(valesGoldenBuffer);
|
|
Clean(xhkRawCloseBuffer);
|
|
Clean(atrUpperRawBuffer);
|
|
Clean(atrLowerRawBuffer);
|
|
Clean(donLowUpperBuffer);
|
|
Clean(donLowLowerBuffer);
|
|
Clean(resistancesBuffer);
|
|
Clean(vwapMidStateBuffer);
|
|
Clean(donOpenUpperBuffer);
|
|
Clean(donOpenLowerBuffer);
|
|
Clean(donHighUpperBuffer);
|
|
Clean(donHighLowerBuffer);
|
|
Clean(x3maMidStateBuffer);
|
|
Clean(bullishVolumeBuffer);
|
|
Clean(bearishVolumeBuffer);
|
|
Clean(fractalsUpperBuffer);
|
|
Clean(fractalsLowerBuffer);
|
|
Clean(vwapFastStateBuffer);
|
|
Clean(vwapSlowStateBuffer);
|
|
Clean(donCloseUpperBuffer);
|
|
Clean(donCloseLowerBuffer);
|
|
Clean(x3maFastStateBuffer);
|
|
Clean(x3maSlowStateBuffer);
|
|
Clean(bullishVolumeMaBuffer);
|
|
Clean(bearishVolumeMaBuffer);
|
|
|
|
//
|
|
ArraySetAsSeries(maBuffer, true);
|
|
ArraySetAsSeries(rsiBuffer, true);
|
|
ArraySetAsSeries(atrBuffer, true);
|
|
ArraySetAsSeries(strBuffer, true);
|
|
ArraySetAsSeries(le1Buffer, true);
|
|
ArraySetAsSeries(se1Buffer, true);
|
|
ArraySetAsSeries(le2Buffer, true);
|
|
ArraySetAsSeries(se2Buffer, true);
|
|
ArraySetAsSeries(sarBuffer, true);
|
|
ArraySetAsSeries(cHHBuffer, true);
|
|
ArraySetAsSeries(cLLBuffer, true);
|
|
ArraySetAsSeries(sHHBuffer, true);
|
|
ArraySetAsSeries(sLLBuffer, true);
|
|
ArraySetAsSeries(mHHBuffer, true);
|
|
ArraySetAsSeries(mLLBuffer, true);
|
|
ArraySetAsSeries(lHHBuffer, true);
|
|
ArraySetAsSeries(lLLBuffer, true);
|
|
ArraySetAsSeries(hHHBuffer, true);
|
|
ArraySetAsSeries(hLLBuffer, true);
|
|
ArraySetAsSeries(upTBuffer, true);
|
|
ArraySetAsSeries(adxBuffer, true);
|
|
ArraySetAsSeries(adxPBuffer, true);
|
|
ArraySetAsSeries(adxMBuffer, true);
|
|
ArraySetAsSeries(peaksBuffer, true);
|
|
ArraySetAsSeries(valesBuffer, true);
|
|
ArraySetAsSeries(strUpBuffer, true);
|
|
ArraySetAsSeries(downTBuffer, true);
|
|
ArraySetAsSeries(deltaBuffer, true);
|
|
ArraySetAsSeries(volumeBuffer, true);
|
|
ArraySetAsSeries(masMidBuffer, true);
|
|
ArraySetAsSeries(deltaMaBuffer, true);
|
|
ArraySetAsSeries(strDownBuffer, true);
|
|
ArraySetAsSeries(vwapMidBuffer, true);
|
|
ArraySetAsSeries(upTrendBuffer, true);
|
|
ArraySetAsSeries(x3maMidBuffer, true);
|
|
ArraySetAsSeries(masUpperBuffer, true);
|
|
ArraySetAsSeries(masLowerBuffer, true);
|
|
ArraySetAsSeries(le1StartBuffer, true);
|
|
ArraySetAsSeries(se1StartBuffer, true);
|
|
ArraySetAsSeries(le2StartBuffer, true);
|
|
ArraySetAsSeries(se2StartBuffer, true);
|
|
ArraySetAsSeries(strPriceBuffer, true);
|
|
ArraySetAsSeries(atrUpperBuffer, true);
|
|
ArraySetAsSeries(atrLowerBuffer, true);
|
|
ArraySetAsSeries(strStateBuffer, true);
|
|
ArraySetAsSeries(vwapFastBuffer, true);
|
|
ArraySetAsSeries(vwapSlowBuffer, true);
|
|
ArraySetAsSeries(xhkSMLowBuffer, true);
|
|
ArraySetAsSeries(x3maFastBuffer, true);
|
|
ArraySetAsSeries(x3maSlowBuffer, true);
|
|
ArraySetAsSeries(supportsBuffer, true);
|
|
ArraySetAsSeries(kijunSenBuffer, true);
|
|
ArraySetAsSeries(tenkanSenBuffer, true);
|
|
ArraySetAsSeries(downTrendBuffer, true);
|
|
ArraySetAsSeries(vwapPriceBuffer, true);
|
|
ArraySetAsSeries(xhkRawLowBuffer, true);
|
|
ArraySetAsSeries(xhkSMOpenBuffer, true);
|
|
ArraySetAsSeries(xhkSMHighBuffer, true);
|
|
ArraySetAsSeries(deltaStateBuffer, true);
|
|
ArraySetAsSeries(chikouSpanBuffer, true);
|
|
ArraySetAsSeries(xhkRawOpenBuffer, true);
|
|
ArraySetAsSeries(xhkRawHighBuffer, true);
|
|
ArraySetAsSeries(xhkSMCloseBuffer, true);
|
|
ArraySetAsSeries(vwapVolumeBuffer, true);
|
|
ArraySetAsSeries(senkouSpanABuffer, true);
|
|
ArraySetAsSeries(senkouSpanBBuffer, true);
|
|
ArraySetAsSeries(peaksGoldenBuffer, true);
|
|
ArraySetAsSeries(valesGoldenBuffer, true);
|
|
ArraySetAsSeries(xhkRawCloseBuffer, true);
|
|
ArraySetAsSeries(atrUpperRawBuffer, true);
|
|
ArraySetAsSeries(atrLowerRawBuffer, true);
|
|
ArraySetAsSeries(donLowUpperBuffer, true);
|
|
ArraySetAsSeries(donLowLowerBuffer, true);
|
|
ArraySetAsSeries(resistancesBuffer, true);
|
|
ArraySetAsSeries(vwapMidStateBuffer, true);
|
|
ArraySetAsSeries(donOpenUpperBuffer, true);
|
|
ArraySetAsSeries(donOpenLowerBuffer, true);
|
|
ArraySetAsSeries(donHighUpperBuffer, true);
|
|
ArraySetAsSeries(donHighLowerBuffer, true);
|
|
ArraySetAsSeries(x3maMidStateBuffer, true);
|
|
ArraySetAsSeries(bullishVolumeBuffer, true);
|
|
ArraySetAsSeries(bearishVolumeBuffer, true);
|
|
ArraySetAsSeries(fractalsUpperBuffer, true);
|
|
ArraySetAsSeries(fractalsLowerBuffer, true);
|
|
ArraySetAsSeries(vwapFastStateBuffer, true);
|
|
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
|
ArraySetAsSeries(donCloseUpperBuffer, true);
|
|
ArraySetAsSeries(donCloseLowerBuffer, true);
|
|
ArraySetAsSeries(x3maFastStateBuffer, true);
|
|
ArraySetAsSeries(x3maSlowStateBuffer, true);
|
|
ArraySetAsSeries(bullishVolumeMaBuffer, true);
|
|
ArraySetAsSeries(bearishVolumeMaBuffer, true);
|
|
|
|
//
|
|
cheMin = 0;
|
|
cheMax = 0;
|
|
vwapMin = 0;
|
|
vwapMax = 0;
|
|
x3maMin = 0;
|
|
x3maMax = 0;
|
|
senkouMax = 0;
|
|
senkouMin = 0;
|
|
tenKijMax = 0;
|
|
tenKijMin = 0;
|
|
//
|
|
// Slopes ...
|
|
|
|
rsiSlope = 0;
|
|
strSlope = 0;
|
|
atrUpperSlope = 0;
|
|
atrLowerSlope = 0;
|
|
vwapFastSlope = 0;
|
|
vwapMidSlope = 0;
|
|
vwapSlowSlope = 0;
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
isRsiSlopeBullish = false;
|
|
isStrSlopeBullish = false;
|
|
isAtrUpperSlopeBullish = false;
|
|
isAtrLowerSlopeBullish = false;
|
|
isVwapFastSlopeBullish = false;
|
|
isVwapMidSlopeBullish = false;
|
|
isVwapSlowSlopeBullish = false;
|
|
|
|
//
|
|
isRsiSlopeBearish = false;
|
|
isStrSlopeBearish = false;
|
|
isAtrUpperSlopeBearish = false;
|
|
isAtrLowerSlopeBearish = false;
|
|
isVwapFastSlopeBearish = false;
|
|
isVwapMidSlopeBearish = false;
|
|
isVwapSlowSlopeBearish = false;
|
|
|
|
//
|
|
// RSI ...
|
|
|
|
//
|
|
isRsiOverBought = false;
|
|
isRsiCrossedOverOverBought = false;
|
|
isRsiCrossedUnderOverBought = false;
|
|
|
|
//
|
|
isRsiOverSold = false;
|
|
isRsiCrossedUnderOverSold = false;
|
|
isRsiCrossedOverOverSold = false;
|
|
|
|
//
|
|
// ATR ...
|
|
|
|
//
|
|
isClosedOverAtrUpper = false;
|
|
isClosedOverAtrLower = false;
|
|
isClosedUnderAtrUpper = false;
|
|
isClosedUnderAtrLower = false;
|
|
|
|
//
|
|
// DON ...
|
|
|
|
//
|
|
// SAR ...
|
|
|
|
//
|
|
isSarBullish = false;
|
|
isSarBearish = false;
|
|
isSarSwitchedToBullish = false;
|
|
isSarSwitchedToBearish = false;
|
|
|
|
//
|
|
// PV ...
|
|
|
|
//
|
|
isNewPeak = false;
|
|
isNewPeakOverLast = false;
|
|
isNewPeakUnderLast = false;
|
|
|
|
//
|
|
isNewVale = false;
|
|
isNewValeOverLast = false;
|
|
isNewValeUnderLast = false;
|
|
|
|
//
|
|
// STR ...
|
|
|
|
//
|
|
isStrBullish = false;
|
|
isStrBearish = false;
|
|
isStrSwitchedToBullish = false;
|
|
isStrSwitchedToBearish = false;
|
|
|
|
//
|
|
// VWAP ...
|
|
isVWapMidBullish = false;
|
|
isVWapMidBearish = false;
|
|
isVWapMidNeutural = false;
|
|
isVWapSlowBullish = false;
|
|
isVWapSlowBearish = false;
|
|
isVWapFastBullish = false;
|
|
isVWapFastBearish = false;
|
|
isVWapFastOverMid = false;
|
|
isVWapMidOverSlow = false;
|
|
isVWapFastNeutural = false;
|
|
isVWapSlowNeutural = false;
|
|
isVWapFastUnderMid = false;
|
|
isVWapMidUnderSlow = false;
|
|
isVWapBullishState = false;
|
|
isVWapBearishState = false;
|
|
isVWapNeuturalState = false;
|
|
isVWapBullishOrdered = false;
|
|
isVWapBearishOrdered = false;
|
|
isVWapSwitchedToBullishState = false;
|
|
isVWapSwitchedToBearishState = false;
|
|
isVWapSwitchedToNeuturalState = false;
|
|
isVWapSwitchedToBullishOrdered = false;
|
|
isVWapSwitchedToBearishOrdered = false;
|
|
|
|
//
|
|
// X3MA ...
|
|
isX3MaMidBullish = false;
|
|
isX3MaMidBearish = false;
|
|
isX3MaFastBullish = false;
|
|
isX3MaFastBearish = false;
|
|
isX3MaMidNeutural = false;
|
|
isX3MaSlowBullish = false;
|
|
isX3MaSlowBearish = false;
|
|
isX3MaFastOverMid = false;
|
|
isX3MaMidOverSlow = false;
|
|
isX3MaFastNeutural = false;
|
|
isX3MaSlowNeutural = false;
|
|
isX3MaFastUnderMid = false;
|
|
isX3MaMidUnderSlow = false;
|
|
isX3MaBullishState = false;
|
|
isX3MaBearishState = false;
|
|
isX3MaNeuturalState = false;
|
|
isX3MaBullishOrdered = false;
|
|
isX3MaBearishOrdered = false;
|
|
isX3MaSwitchedToBullishState = false;
|
|
isX3MaSwitchedToBearishState = false;
|
|
isX3MaSwitchedToNeuturalState = false;
|
|
isX3MaSwitchedToBullishOrdered = false;
|
|
isX3MaSwitchedToBearishOrdered = false;
|
|
|
|
//
|
|
// CHE ...
|
|
|
|
//
|
|
isCheBullish = false;
|
|
isCheBearish = false;
|
|
isChe1Bullish = false;
|
|
isChe1Bearish = false;
|
|
isChe2Bullish = false;
|
|
isChe2Bearish = false;
|
|
isClosedOverCheMin = false;
|
|
isClosedOverCheMax = false;
|
|
isClosedUnderCheMin = false;
|
|
isClosedUnderCheMax = false;
|
|
isCheSwitchedToBullish = false;
|
|
isCheSwitchedToBearish = false;
|
|
isChe1SwitchedToBullish = false;
|
|
isChe1SwitchedToBearish = false;
|
|
isChe2SwitchedToBullish = false;
|
|
isChe2SwitchedToBearish = false;
|
|
|
|
//
|
|
// XHK ...
|
|
isSMHKBullish = false;
|
|
isRawHKBullish = false;
|
|
isSMHKBearish = false;
|
|
isRawHKBearish = false;
|
|
isClosedOverSMHK = false;
|
|
isClosedUnderSMHK = false;
|
|
isClosedOverRawHK = false;
|
|
isClosedUnderRawHK = false;
|
|
isRawHKClosedOverSMHK = false;
|
|
isSMHKSwitchedToBearish = false;
|
|
isRawHKSwitchedToBearish = false;
|
|
isRawHKClosedUnderSMHK = false;
|
|
isSMHKSwitchedToBullish = false;
|
|
isRawHKSwitchedToBullish = false;
|
|
|
|
//
|
|
// XICH ...
|
|
isSenkouSpanAOverB = false;
|
|
isSenkouSpanAUnderB = false;
|
|
isTenkanSenOverKijunSen = false;
|
|
isTenkanSenUnderKijunSen = false;
|
|
isSenkouSpanACrossedOverB = false;
|
|
isSenkouSpanACrossedUnderB = false;
|
|
isTenkanSenCrossedOverKijunSen = false;
|
|
isTenkanSenCrossedUnderKijunSen = false;
|
|
|
|
//
|
|
// XDELTA ...
|
|
|
|
//
|
|
isDeltaBullish = false;
|
|
isDeltaBearish = false;
|
|
isDeltaSwitchedToBullish = false;
|
|
isDeltaSwitchedToBearish = false;
|
|
|
|
//
|
|
isDeltaOverMa = false;
|
|
isDeltaUnderMa = false;
|
|
isDeltaCrossedOverMa = false;
|
|
isDeltaCrossedUnderMa = false;
|
|
|
|
//
|
|
// XVOLUME ...
|
|
|
|
//
|
|
isBullishVolumeOverMa = false;
|
|
isBullishVolumeCrossedOverMa = false;
|
|
|
|
//
|
|
isBullishVolumeUnderMa = false;
|
|
isBullishVolumeCrossedUnderMa = false;
|
|
|
|
//
|
|
isBullishVolumeIncreased = false;
|
|
isBullishVolumeSwitchedToIncreased = false;
|
|
|
|
//
|
|
isBullishVolumeDecreased = false;
|
|
isBullishVolumeSwitchedToDecreased = false;
|
|
|
|
//
|
|
isBearishVolumeOverMa = false;
|
|
isBearishVolumeCrossedOverMa = false;
|
|
|
|
//
|
|
isBearishVolumeUnderMa = false;
|
|
isBearishVolumeCrossedUnderMa = false;
|
|
|
|
//
|
|
isBearishVolumeIncreased = false;
|
|
isBearishVolumeSwitchedToIncreased = false;
|
|
|
|
//
|
|
isBearishVolumeDecreased = false;
|
|
isBearishVolumeSwitchedToDecreased = false;
|
|
|
|
//
|
|
isVolumeSwitchedToBullish = false;
|
|
isVolumeSwitchedToBearish = false;
|
|
|
|
//
|
|
isBullishVolumeMaOverBearishVolumeMa = false;
|
|
isBullishVolumeMaUnderBearishVolumeMa = false;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
isSarIncreased = false;
|
|
isSarDecreased = false;
|
|
isX3MaFatsOverMid = false;
|
|
isSarEqualsToPeak = false;
|
|
isSarEqualsToVale = false;
|
|
isStrEqualsToPeak = false;
|
|
isStrEqualsToVale = false;
|
|
isX3MaFatsUnderMid = false;
|
|
isX3MaFatsOverSlow = false;
|
|
isAtrUpperOverPeak = false;
|
|
isPeakOverAtrUpper = false;
|
|
isStrUpperOverPeak = false;
|
|
isStrLowerOverVale = false;
|
|
isClosedOverCheMin = false;
|
|
isClosedOverCheMax = false;
|
|
isX3MaFatsUnderSlow = false;
|
|
isAtrLowerUnderVale = false;
|
|
isClosedOverX3MaMin = false;
|
|
isClosedOverX3MaMax = false;
|
|
isValeUnderAtrLower = false;
|
|
isStrUpperUnderPeak = false;
|
|
isStrLowerUnderVale = false;
|
|
isClosedUnderCheMin = false;
|
|
isClosedUnderCheMax = false;
|
|
isClosedOverVWapMin = false;
|
|
isClosedOverVWapMax = false;
|
|
isClosedUnderX3MaMin = false;
|
|
isClosedUnderX3MaMax = false;
|
|
isStrCrossedOverVale = false;
|
|
isSarCrossedOverVale = false;
|
|
isClosedUnderVWapMin = false;
|
|
isClosedUnderVWapMax = false;
|
|
isX3MaFatsOverMidPrev = false;
|
|
isSarCrossedUnderPeak = false;
|
|
isStrCrossedUnderPeak = false;
|
|
isNewPeakOverAtrUpper = false;
|
|
isX3MaFatsUnderMidPrev = false;
|
|
isX3MaFatsOverSlowPrev = false;
|
|
isAtrUpperEqualsToPeak = false;
|
|
isAtrLowerEqualsToVale = false;
|
|
isStrUpperOverAtrUpper = false;
|
|
isStrLowerOverAtrLower = false;
|
|
isNewValeUnderAtrLower = false;
|
|
isAtrUpperCrossedUpPeak = false;
|
|
isAtrLowerCrossedUpVale = false;
|
|
isStrUpperUnderAtrUpper = false;
|
|
isStrLowerUnderAtrLower = false;
|
|
isX3MaFatsUnderSlowPrev = false;
|
|
isX3MaFastCrossedOverMid = false;
|
|
isVWapFastCrossedOverMid = false;
|
|
isX3MaFastCrossedUnderMid = false;
|
|
isX3MaFastCrossedOverSlow = false;
|
|
isAtrUpperCrossedDownPeak = false;
|
|
isAtrLowerCrossedDownVale = false;
|
|
isStrLowerOverDonLowLower = false;
|
|
isVWapFastCrossedUnderMid = false;
|
|
isStrUpperCrossedOverPeak = false;
|
|
isStrLowerCrossedOverVale = false;
|
|
isDonLowLowerEqualsToVale = false;
|
|
isVWapFastCrossedOverSlow = false;
|
|
isX3MaFastCrossedUnderSlow = false;
|
|
isStrUpperOverDonHighUpper = false;
|
|
isStrLowerUnderDonLowLower = false;
|
|
isVWapFastCrossedUnderSlow = false;
|
|
isStrUpperCrossedUnderPeak = false;
|
|
isStrLowerCrossedUnderVale = false;
|
|
isDonHighUpperEqualsToPeak = false;
|
|
isStrUpperUnderDonHighUpper = false;
|
|
isStrUpperCrossedOverAtrUpper = false;
|
|
isStrLowerCrossedOverAtrLower = false;
|
|
isStrUpperCrossedUnderAtrUpper = false;
|
|
isStrLowerCrossedUnderAtrLower = false;
|
|
isStrLowerCrossedOverDonLowLower = false;
|
|
isStrUpperCrossedOverDonHighUpper = false;
|
|
isStrLowerCrossedUnderDonLowLower = false;
|
|
isStrUpperCrossedUnderDonHighUpper = false;
|
|
|
|
//
|
|
ZeroMemory(this);
|
|
}
|
|
|
|
/**
|
|
* Generate Conditions Scores ...
|
|
*
|
|
* @param bullishScore: Double, Directional Scores Reference ...
|
|
* @param bearishScore: Double, Directional Scores Reference ...
|
|
*/
|
|
void GenerateScore(
|
|
double &bullishScore,
|
|
double &bearishScore //
|
|
)
|
|
{
|
|
//
|
|
bullishScore = 0;
|
|
bearishScore = 0;
|
|
|
|
//
|
|
double score = 1;
|
|
double minScore = 0.5;
|
|
double highScore = 1.5;
|
|
|
|
//
|
|
// SLOPES ...
|
|
|
|
//
|
|
if (isRsiSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isAtrUpperSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isAtrLowerSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isVwapFastSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isVwapMidSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isVwapSlowSlopeBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
|
|
//
|
|
if (isRsiSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isAtrUpperSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isAtrLowerSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isVwapFastSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isVwapMidSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isVwapSlowSlopeBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
|
|
//
|
|
// COMPLEX ...
|
|
|
|
//
|
|
if (isRsiOverSold)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isRsiCrossedUnderOverSold)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
|
|
//
|
|
if (isRsiOverBought)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isRsiCrossedOverOverBought)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
|
|
//
|
|
// XSAR ...
|
|
|
|
//
|
|
if (isSarBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isSarSwitchedToBullish)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isSarBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isSarSwitchedToBearish)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
// XSTR ...
|
|
|
|
//
|
|
if (isStrBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrSwitchedToBullish)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isStrBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrSwitchedToBearish)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
// XCHE ...
|
|
|
|
//
|
|
if (isCheBullish)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isCheSwitchedToBullish)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (isChe1Bullish &&
|
|
!isCheBullish &&
|
|
!isCheSwitchedToBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isChe1SwitchedToBullish &&
|
|
!isCheBullish &&
|
|
!isCheSwitchedToBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
|
|
//
|
|
if (isCheBearish)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isCheSwitchedToBearish)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (isChe1Bearish &&
|
|
!isCheBearish &&
|
|
!isCheSwitchedToBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isChe1SwitchedToBearish &&
|
|
!isCheBearish &&
|
|
!isCheSwitchedToBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
|
|
//
|
|
// XVWAP ...
|
|
|
|
//
|
|
if (isVWapBullishState)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isVWapBullishOrdered)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isVWapSwitchedToBullishState)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (isVWapSwitchedToBullishOrdered)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (!isVWapBullishState &&
|
|
!isVWapSwitchedToBullishState)
|
|
{
|
|
//
|
|
if (isVWapFastBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isVWapSlowBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
}
|
|
if (!isVWapBullishOrdered &&
|
|
!isVWapSwitchedToBullishOrdered)
|
|
{
|
|
//
|
|
if (isVWapFastOverMid)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isVWapMidOverSlow)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
}
|
|
|
|
//
|
|
if (isVWapBearishState)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isVWapBearishOrdered)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isVWapSwitchedToBearishState)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (isVWapSwitchedToBearishOrdered)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (!isVWapBearishState &&
|
|
!isVWapSwitchedToBearishState)
|
|
{
|
|
//
|
|
if (isVWapFastBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isVWapSlowBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
}
|
|
if (!isVWapBearishOrdered &&
|
|
!isVWapSwitchedToBearishOrdered)
|
|
{
|
|
//
|
|
if (isVWapFastUnderMid)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isVWapMidUnderSlow)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
}
|
|
|
|
//
|
|
// X3MA ...
|
|
|
|
//
|
|
if (isX3MaBullishState)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isX3MaBullishOrdered)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isX3MaSwitchedToBullishState)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (isX3MaSwitchedToBullishOrdered)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (!isX3MaBullishState &&
|
|
!isX3MaSwitchedToBullishState)
|
|
{
|
|
//
|
|
if (isX3MaFastBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isX3MaSlowBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
}
|
|
if (!isX3MaBullishOrdered &&
|
|
!isX3MaSwitchedToBullishOrdered)
|
|
{
|
|
//
|
|
if (isX3MaFastOverMid)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isX3MaMidOverSlow)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
}
|
|
|
|
//
|
|
if (isX3MaBearishState)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isX3MaBearishOrdered)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isX3MaSwitchedToBearishState)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (isX3MaSwitchedToBearishOrdered)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (!isX3MaBearishState &&
|
|
!isX3MaSwitchedToBearishState)
|
|
{
|
|
//
|
|
if (isX3MaFastBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isX3MaSlowBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
}
|
|
if (!isX3MaBearishOrdered &&
|
|
!isX3MaSwitchedToBearishOrdered)
|
|
{
|
|
//
|
|
if (isX3MaFastUnderMid)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isX3MaMidUnderSlow)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
}
|
|
|
|
//
|
|
// XSMHK ...
|
|
|
|
//
|
|
if (isSMHKBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isRawHKBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isClosedOverSMHK)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isClosedOverRawHK)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isRawHKClosedOverSMHK)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isSMHKSwitchedToBullish)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (isRawHKSwitchedToBullish)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
|
|
//
|
|
if (isSMHKBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isRawHKBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isClosedUnderSMHK)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isClosedUnderRawHK)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isRawHKClosedUnderSMHK)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isSMHKSwitchedToBearish)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (isRawHKSwitchedToBullish)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
|
|
//
|
|
// XICH ...
|
|
if (isSenkouSpanAOverB)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isTenkanSenOverKijunSen)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (isTenkanSenCrossedOverKijunSen)
|
|
{
|
|
bullishScore += highScore;
|
|
}
|
|
if (isSenkouSpanAUnderB)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isTenkanSenUnderKijunSen)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
if (isTenkanSenCrossedUnderKijunSen)
|
|
{
|
|
bearishScore += highScore;
|
|
}
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
if (isSarIncreased)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isSarEqualsToVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isSarCrossedOverVale)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isAtrLowerUnderVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isValeUnderAtrLower)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isNewValeUnderAtrLower)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isAtrLowerEqualsToVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrLowerOverAtrLower)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrUpperOverAtrUpper)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isAtrLowerCrossedUpVale)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isAtrUpperCrossedUpPeak)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isStrLowerCrossedOverAtrLower)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isStrUpperCrossedOverAtrUpper)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isStrEqualsToVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrLowerOverVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrLowerUnderVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrCrossedOverVale)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isStrUpperCrossedOverPeak)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isStrLowerCrossedOverVale)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isStrLowerUnderDonLowLower)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isStrLowerCrossedOverDonLowLower)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isStrUpperCrossedOverDonHighUpper)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isClosedOverVWapMin)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isClosedOverVWapMax)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isVWapFastCrossedOverMid)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isVWapFastCrossedOverSlow)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isClosedOverX3MaMin)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isClosedOverX3MaMax)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isX3MaFastCrossedOverMid)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isX3MaFastCrossedOverSlow)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isClosedOverCheMin)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isClosedOverCheMax)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isDonLowLowerEqualsToVale)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
|
|
//
|
|
// XDELTA ...
|
|
|
|
//
|
|
if (isDeltaOverMa)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isDeltaBullish)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isDeltaCrossedOverMa)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isDeltaSwitchedToBullish)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
if (isDeltaBearish)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isDeltaUnderMa)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isDeltaCrossedUnderMa)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isDeltaSwitchedToBearish)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
// XVOLUME ...
|
|
|
|
//
|
|
if (isBullishVolumeOverMa)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isBearishVolumeUnderMa)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isBullishVolumeIncreased)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isBearishVolumeDecreased)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
if (isBullishVolumeMaOverBearishVolumeMa)
|
|
{
|
|
bullishScore += minScore;
|
|
}
|
|
|
|
//
|
|
if (isVolumeSwitchedToBullish)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isBullishVolumeCrossedOverMa)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isBearishVolumeCrossedUnderMa)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isBullishVolumeSwitchedToIncreased)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
if (isBearishVolumeSwitchedToDecreased)
|
|
{
|
|
bullishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isBearishVolumeOverMa)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isBullishVolumeUnderMa)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isBullishVolumeDecreased)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isBearishVolumeIncreased)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isBullishVolumeMaUnderBearishVolumeMa)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
|
|
//
|
|
if (isVolumeSwitchedToBearish)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isBearishVolumeCrossedOverMa)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isBullishVolumeCrossedUnderMa)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isBullishVolumeSwitchedToDecreased)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isBearishVolumeSwitchedToIncreased)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
//
|
|
//
|
|
|
|
//
|
|
if (isSarDecreased)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isSarEqualsToPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isSarCrossedUnderPeak)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isAtrUpperOverPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isPeakOverAtrUpper)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isNewPeakOverAtrUpper)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isAtrUpperEqualsToPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrLowerUnderAtrLower)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrUpperUnderAtrUpper)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isAtrLowerCrossedDownVale)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isAtrUpperCrossedDownPeak)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isStrLowerCrossedUnderAtrLower)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isStrUpperCrossedUnderAtrUpper)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isStrEqualsToPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrUpperOverPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrUpperUnderPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrCrossedUnderPeak)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isStrLowerOverDonLowLower)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrUpperOverDonHighUpper)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrUpperCrossedUnderPeak)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isStrLowerCrossedUnderVale)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isStrUpperUnderDonHighUpper)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isStrLowerCrossedUnderDonLowLower)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isStrUpperCrossedUnderDonHighUpper)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isClosedUnderVWapMin)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isClosedUnderVWapMax)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isVWapFastCrossedUnderMid)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isVWapFastCrossedUnderSlow)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isClosedUnderX3MaMin)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isClosedUnderX3MaMax)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isX3MaFastCrossedUnderMid)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
if (isX3MaFastCrossedUnderSlow)
|
|
{
|
|
bearishScore += score;
|
|
}
|
|
|
|
//
|
|
if (isClosedUnderCheMin)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isClosedUnderCheMax)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
if (isDonHighUpperEqualsToPeak)
|
|
{
|
|
bearishScore += minScore;
|
|
}
|
|
|
|
//
|
|
//
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Generate Summary String for Represent Conditions State ...
|
|
*
|
|
* @param onlyCommons: Boolean, Just Generate Only Commons Conditions ...
|
|
* @param onlyConditions: Boolean, Just Generate Only Conditions ...
|
|
* @param includeScores: Boolean, Attach Scores Representations on Result ...
|
|
* @param ignoreFalseConditions: Boolean, Ignore False Conditions on Result ...
|
|
* @param separator: String, Separate Lines ...
|
|
*
|
|
* @return ( string )
|
|
*/
|
|
string GenerateSummary(
|
|
bool onlyCommons = false,
|
|
bool onlyConditions = false,
|
|
bool includeScores = true,
|
|
bool ignoreFalseConditions = true,
|
|
string separator = "\n" //
|
|
)
|
|
{
|
|
//
|
|
string result = NULL;
|
|
|
|
//
|
|
double bullishScore = 0;
|
|
double bearishScore = 0;
|
|
GenerateScore(
|
|
bullishScore,
|
|
bearishScore //
|
|
);
|
|
|
|
//
|
|
string scoresStr =
|
|
//
|
|
"Scores: " + separator +
|
|
"---------------" + separator +
|
|
"Bullish: " + ToString(bullishScore) + separator +
|
|
"Bearish: " + ToString(bearishScore) + separator +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
string commonStr = GenerateSpecifiedCommonSummary(
|
|
this,
|
|
separator,
|
|
includeScores //
|
|
);
|
|
|
|
//
|
|
string conditionsStr =
|
|
//
|
|
"-----------------------" + separator +
|
|
"SAR ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"STR ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) +
|
|
ToString("isStrBearish", isStrBearish, ignoreFalseConditions, separator) +
|
|
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"PV ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"> RSI ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isRsiOverBought", isRsiOverBought, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedOverOverBought", isRsiCrossedOverOverBought, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedUnderOverBought", isRsiCrossedUnderOverBought, ignoreFalseConditions, separator) +
|
|
ToString("isRsiOverSold", isRsiOverSold, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedUnderOverSold", isRsiCrossedUnderOverSold, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedOverOverSold", isRsiCrossedOverOverSold, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"ATR ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isClosedOverAtrUpper", isClosedOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverAtrLower", isClosedOverAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderAtrUpper", isClosedUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderAtrLower", isClosedUnderAtrLower, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"DON ..." + separator +
|
|
"-----------------------" + separator +
|
|
//
|
|
"-----------------------" + separator +
|
|
"VWAP ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isVWapFastBullish", isVWapFastBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastBearish", isVWapFastBearish, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastNeutural", isVWapFastNeutural, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMidBullish", isVWapMidBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMidBearish", isVWapMidBearish, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMidNeutural", isVWapMidNeutural, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSlowBullish", isVWapSlowBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSlowBearish", isVWapSlowBearish, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSlowNeutural", isVWapSlowNeutural, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastOverMid", isVWapFastOverMid, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMidOverSlow", isVWapMidOverSlow, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastUnderMid", isVWapFastUnderMid, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMidUnderSlow", isVWapMidUnderSlow, ignoreFalseConditions, separator) +
|
|
ToString("isVWapBullishState", isVWapBullishState, ignoreFalseConditions, separator) +
|
|
ToString("isVWapBearishState", isVWapBearishState, ignoreFalseConditions, separator) +
|
|
ToString("isVWapNeuturalState", isVWapNeuturalState, ignoreFalseConditions, separator) +
|
|
ToString("isVWapBullishOrdered", isVWapBullishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isVWapBearishOrdered", isVWapBearishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSwitchedToBullishOrdered", isVWapSwitchedToBullishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSwitchedToBearishOrdered", isVWapSwitchedToBearishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSwitchedToBullishState", isVWapSwitchedToBullishState, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSwitchedToBearishState", isVWapSwitchedToBearishState, ignoreFalseConditions, separator) +
|
|
ToString("isVWapSwitchedToNeuturalState", isVWapSwitchedToNeuturalState, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"X3MA ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isX3MaMidBullish", isX3MaMidBullish, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaMidBearish", isX3MaMidBearish, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaFastBullish", isX3MaFastBullish, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaFastBearish", isX3MaFastBearish, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaMidNeutural", isX3MaMidNeutural, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSlowBullish", isX3MaSlowBullish, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSlowBearish", isX3MaSlowBearish, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaFastOverMid", isX3MaFastOverMid, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaMidOverSlow", isX3MaMidOverSlow, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaFastNeutural", isX3MaFastNeutural, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSlowNeutural", isX3MaSlowNeutural, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaFastUnderMid", isX3MaFastUnderMid, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaMidUnderSlow", isX3MaMidUnderSlow, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaBullishState", isX3MaBullishState, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaBearishState", isX3MaBearishState, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaNeuturalState", isX3MaNeuturalState, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaBullishOrdered", isX3MaBullishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaBearishOrdered", isX3MaBearishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSwitchedToBullishState", isX3MaSwitchedToBullishState, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSwitchedToBearishState", isX3MaSwitchedToBearishState, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSwitchedToNeuturalState", isX3MaSwitchedToNeuturalState, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSwitchedToBullishOrdered", isX3MaSwitchedToBullishOrdered, ignoreFalseConditions, separator) +
|
|
ToString("isX3MaSwitchedToBearishOrdered", isX3MaSwitchedToBearishOrdered, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"CHE ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isChe1Bullish", isChe1Bullish, ignoreFalseConditions, separator) +
|
|
ToString("isChe1Bearish", isChe1Bearish, ignoreFalseConditions, separator) +
|
|
ToString("isChe1SwitchedToBullish", isChe1SwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isChe1SwitchedToBearish", isChe1SwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isChe2Bullish", isChe2Bullish, ignoreFalseConditions, separator) +
|
|
ToString("isChe2Bearish", isChe2Bearish, ignoreFalseConditions, separator) +
|
|
ToString("isChe2SwitchedToBullish", isChe2SwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isChe2SwitchedToBearish", isChe2SwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isCheBullish", isCheBullish, ignoreFalseConditions, separator) +
|
|
ToString("isCheBearish", isCheBearish, ignoreFalseConditions, separator) +
|
|
ToString("isCheSwitchedToBullish", isCheSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isCheSwitchedToBearish", isCheSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverCheMin", isClosedOverCheMin, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverCheMax", isClosedOverCheMax, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderCheMin", isClosedUnderCheMin, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderCheMax", isClosedUnderCheMax, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"HK ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isSMHKBullish", isSMHKBullish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKBullish", isRawHKBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSMHKBearish", isSMHKBearish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKBearish", isRawHKBearish, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverSMHK", isClosedOverSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderSMHK", isClosedUnderSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverRawHK", isClosedOverRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderRawHK", isClosedUnderRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKClosedOverSMHK", isRawHKClosedOverSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isSMHKSwitchedToBearish", isSMHKSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKSwitchedToBearish", isRawHKSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKClosedUnderSMHK", isRawHKClosedUnderSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isSMHKSwitchedToBullish", isSMHKSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKSwitchedToBullish", isRawHKSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"XICH ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isTenkanSenOverKijunSen", isTenkanSenOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isTenkanSenUnderKijunSen", isTenkanSenUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isTenkanSenCrossedOverKijunSen", isTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isTenkanSenCrossedUnderKijunSen", isTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSenkouSpanAOverB", isSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isSenkouSpanAUnderB", isSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isSenkouSpanACrossedOverB", isSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isSenkouSpanACrossedUnderB", isSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"XDELTA ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isDeltaBullish", isDeltaBullish, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaBearish", isDeltaBearish, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaSwitchedToBullish", isDeltaSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaSwitchedToBearish", isDeltaSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaOverMa", isDeltaOverMa, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaUnderMa", isDeltaUnderMa, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaCrossedOverMa", isDeltaCrossedOverMa, ignoreFalseConditions, separator) +
|
|
ToString("isDeltaCrossedUnderMa", isDeltaCrossedUnderMa, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"XVOLUME ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isBullishVolumeOverMa", isBullishVolumeOverMa, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeCrossedOverMa", isBullishVolumeCrossedOverMa, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeUnderMa", isBullishVolumeUnderMa, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeCrossedUnderMa", isBullishVolumeCrossedUnderMa, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeIncreased", isBullishVolumeIncreased, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeSwitchedToIncreased", isBullishVolumeSwitchedToIncreased, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeDecreased", isBullishVolumeDecreased, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeSwitchedToDecreased", isBullishVolumeSwitchedToDecreased, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeOverMa", isBearishVolumeOverMa, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeCrossedOverMa", isBearishVolumeCrossedOverMa, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeUnderMa", isBearishVolumeUnderMa, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeCrossedUnderMa", isBearishVolumeCrossedUnderMa, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeIncreased", isBearishVolumeIncreased, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeSwitchedToIncreased", isBearishVolumeSwitchedToIncreased, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeDecreased", isBearishVolumeDecreased, ignoreFalseConditions, separator) +
|
|
ToString("isBearishVolumeSwitchedToDecreased", isBearishVolumeSwitchedToDecreased, ignoreFalseConditions, separator) +
|
|
ToString("isVolumeSwitchedToBullish", isVolumeSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVolumeSwitchedToBearish", isVolumeSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeMaOverBearishVolumeMa", isBullishVolumeMaOverBearishVolumeMa, ignoreFalseConditions, separator) +
|
|
ToString("isBullishVolumeMaUnderBearishVolumeMa", isBullishVolumeMaUnderBearishVolumeMa, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"Slopes ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isRsiSlopeBullish", isRsiSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isStrSlopeBullish", isStrSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperSlopeBullish", isAtrUpperSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerSlopeBullish", isAtrLowerSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVwapFastSlopeBullish", isVwapFastSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVwapMidSlopeBullish", isVwapMidSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isVwapSlowSlopeBullish", isVwapSlowSlopeBullish, ignoreFalseConditions, separator) +
|
|
ToString("isRsiSlopeBearish", isRsiSlopeBearish, ignoreFalseConditions, separator) +
|
|
ToString("isStrSlopeBearish", isStrSlopeBearish, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperSlopeBearish", isAtrUpperSlopeBearish, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerSlopeBearish", isAtrLowerSlopeBearish, ignoreFalseConditions, separator) +
|
|
ToString("isVwapFastSlopeBearish", isVwapFastSlopeBearish, ignoreFalseConditions, separator) +
|
|
ToString("isVwapMidSlopeBearish", isVwapMidSlopeBearish, ignoreFalseConditions, separator) +
|
|
ToString("isVwapSlowSlopeBearish", isVwapSlowSlopeBearish, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"Coplex ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isSarIncreased", isSarIncreased, ignoreFalseConditions, separator) +
|
|
ToString("isSarDecreased", isSarDecreased, ignoreFalseConditions, separator) +
|
|
ToString("isSarEqualsToPeak", isSarEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrEqualsToPeak", isStrEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrEqualsToVale", isStrEqualsToVale, ignoreFalseConditions, separator) +
|
|
ToString("isPeakOverAtrUpper", isPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperOverPeak", isStrUpperOverPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerOverVale", isStrLowerOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperOverPeak", isAtrUpperOverPeak, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerUnderVale", isAtrLowerUnderVale, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverVWapMin", isClosedOverVWapMin, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverVWapMax", isClosedOverVWapMax, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderPeak", isStrUpperUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isValeUnderAtrLower", isValeUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderVale", isStrLowerUnderVale, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderVWapMin", isClosedUnderVWapMin, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderVWapMax", isClosedUnderVWapMax, ignoreFalseConditions, separator) +
|
|
ToString("isSarCrossedOverVale", isSarCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrCrossedOverVale", isStrCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isSarCrossedUnderPeak", isSarCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrCrossedUnderPeak", isStrCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverAtrUpper", isNewPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderAtrLower", isNewValeUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperOverAtrUpper", isStrUpperOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerOverAtrLower", isStrLowerOverAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperEqualsToPeak", isAtrUpperEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerEqualsToVale", isAtrLowerEqualsToVale, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperCrossedUpPeak", isAtrUpperCrossedUpPeak, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerCrossedUpVale", isAtrLowerCrossedUpVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderAtrUpper", isStrUpperUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderAtrLower", isStrLowerUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastCrossedOverMid", isVWapFastCrossedOverMid, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperCrossedDownPeak", isAtrUpperCrossedDownPeak, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerCrossedDownVale", isAtrLowerCrossedDownVale, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastCrossedUnderMid", isVWapFastCrossedUnderMid, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastCrossedOverSlow", isVWapFastCrossedOverSlow, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedOverPeak", isStrUpperCrossedOverPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerOverDonLowLower", isStrLowerOverDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedOverVale", isStrLowerCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isDonLowLowerEqualsToVale", isDonLowLowerEqualsToVale, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastCrossedUnderSlow", isVWapFastCrossedUnderSlow, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedUnderPeak", isStrUpperCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedUnderVale", isStrLowerCrossedUnderVale, ignoreFalseConditions, separator) +
|
|
ToString("isDonHighUpperEqualsToPeak", isDonHighUpperEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperOverDonHighUpper", isStrUpperOverDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderDonLowLower", isStrLowerUnderDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderDonHighUpper", isStrUpperUnderDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedOverAtrUpper", isStrUpperCrossedOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedOverAtrLower", isStrLowerCrossedOverAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedUnderAtrUpper", isStrUpperCrossedUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedUnderAtrLower", isStrLowerCrossedUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedOverDonLowLower", isStrLowerCrossedOverDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedOverDonHighUpper", isStrUpperCrossedOverDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedUnderDonLowLower", isStrLowerCrossedUnderDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedUnderDonHighUpper", isStrUpperCrossedUnderDonHighUpper, ignoreFalseConditions, separator) +
|
|
//
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
result =
|
|
//
|
|
"[" + GetTag() + "]" + separator +
|
|
(onlyConditions
|
|
? ""
|
|
: commonStr) +
|
|
(!includeScores
|
|
? ""
|
|
: scoresStr) +
|
|
" " + separator +
|
|
(onlyCommons
|
|
? ""
|
|
: conditionsStr) +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Retrieve nique Tag Identifier ...
|
|
*
|
|
* @return ( string )
|
|
*/
|
|
string GetTag()
|
|
{
|
|
return GetTypeName(this);
|
|
}
|
|
|
|
//
|
|
};
|
|
|
|
//
|
|
// Implementation ...
|
|
class XCX121Helper : public XCBase
|
|
{
|
|
//
|
|
public:
|
|
//
|
|
|
|
//
|
|
// Helpers ...
|
|
XCX121XCCHelper *xccHelper;
|
|
XCX121XPVHelper *xpvHelper;
|
|
XCX121XHKHelper *xhkHelper;
|
|
XCX121XICHHelper *xichHelper;
|
|
XCX121XMASHelper *xmasHelper;
|
|
XCX121XATRHelper *xatrHelper;
|
|
XCX121XSTRHelper *xstrHelper;
|
|
XCX121XCHEHelper *xcheHelper;
|
|
XCX121XDONHelper *xdonHelper;
|
|
XCX121X3MAHelper *x3maHelper;
|
|
XCX121XVWAPHelper *xvwapHelper;
|
|
XCX121XDELTAHelper *xdeltaHelper;
|
|
XCX121XVOLUMEHelper *xvolumeHelper;
|
|
|
|
//
|
|
// Constructors ...
|
|
XCX121Helper()
|
|
{
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
~XCX121Helper()
|
|
{
|
|
//
|
|
mInputs.Clean();
|
|
xccInputs.Clean();
|
|
xpvInputs.Clean();
|
|
xhkInputs.Clean();
|
|
xichInputs.Clean();
|
|
xmasInputs.Clean();
|
|
xatrInputs.Clean();
|
|
xdonInputs.Clean();
|
|
xstrInputs.Clean();
|
|
xcheInputs.Clean();
|
|
x3maInputs.Clean();
|
|
xvwapInputs.Clean();
|
|
xdeltaInputs.Clean();
|
|
xvolumeInputs.Clean();
|
|
|
|
//
|
|
delete xccHelper;
|
|
delete xpvHelper;
|
|
delete xhkHelper;
|
|
delete xichHelper;
|
|
delete xmasHelper;
|
|
delete xatrHelper;
|
|
delete xstrHelper;
|
|
delete xcheHelper;
|
|
delete xdonHelper;
|
|
delete x3maHelper;
|
|
delete xvwapHelper;
|
|
delete xdeltaHelper;
|
|
delete xvolumeHelper;
|
|
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
}
|
|
|
|
//
|
|
string GetSymbol()
|
|
{
|
|
return mSymbol;
|
|
}
|
|
|
|
//
|
|
ENUM_TIMEFRAMES GetPeriod()
|
|
{
|
|
return mPeriod;
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Initialize Indicator Helper ...
|
|
*
|
|
* @param symbol: String, Symbol ...
|
|
* @param period: ENUM_TIMEFRAMES member, Period ...
|
|
* @param inputs: X121Inputs instance, Indicator Inputs ...
|
|
*
|
|
* @return ( bool )
|
|
*/
|
|
bool Init(
|
|
string symbol, // Trading Symbol
|
|
ENUM_TIMEFRAMES period, // Trading Period
|
|
X121Inputs &inputs // Inputs
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
IsValid(symbol) &&
|
|
IsValid(period) &&
|
|
inputs.IsValid();
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
mSymbol = symbol;
|
|
mPeriod = period;
|
|
|
|
//
|
|
// Setting Inputs ...
|
|
|
|
//
|
|
mInputs = inputs;
|
|
xccInputs = inputs.xccInputs;
|
|
xpvInputs = inputs.xpvInputs;
|
|
xhkInputs = inputs.xhkInputs;
|
|
xichInputs = inputs.xichInputs;
|
|
xmasInputs = inputs.xmasInputs;
|
|
xatrInputs = inputs.xatrInputs;
|
|
xstrInputs = inputs.xstrInputs;
|
|
xcheInputs = inputs.xcheInputs;
|
|
xdonInputs = inputs.xdonInputs;
|
|
x3maInputs = inputs.x3maInputs;
|
|
xvwapInputs = inputs.xvwapInputs;
|
|
xdeltaInputs = inputs.xdeltaInputs;
|
|
xvolumeInputs = inputs.xvolumeInputs;
|
|
|
|
//
|
|
// Initial Helpers ...
|
|
|
|
//
|
|
// XCC ...
|
|
xccHelper = new XCX121XCCHelper();
|
|
result = xccHelper.Init(
|
|
symbol,
|
|
period,
|
|
xccInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XPV ...
|
|
xpvHelper = new XCX121XPVHelper();
|
|
result = xpvHelper.Init(
|
|
symbol,
|
|
period,
|
|
xpvInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XHK ...
|
|
xhkHelper = new XCX121XHKHelper();
|
|
result = xhkHelper.Init(
|
|
symbol,
|
|
period,
|
|
xhkInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XMAS ...
|
|
xmasHelper = new XCX121XMASHelper();
|
|
result = xmasHelper.Init(
|
|
symbol,
|
|
period,
|
|
xmasInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XATR ...
|
|
xatrHelper = new XCX121XATRHelper();
|
|
result = xatrHelper.Init(
|
|
symbol,
|
|
period,
|
|
xatrInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XICH ...
|
|
xichHelper = new XCX121XICHHelper();
|
|
result = xichHelper.Init(
|
|
symbol,
|
|
period,
|
|
xichInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XSTR ...
|
|
xstrHelper = new XCX121XSTRHelper();
|
|
result = xstrHelper.Init(
|
|
symbol,
|
|
period,
|
|
xstrInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XCHE ...
|
|
xcheHelper = new XCX121XCHEHelper();
|
|
result = xcheHelper.Init(
|
|
symbol,
|
|
period,
|
|
xcheInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XDON ...
|
|
xdonHelper = new XCX121XDONHelper();
|
|
result = xdonHelper.Init(
|
|
symbol,
|
|
period,
|
|
xdonInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// X3MA ...
|
|
x3maHelper = new XCX121X3MAHelper();
|
|
result = x3maHelper.Init(
|
|
symbol,
|
|
period,
|
|
x3maInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XVWAP ...
|
|
xvwapHelper = new XCX121XVWAPHelper();
|
|
result = xvwapHelper.Init(
|
|
symbol,
|
|
period,
|
|
xvwapInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XDELTA ...
|
|
xdeltaHelper = new XCX121XDELTAHelper();
|
|
result = xdeltaHelper.Init(
|
|
symbol,
|
|
period,
|
|
xdeltaInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XVOLUME ...
|
|
xvolumeHelper = new XCX121XVOLUMEHelper();
|
|
result = xvolumeHelper.Init(
|
|
symbol,
|
|
period,
|
|
xvolumeInputs //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
if (inputs.showRSI)
|
|
{
|
|
//
|
|
mRSIHandler = iRSI(
|
|
symbol,
|
|
period,
|
|
xatrInputs.rsiLength,
|
|
xatrInputs.rsiAppliedTo //
|
|
);
|
|
|
|
//
|
|
result = mRSIHandler != INVALID_HANDLE;
|
|
if (!result)
|
|
{
|
|
//
|
|
ZeroMemory(xccHelper);
|
|
ZeroMemory(xpvHelper);
|
|
ZeroMemory(xhkHelper);
|
|
ZeroMemory(xmasHelper);
|
|
ZeroMemory(xatrHelper);
|
|
ZeroMemory(xichHelper);
|
|
ZeroMemory(xstrHelper);
|
|
ZeroMemory(xcheHelper);
|
|
ZeroMemory(xdonHelper);
|
|
ZeroMemory(x3maHelper);
|
|
ZeroMemory(xvwapHelper);
|
|
ZeroMemory(xdeltaHelper);
|
|
ZeroMemory(xvolumeHelper);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Conditions Readers ...
|
|
|
|
//
|
|
// XPV ...
|
|
bool GetPVConditions(
|
|
X121XPVConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xpvHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XHK ...
|
|
bool GetHKConditions(
|
|
X121XHKConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xhkHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XMAS ...
|
|
bool GetMASConditions(
|
|
X121XMASConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xmasHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XICH ...
|
|
bool GetICHConditions(
|
|
X121XICHConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xichHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XATR ...
|
|
bool GetATRConditions(
|
|
X121XATRConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xatrHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XSTR ...
|
|
bool GetSTRConditions(
|
|
X121XSTRConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xstrHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XCHE ...
|
|
bool GetCHEConditions(
|
|
X121XCHEConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xcheHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XDON ...
|
|
bool GetDONConditions(
|
|
X121XDONConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xdonHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// X3MA ...
|
|
bool Get3MAConditions(
|
|
X121X3MAConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = x3maHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XVWAP ...
|
|
bool GetVWAPConditions(
|
|
X121XVWAPConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xvwapHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XDELTA ...
|
|
bool GetDELTAConditions(
|
|
X121XDELTAConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xdeltaHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XVOLUME ...
|
|
bool GetVOLUMEConditions(
|
|
X121XVOLUMEConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = xvolumeHelper.GetConditions(
|
|
conditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
void Free()
|
|
{
|
|
//
|
|
xpvHelper.Free();
|
|
xhkHelper.Free();
|
|
xichHelper.Free();
|
|
xmasHelper.Free();
|
|
xatrHelper.Free();
|
|
xstrHelper.Free();
|
|
xcheHelper.Free();
|
|
xdonHelper.Free();
|
|
xvwapHelper.Free();
|
|
}
|
|
|
|
//
|
|
bool GetConditions(
|
|
X121Conditions &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;
|
|
|
|
//
|
|
XOHCL zBar;
|
|
result = zBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
zIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
XOHCL cBar;
|
|
result = cBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
cIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
XOHCL pBar;
|
|
result = pBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
pIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XPV ...
|
|
X121XPVConditions xpvConditions;
|
|
result = GetPVConditions(
|
|
xpvConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XHK ...
|
|
X121XHKConditions xhkConditions;
|
|
result = GetHKConditions(
|
|
xhkConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XICH ...
|
|
X121XICHConditions xichConditions;
|
|
result = GetICHConditions(
|
|
xichConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XMAS ...
|
|
X121XMASConditions xmasConditions;
|
|
result = GetMASConditions(
|
|
xmasConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XATR ...
|
|
X121XATRConditions xatrConditions;
|
|
result = GetATRConditions(
|
|
xatrConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XSTR ...
|
|
X121XSTRConditions xstrConditions;
|
|
result = GetSTRConditions(
|
|
xstrConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XCHE ...
|
|
X121XCHEConditions xcheConditions;
|
|
result = GetCHEConditions(
|
|
xcheConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XDON ...
|
|
X121XDONConditions xdonConditions;
|
|
result = GetDONConditions(
|
|
xdonConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
xdonConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// X3MA ...
|
|
X121X3MAConditions x3maConditions;
|
|
result = Get3MAConditions(
|
|
x3maConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
xdonConditions.Clean();
|
|
x3maConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XVWAP ...
|
|
X121XVWAPConditions xvwapConditions;
|
|
result = GetVWAPConditions(
|
|
xvwapConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
xdonConditions.Clean();
|
|
x3maConditions.Clean();
|
|
xvwapConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XDELTA ...
|
|
X121XDELTAConditions xdeltaConditions;
|
|
result = GetDELTAConditions(
|
|
xdeltaConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
xdonConditions.Clean();
|
|
x3maConditions.Clean();
|
|
xvwapConditions.Clean();
|
|
xdeltaConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XVOLUME ...
|
|
X121XVOLUMEConditions xvolumeConditions;
|
|
result = GetVOLUMEConditions(
|
|
xvolumeConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
xdonConditions.Clean();
|
|
x3maConditions.Clean();
|
|
xvwapConditions.Clean();
|
|
xdeltaConditions.Clean();
|
|
xvolumeConditions.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Fill Volume Buffer ...
|
|
for (int i = barIndex; i < barIndex + loopback; i++)
|
|
{
|
|
//
|
|
// Reading Bar Valuem ...
|
|
long iVol = iVolume(
|
|
mSymbol,
|
|
mPeriod,
|
|
i //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iVol,
|
|
conditions.volumeBuffer //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Fill X121 Conditions Reference by Using
|
|
// Retrieved Conditions ...
|
|
|
|
//
|
|
int cIDX = 1;
|
|
int pIDX = cIDX + 1;
|
|
|
|
//
|
|
// XPV ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.peaksBuffer,
|
|
conditions.peaksBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.valesBuffer,
|
|
conditions.valesBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.supportsBuffer,
|
|
conditions.supportsBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.resistancesBuffer,
|
|
conditions.resistancesBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.peaksGoldenBuffer,
|
|
conditions.peaksGoldenBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.valesGoldenBuffer,
|
|
conditions.valesGoldenBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.sarBuffer,
|
|
conditions.sarBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.cHHBuffer,
|
|
conditions.cHHBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.cLLBuffer,
|
|
conditions.cLLBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.sHHBuffer,
|
|
conditions.sHHBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.sLLBuffer,
|
|
conditions.sLLBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.mHHBuffer,
|
|
conditions.mHHBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.mLLBuffer,
|
|
conditions.mLLBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.lHHBuffer,
|
|
conditions.lHHBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.lLLBuffer,
|
|
conditions.lLLBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.hHHBuffer,
|
|
conditions.hHHBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.hLLBuffer,
|
|
conditions.hLLBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.fractalsUpperBuffer,
|
|
conditions.fractalsUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xpvConditions.fractalsLowerBuffer,
|
|
conditions.fractalsLowerBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isNewPeak = xpvConditions.isNewPeak;
|
|
conditions.isNewVale = xpvConditions.isNewVale;
|
|
conditions.isSarBullish = xpvConditions.isSarBullish;
|
|
conditions.isSarBearish = xpvConditions.isSarBearish;
|
|
conditions.isNewPeakOverLast = xpvConditions.isNewPeakOverLast;
|
|
conditions.isNewValeOverLast = xpvConditions.isNewValeOverLast;
|
|
conditions.isNewPeakUnderLast = xpvConditions.isNewPeakUnderLast;
|
|
conditions.isNewValeUnderLast = xpvConditions.isNewValeUnderLast;
|
|
conditions.isSarSwitchedToBullish = xpvConditions.isSarSwitchedToBullish;
|
|
conditions.isSarSwitchedToBearish = xpvConditions.isSarSwitchedToBearish;
|
|
|
|
//
|
|
// XHK ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkRawOpenBuffer,
|
|
conditions.xhkRawOpenBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkRawHighBuffer,
|
|
conditions.xhkRawHighBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkRawLowBuffer,
|
|
conditions.xhkRawLowBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkRawCloseBuffer,
|
|
conditions.xhkRawCloseBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkSMOpenBuffer,
|
|
conditions.xhkSMOpenBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkSMHighBuffer,
|
|
conditions.xhkSMHighBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkSMLowBuffer,
|
|
conditions.xhkSMLowBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xhkConditions.xhkSMCloseBuffer,
|
|
conditions.xhkSMCloseBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
conditions.isSMHKBullish = xhkConditions.isSMHKBullish;
|
|
conditions.isRawHKBullish = xhkConditions.isRawHKBullish;
|
|
conditions.isSMHKBearish = xhkConditions.isSMHKBearish;
|
|
conditions.isRawHKBearish = xhkConditions.isRawHKBearish;
|
|
conditions.isClosedOverSMHK = xhkConditions.isClosedOverSMHK;
|
|
conditions.isClosedUnderSMHK = xhkConditions.isClosedUnderSMHK;
|
|
conditions.isClosedOverRawHK = xhkConditions.isClosedOverRawHK;
|
|
conditions.isClosedUnderRawHK = xhkConditions.isClosedUnderRawHK;
|
|
conditions.isRawHKClosedOverSMHK = xhkConditions.isRawHKClosedOverSMHK;
|
|
conditions.isSMHKSwitchedToBearish = xhkConditions.isSMHKSwitchedToBearish;
|
|
conditions.isRawHKSwitchedToBearish = xhkConditions.isRawHKSwitchedToBearish;
|
|
conditions.isRawHKClosedUnderSMHK = xhkConditions.isRawHKClosedUnderSMHK;
|
|
conditions.isSMHKSwitchedToBullish = xhkConditions.isSMHKSwitchedToBullish;
|
|
conditions.isRawHKSwitchedToBullish = xhkConditions.isRawHKSwitchedToBullish;
|
|
|
|
//
|
|
// XMAS ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xmasConditions.upperBuffer,
|
|
conditions.masUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xmasConditions.midBuffer,
|
|
conditions.masMidBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xmasConditions.lowerBuffer,
|
|
conditions.masLowerBuffer //
|
|
);
|
|
|
|
//
|
|
// XATR ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xatrConditions.atrUpperBuffer,
|
|
conditions.atrUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xatrConditions.atrLowerBuffer,
|
|
conditions.atrLowerBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xatrConditions.atrUpperRawBuffer,
|
|
conditions.atrUpperRawBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xatrConditions.atrLowerRawBuffer,
|
|
conditions.atrLowerRawBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xatrConditions.atrBuffer,
|
|
conditions.atrBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xatrConditions.rsiBuffer,
|
|
conditions.rsiBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isRsiOverSold = xatrConditions.isRsiOverSold;
|
|
conditions.isRsiOverBought = xatrConditions.isRsiOverBought;
|
|
conditions.isClosedOverAtrUpper = xatrConditions.isClosedOverAtrUpper;
|
|
conditions.isClosedOverAtrLower = xatrConditions.isClosedOverAtrLower;
|
|
conditions.isClosedUnderAtrUpper = xatrConditions.isClosedUnderAtrUpper;
|
|
conditions.isClosedUnderAtrLower = xatrConditions.isClosedUnderAtrLower;
|
|
conditions.isRsiCrossedOverOverSold = xatrConditions.isRsiCrossedOverOverSold;
|
|
conditions.isRsiCrossedUnderOverSold = xatrConditions.isRsiCrossedUnderOverSold;
|
|
conditions.isRsiCrossedOverOverBought = xatrConditions.isRsiCrossedOverOverBought;
|
|
conditions.isRsiCrossedUnderOverBought = xatrConditions.isRsiCrossedUnderOverBought;
|
|
|
|
//
|
|
// XSTR ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xstrConditions.strBuffer,
|
|
conditions.strBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xstrConditions.strPriceBuffer,
|
|
conditions.strPriceBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xstrConditions.strUpBuffer,
|
|
conditions.strUpBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xstrConditions.strDownBuffer,
|
|
conditions.strDownBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xstrConditions.strStateBuffer,
|
|
conditions.strStateBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isStrBullish = xstrConditions.isStrBullish;
|
|
conditions.isStrBearish = xstrConditions.isStrBearish;
|
|
conditions.isStrSwitchedToBullish = xstrConditions.isStrSwitchedToBullish;
|
|
conditions.isStrSwitchedToBearish = xstrConditions.isStrSwitchedToBearish;
|
|
|
|
//
|
|
// XCHE ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.le1Buffer,
|
|
conditions.le1Buffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.se1Buffer,
|
|
conditions.se1Buffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.le2Buffer,
|
|
conditions.le2Buffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.se2Buffer,
|
|
conditions.se2Buffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.le1StartBuffer,
|
|
conditions.le1StartBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.se1StartBuffer,
|
|
conditions.se1StartBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.le2StartBuffer,
|
|
conditions.le2StartBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xcheConditions.se2StartBuffer,
|
|
conditions.se2StartBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
conditions.isCheBullish = xcheConditions.isCheBullish;
|
|
conditions.isCheBearish = xcheConditions.isCheBearish;
|
|
conditions.isChe1Bullish = xcheConditions.isChe1Bullish;
|
|
conditions.isChe1Bearish = xcheConditions.isChe1Bearish;
|
|
conditions.isChe2Bullish = xcheConditions.isChe2Bullish;
|
|
conditions.isChe2Bearish = xcheConditions.isChe2Bearish;
|
|
conditions.isClosedOverCheMin = xcheConditions.isClosedOverCheMin;
|
|
conditions.isClosedOverCheMax = xcheConditions.isClosedOverCheMax;
|
|
conditions.isClosedUnderCheMin = xcheConditions.isClosedUnderCheMin;
|
|
conditions.isClosedUnderCheMax = xcheConditions.isClosedUnderCheMax;
|
|
conditions.isCheSwitchedToBullish = xcheConditions.isCheSwitchedToBullish;
|
|
conditions.isCheSwitchedToBearish = xcheConditions.isCheSwitchedToBearish;
|
|
conditions.isChe1SwitchedToBullish = xcheConditions.isChe1SwitchedToBullish;
|
|
conditions.isChe1SwitchedToBearish = xcheConditions.isChe1SwitchedToBearish;
|
|
conditions.isChe2SwitchedToBullish = xcheConditions.isChe2SwitchedToBullish;
|
|
conditions.isChe2SwitchedToBearish = xcheConditions.isChe2SwitchedToBearish;
|
|
|
|
//
|
|
// XDON ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donOpenUpperBuffer,
|
|
conditions.donOpenUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donOpenLowerBuffer,
|
|
conditions.donOpenLowerBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donHighUpperBuffer,
|
|
conditions.donHighUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donHighLowerBuffer,
|
|
conditions.donHighLowerBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donLowUpperBuffer,
|
|
conditions.donLowUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donLowLowerBuffer,
|
|
conditions.donLowLowerBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donCloseUpperBuffer,
|
|
conditions.donCloseUpperBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdonConditions.donCloseLowerBuffer,
|
|
conditions.donCloseLowerBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
// X3MA ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
x3maConditions.x3maFastBuffer,
|
|
conditions.x3maFastBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
x3maConditions.x3maMidBuffer,
|
|
conditions.x3maMidBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
x3maConditions.x3maSlowBuffer,
|
|
conditions.x3maSlowBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
x3maConditions.x3maFastStateBuffer,
|
|
conditions.x3maFastStateBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
x3maConditions.x3maMidStateBuffer,
|
|
conditions.x3maMidStateBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
x3maConditions.x3maSlowStateBuffer,
|
|
conditions.x3maSlowStateBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isX3MaMidBullish = x3maConditions.isX3MaMidBullish;
|
|
conditions.isX3MaMidBearish = x3maConditions.isX3MaMidBearish;
|
|
conditions.isX3MaFastBullish = x3maConditions.isX3MaFastBullish;
|
|
conditions.isX3MaFastBearish = x3maConditions.isX3MaFastBearish;
|
|
conditions.isX3MaMidNeutural = x3maConditions.isX3MaMidNeutural;
|
|
conditions.isX3MaSlowBullish = x3maConditions.isX3MaSlowBullish;
|
|
conditions.isX3MaSlowBearish = x3maConditions.isX3MaSlowBearish;
|
|
conditions.isX3MaFastOverMid = x3maConditions.isX3MaFastOverMid;
|
|
conditions.isX3MaMidOverSlow = x3maConditions.isX3MaMidOverSlow;
|
|
conditions.isX3MaFastNeutural = x3maConditions.isX3MaFastNeutural;
|
|
conditions.isX3MaSlowNeutural = x3maConditions.isX3MaSlowNeutural;
|
|
conditions.isX3MaFastUnderMid = x3maConditions.isX3MaFastUnderMid;
|
|
conditions.isX3MaMidUnderSlow = x3maConditions.isX3MaMidUnderSlow;
|
|
conditions.isX3MaBullishState = x3maConditions.isX3MaBullishState;
|
|
conditions.isX3MaBearishState = x3maConditions.isX3MaBearishState;
|
|
conditions.isX3MaNeuturalState = x3maConditions.isX3MaNeuturalState;
|
|
conditions.isX3MaBullishOrdered = x3maConditions.isX3MaBullishOrdered;
|
|
conditions.isX3MaBearishOrdered = x3maConditions.isX3MaBearishOrdered;
|
|
conditions.isX3MaSwitchedToBullishState = x3maConditions.isX3MaSwitchedToBullishState;
|
|
conditions.isX3MaSwitchedToBearishState = x3maConditions.isX3MaSwitchedToBearishState;
|
|
conditions.isX3MaSwitchedToNeuturalState = x3maConditions.isX3MaSwitchedToNeuturalState;
|
|
conditions.isX3MaSwitchedToBullishOrdered = x3maConditions.isX3MaSwitchedToBullishOrdered;
|
|
conditions.isX3MaSwitchedToBearishOrdered = x3maConditions.isX3MaSwitchedToBearishOrdered;
|
|
|
|
//
|
|
// XVWAP ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapFastBuffer,
|
|
conditions.vwapFastBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapMidBuffer,
|
|
conditions.vwapMidBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapSlowBuffer,
|
|
conditions.vwapSlowBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapVolumeBuffer,
|
|
conditions.vwapVolumeBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapPriceBuffer,
|
|
conditions.vwapPriceBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapFastStateBuffer,
|
|
conditions.vwapFastStateBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapMidStateBuffer,
|
|
conditions.vwapMidStateBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvwapConditions.vwapSlowStateBuffer,
|
|
conditions.vwapSlowStateBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isVWapMidBullish = xvwapConditions.isVWapMidBullish;
|
|
conditions.isVWapMidBearish = xvwapConditions.isVWapMidBearish;
|
|
conditions.isVWapFastBullish = xvwapConditions.isVWapFastBullish;
|
|
conditions.isVWapFastBearish = xvwapConditions.isVWapFastBearish;
|
|
conditions.isVWapMidNeutural = xvwapConditions.isVWapMidNeutural;
|
|
conditions.isVWapSlowBullish = xvwapConditions.isVWapSlowBullish;
|
|
conditions.isVWapSlowBearish = xvwapConditions.isVWapSlowBearish;
|
|
conditions.isVWapFastOverMid = xvwapConditions.isVWapFastOverMid;
|
|
conditions.isVWapMidOverSlow = xvwapConditions.isVWapMidOverSlow;
|
|
conditions.isVWapFastNeutural = xvwapConditions.isVWapFastNeutural;
|
|
conditions.isVWapSlowNeutural = xvwapConditions.isVWapSlowNeutural;
|
|
conditions.isVWapFastUnderMid = xvwapConditions.isVWapFastUnderMid;
|
|
conditions.isVWapMidUnderSlow = xvwapConditions.isVWapMidUnderSlow;
|
|
conditions.isVWapBullishState = xvwapConditions.isVWapBullishState;
|
|
conditions.isVWapBearishState = xvwapConditions.isVWapBearishState;
|
|
conditions.isVWapNeuturalState = xvwapConditions.isVWapNeuturalState;
|
|
conditions.isVWapBullishOrdered = xvwapConditions.isVWapBullishOrdered;
|
|
conditions.isVWapBearishOrdered = xvwapConditions.isVWapBearishOrdered;
|
|
conditions.isVWapSwitchedToBullishState = xvwapConditions.isVWapSwitchedToBullishState;
|
|
conditions.isVWapSwitchedToBearishState = xvwapConditions.isVWapSwitchedToBearishState;
|
|
conditions.isVWapSwitchedToNeuturalState = xvwapConditions.isVWapSwitchedToNeuturalState;
|
|
conditions.isVWapSwitchedToBullishOrdered = xvwapConditions.isVWapSwitchedToBullishOrdered;
|
|
conditions.isVWapSwitchedToBearishOrdered = xvwapConditions.isVWapSwitchedToBearishOrdered;
|
|
|
|
//
|
|
// XICH ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xichConditions.kijunSenBuffer,
|
|
conditions.kijunSenBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xichConditions.tenkanSenBuffer,
|
|
conditions.tenkanSenBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xichConditions.chikouSpanBuffer,
|
|
conditions.chikouSpanBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xichConditions.senkouSpanABuffer,
|
|
conditions.senkouSpanABuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xichConditions.senkouSpanBBuffer,
|
|
conditions.senkouSpanBBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isTenkanSenOverKijunSen = xichConditions.isTenkanSenOverKijunSen;
|
|
conditions.isTenkanSenUnderKijunSen = xichConditions.isTenkanSenUnderKijunSen;
|
|
|
|
//
|
|
conditions.isTenkanSenCrossedOverKijunSen = xichConditions.isTenkanSenCrossedOverKijunSen;
|
|
conditions.isTenkanSenCrossedUnderKijunSen = xichConditions.isTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
conditions.isSenkouSpanAOverB = xichConditions.isSenkouSpanAOverB;
|
|
conditions.isSenkouSpanAUnderB = xichConditions.isSenkouSpanAUnderB;
|
|
|
|
//
|
|
conditions.isSenkouSpanACrossedOverB = xichConditions.isSenkouSpanACrossedOverB;
|
|
conditions.isSenkouSpanACrossedUnderB = xichConditions.isSenkouSpanACrossedUnderB;
|
|
|
|
//
|
|
conditions.tenKijMax = MathMax(xichConditions.tenkanSenBuffer[cIDX], xichConditions.kijunSenBuffer[cIDX]);
|
|
conditions.tenKijMin = MathMin(xichConditions.tenkanSenBuffer[cIDX], xichConditions.kijunSenBuffer[cIDX]);
|
|
conditions.senkouMax = MathMax(xichConditions.senkouSpanABuffer[cIDX], xichConditions.senkouSpanBBuffer[cIDX]);
|
|
conditions.senkouMin = MathMin(xichConditions.senkouSpanABuffer[cIDX], xichConditions.senkouSpanBBuffer[cIDX]);
|
|
|
|
//
|
|
// XDELTA ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xdeltaConditions.deltaBuffer,
|
|
conditions.deltaBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdeltaConditions.deltaMaBuffer,
|
|
conditions.deltaMaBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xdeltaConditions.deltaStateBuffer,
|
|
conditions.deltaStateBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isDeltaBullish = xdeltaConditions.isDeltaBullish;
|
|
conditions.isDeltaBearish = xdeltaConditions.isDeltaBearish;
|
|
conditions.isDeltaSwitchedToBullish = xdeltaConditions.isDeltaSwitchedToBullish;
|
|
conditions.isDeltaSwitchedToBearish = xdeltaConditions.isDeltaSwitchedToBearish;
|
|
|
|
//
|
|
conditions.isDeltaOverMa = xdeltaConditions.isDeltaOverMa;
|
|
conditions.isDeltaUnderMa = xdeltaConditions.isDeltaUnderMa;
|
|
conditions.isDeltaCrossedOverMa = xdeltaConditions.isDeltaCrossedOverMa;
|
|
conditions.isDeltaCrossedUnderMa = xdeltaConditions.isDeltaCrossedUnderMa;
|
|
|
|
//
|
|
// XVOLUME ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Copy(
|
|
xvolumeConditions.bullishVolumeBuffer,
|
|
conditions.bullishVolumeBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvolumeConditions.bullishVolumeMaBuffer,
|
|
conditions.bullishVolumeMaBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvolumeConditions.bearishVolumeBuffer,
|
|
conditions.bearishVolumeBuffer //
|
|
);
|
|
|
|
//
|
|
Copy(
|
|
xvolumeConditions.bearishVolumeMaBuffer,
|
|
conditions.bearishVolumeMaBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
conditions.isBullishVolumeOverMa = xvolumeConditions.isBullishVolumeOverMa;
|
|
conditions.isBullishVolumeCrossedOverMa = xvolumeConditions.isBullishVolumeCrossedOverMa;
|
|
|
|
//
|
|
conditions.isBullishVolumeUnderMa = xvolumeConditions.isBullishVolumeUnderMa;
|
|
conditions.isBullishVolumeCrossedUnderMa = xvolumeConditions.isBullishVolumeCrossedUnderMa;
|
|
|
|
//
|
|
conditions.isBullishVolumeIncreased = xvolumeConditions.isBullishVolumeIncreased;
|
|
conditions.isBullishVolumeSwitchedToIncreased = xvolumeConditions.isBullishVolumeSwitchedToIncreased;
|
|
|
|
//
|
|
conditions.isBullishVolumeDecreased = xvolumeConditions.isBullishVolumeDecreased;
|
|
conditions.isBullishVolumeSwitchedToDecreased = xvolumeConditions.isBullishVolumeSwitchedToDecreased;
|
|
|
|
//
|
|
conditions.isBearishVolumeOverMa = xvolumeConditions.isBearishVolumeOverMa;
|
|
conditions.isBearishVolumeCrossedOverMa = xvolumeConditions.isBearishVolumeCrossedOverMa;
|
|
|
|
//
|
|
conditions.isBearishVolumeUnderMa = xvolumeConditions.isBearishVolumeUnderMa;
|
|
conditions.isBearishVolumeCrossedUnderMa = xvolumeConditions.isBearishVolumeCrossedUnderMa;
|
|
|
|
//
|
|
conditions.isBearishVolumeIncreased = xvolumeConditions.isBearishVolumeIncreased;
|
|
conditions.isBearishVolumeSwitchedToIncreased = xvolumeConditions.isBearishVolumeSwitchedToIncreased;
|
|
|
|
//
|
|
conditions.isBearishVolumeDecreased = xvolumeConditions.isBearishVolumeDecreased;
|
|
conditions.isBearishVolumeSwitchedToDecreased = xvolumeConditions.isBearishVolumeSwitchedToDecreased;
|
|
|
|
//
|
|
conditions.isVolumeSwitchedToBullish = xvolumeConditions.isVolumeSwitchedToBullish;
|
|
conditions.isVolumeSwitchedToBearish = xvolumeConditions.isVolumeSwitchedToBearish;
|
|
|
|
//
|
|
conditions.isBullishVolumeMaOverBearishVolumeMa = xvolumeConditions.isBullishVolumeMaOverBearishVolumeMa;
|
|
conditions.isBullishVolumeMaUnderBearishVolumeMa = xvolumeConditions.isBullishVolumeMaUnderBearishVolumeMa;
|
|
|
|
//
|
|
// Slopes ...
|
|
|
|
//
|
|
double rsiSlope = GetSlope(conditions.rsiBuffer, pIDX, cIDX);
|
|
double strSlope = GetSlope(conditions.strBuffer, pIDX, cIDX);
|
|
double atrUpperSlope = GetSlope(conditions.atrUpperBuffer, pIDX, cIDX);
|
|
double atrLowerSlope = GetSlope(conditions.atrLowerBuffer, pIDX, cIDX);
|
|
double vwapFastSlope = GetSlope(conditions.vwapFastBuffer, pIDX, cIDX);
|
|
double vwapMidSlope = GetSlope(conditions.vwapMidBuffer, pIDX, cIDX);
|
|
double vwapSlowSlope = GetSlope(conditions.vwapSlowBuffer, pIDX, cIDX);
|
|
|
|
//
|
|
bool isRsiSlopeBullish = rsiSlope > 0;
|
|
bool isStrSlopeBullish = strSlope > 0;
|
|
bool isAtrUpperSlopeBullish = atrUpperSlope > 0;
|
|
bool isAtrLowerSlopeBullish = atrLowerSlope > 0;
|
|
bool isVwapFastSlopeBullish = vwapFastSlope > 0;
|
|
bool isVwapMidSlopeBullish = vwapMidSlope > 0;
|
|
bool isVwapSlowSlopeBullish = vwapSlowSlope > 0;
|
|
|
|
//
|
|
bool isRsiSlopeBearish = rsiSlope < 0;
|
|
bool isStrSlopeBearish = strSlope < 0;
|
|
bool isAtrUpperSlopeBearish = atrUpperSlope < 0;
|
|
bool isAtrLowerSlopeBearish = atrLowerSlope < 0;
|
|
bool isVwapFastSlopeBearish = vwapFastSlope < 0;
|
|
bool isVwapMidSlopeBearish = vwapMidSlope < 0;
|
|
bool isVwapSlowSlopeBearish = vwapSlowSlope < 0;
|
|
|
|
//
|
|
conditions.rsiSlope = rsiSlope;
|
|
conditions.strSlope = strSlope;
|
|
conditions.vwapMidSlope = vwapMidSlope;
|
|
conditions.vwapSlowSlope = vwapSlowSlope;
|
|
conditions.atrUpperSlope = atrUpperSlope;
|
|
conditions.atrLowerSlope = atrLowerSlope;
|
|
conditions.vwapFastSlope = vwapFastSlope;
|
|
conditions.isRsiSlopeBearish = isRsiSlopeBearish;
|
|
conditions.isStrSlopeBearish = isStrSlopeBearish;
|
|
conditions.isRsiSlopeBullish = isRsiSlopeBullish;
|
|
conditions.isStrSlopeBullish = isStrSlopeBullish;
|
|
conditions.isVwapMidSlopeBearish = isVwapMidSlopeBearish;
|
|
conditions.isVwapMidSlopeBullish = isVwapMidSlopeBullish;
|
|
conditions.isAtrUpperSlopeBearish = isAtrUpperSlopeBearish;
|
|
conditions.isAtrLowerSlopeBearish = isAtrLowerSlopeBearish;
|
|
conditions.isVwapFastSlopeBearish = isVwapFastSlopeBearish;
|
|
conditions.isVwapSlowSlopeBearish = isVwapSlowSlopeBearish;
|
|
conditions.isAtrUpperSlopeBullish = isAtrUpperSlopeBullish;
|
|
conditions.isAtrLowerSlopeBullish = isAtrLowerSlopeBullish;
|
|
conditions.isVwapFastSlopeBullish = isVwapFastSlopeBullish;
|
|
conditions.isVwapSlowSlopeBullish = isVwapSlowSlopeBullish;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
double x3maFast = conditions.x3maFastBuffer[cIDX];
|
|
double x3maMid = conditions.x3maMidBuffer[cIDX];
|
|
double x3maSlow = conditions.x3maSlowBuffer[cIDX];
|
|
|
|
//
|
|
double x3mas[3] = {
|
|
x3maFast,
|
|
x3maMid,
|
|
x3maSlow //
|
|
};
|
|
|
|
//
|
|
double x3maMin = GetMin(x3mas);
|
|
double x3maMax = GetMax(x3mas);
|
|
|
|
//
|
|
bool isX3MaFatsOverMid = conditions.x3maFastBuffer[cIDX] > conditions.x3maMidBuffer[cIDX];
|
|
bool isX3MaFatsOverMidPrev = conditions.x3maFastBuffer[pIDX] > conditions.x3maMidBuffer[pIDX];
|
|
|
|
//
|
|
bool isX3MaFatsUnderMid = conditions.x3maFastBuffer[cIDX] < conditions.x3maMidBuffer[cIDX];
|
|
bool isX3MaFatsUnderMidPrev = conditions.x3maFastBuffer[pIDX] < conditions.x3maMidBuffer[pIDX];
|
|
|
|
//
|
|
bool isX3MaFatsOverSlow = conditions.x3maFastBuffer[cIDX] > conditions.x3maSlowBuffer[cIDX];
|
|
bool isX3MaFatsOverSlowPrev = conditions.x3maFastBuffer[pIDX] > conditions.x3maSlowBuffer[pIDX];
|
|
|
|
//
|
|
bool isX3MaFatsUnderSlow = conditions.x3maFastBuffer[cIDX] < conditions.x3maSlowBuffer[cIDX];
|
|
bool isX3MaFatsUnderSlowPrev = conditions.x3maFastBuffer[pIDX] < conditions.x3maSlowBuffer[pIDX];
|
|
|
|
//
|
|
bool isX3MaFastCrossedOverMid = isX3MaFatsOverMid &&
|
|
!isX3MaFatsOverMidPrev;
|
|
bool isX3MaFastCrossedUnderMid = isX3MaFatsUnderMid &&
|
|
!isX3MaFatsUnderMidPrev;
|
|
|
|
//
|
|
bool isX3MaFastCrossedOverSlow = isX3MaFatsOverSlow &&
|
|
!isX3MaFatsOverSlowPrev;
|
|
bool isX3MaFastCrossedUnderSlow = isX3MaFatsUnderSlow &&
|
|
!isX3MaFatsUnderSlowPrev;
|
|
|
|
//
|
|
bool isClosedOverX3MaMin = cBar.close > x3maMin;
|
|
bool isClosedUnderX3MaMin = cBar.close < x3maMin;
|
|
|
|
//
|
|
bool isClosedOverX3MaMax = cBar.close > x3maMax;
|
|
bool isClosedUnderX3MaMax = cBar.close < x3maMax;
|
|
|
|
//
|
|
//
|
|
//
|
|
|
|
//
|
|
double vwapFast = conditions.vwapFastBuffer[cIDX];
|
|
double vwapMid = conditions.vwapMidBuffer[cIDX];
|
|
double vwapSlow = conditions.vwapSlowBuffer[cIDX];
|
|
|
|
//
|
|
double vwaps[3] = {
|
|
vwapFast,
|
|
vwapMid,
|
|
vwapSlow //
|
|
};
|
|
|
|
//
|
|
double vwapMin = GetMin(vwaps);
|
|
double vwapMax = GetMax(vwaps);
|
|
|
|
//
|
|
bool isVWapFatsOverMid = conditions.vwapFastBuffer[cIDX] > conditions.vwapMidBuffer[cIDX];
|
|
bool isVWapFatsOverMidPrev = conditions.vwapFastBuffer[pIDX] > conditions.vwapMidBuffer[pIDX];
|
|
|
|
//
|
|
bool isVWapFatsUnderMid = conditions.vwapFastBuffer[cIDX] < conditions.vwapMidBuffer[cIDX];
|
|
bool isVWapFatsUnderMidPrev = conditions.vwapFastBuffer[pIDX] < conditions.vwapMidBuffer[pIDX];
|
|
|
|
//
|
|
bool isVWapFatsOverSlow = conditions.vwapFastBuffer[cIDX] > conditions.vwapSlowBuffer[cIDX];
|
|
bool isVWapFatsOverSlowPrev = conditions.vwapFastBuffer[pIDX] > conditions.vwapSlowBuffer[pIDX];
|
|
|
|
//
|
|
bool isVWapFatsUnderSlow = conditions.vwapFastBuffer[cIDX] < conditions.vwapSlowBuffer[cIDX];
|
|
bool isVWapFatsUnderSlowPrev = conditions.vwapFastBuffer[pIDX] < conditions.vwapSlowBuffer[pIDX];
|
|
|
|
//
|
|
bool isVWapFastCrossedOverMid = isVWapFatsOverMid &&
|
|
!isVWapFatsOverMidPrev;
|
|
bool isVWapFastCrossedUnderMid = isVWapFatsUnderMid &&
|
|
!isVWapFatsUnderMidPrev;
|
|
|
|
//
|
|
bool isVWapFastCrossedOverSlow = isVWapFatsOverSlow &&
|
|
!isVWapFatsOverSlowPrev;
|
|
bool isVWapFastCrossedUnderSlow = isVWapFatsUnderSlow &&
|
|
!isVWapFatsUnderSlowPrev;
|
|
|
|
//
|
|
bool isClosedOverVWapMin = cBar.close > vwapMin;
|
|
bool isClosedUnderVWapMin = cBar.close < vwapMin;
|
|
|
|
//
|
|
bool isClosedOverVWapMax = cBar.close > vwapMax;
|
|
bool isClosedUnderVWapMax = cBar.close < vwapMax;
|
|
|
|
//
|
|
bool isSarEqualsToPeak =
|
|
conditions.sarBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
|
bool isSarEqualsToVale =
|
|
conditions.sarBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
|
|
|
//
|
|
bool isSarIncreased = conditions.sarBuffer[cIDX] > conditions.sarBuffer[pIDX];
|
|
bool isSarDecreased = conditions.sarBuffer[cIDX] < conditions.sarBuffer[pIDX];
|
|
|
|
//
|
|
double prevSar = conditions.sarBuffer[pIDX];
|
|
double prevStr = conditions.strBuffer[pIDX];
|
|
double prevCheLE1 = conditions.le1Buffer[pIDX];
|
|
double prevCheLE2 = conditions.le2Buffer[pIDX];
|
|
double prevCheSE1 = conditions.se1Buffer[pIDX];
|
|
double prevCheSE2 = conditions.se2Buffer[pIDX];
|
|
double prevAtrUpper = conditions.atrUpperBuffer[pIDX];
|
|
double prevAtrLower = conditions.atrLowerBuffer[pIDX];
|
|
|
|
//
|
|
double ches[];
|
|
if (prevCheLE1 != EMPTY_VALUE)
|
|
{
|
|
//
|
|
Add(
|
|
prevCheLE1,
|
|
ches //
|
|
);
|
|
}
|
|
if (prevCheLE2 != EMPTY_VALUE)
|
|
{
|
|
//
|
|
Add(
|
|
prevCheLE2,
|
|
ches //
|
|
);
|
|
}
|
|
if (prevCheSE1 != EMPTY_VALUE)
|
|
{
|
|
//
|
|
Add(
|
|
prevCheSE1,
|
|
ches //
|
|
);
|
|
}
|
|
if (prevCheSE2 != EMPTY_VALUE)
|
|
{
|
|
//
|
|
Add(
|
|
prevCheSE2,
|
|
ches //
|
|
);
|
|
}
|
|
|
|
//
|
|
double cheMin = GetMin(ches);
|
|
double cheMax = GetMax(ches);
|
|
|
|
//
|
|
bool isSarCrossedUnderPeak =
|
|
conditions.sarBuffer[cIDX] < conditions.peaksBuffer[cIDX] &&
|
|
!(conditions.sarBuffer[pIDX] < conditions.peaksBuffer[pIDX]);
|
|
bool isSarCrossedOverVale =
|
|
conditions.sarBuffer[cIDX] > conditions.valesBuffer[cIDX] &&
|
|
!(conditions.sarBuffer[pIDX] > conditions.valesBuffer[pIDX]);
|
|
|
|
//
|
|
bool isStrEqualsToPeak =
|
|
conditions.strBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
|
bool isStrEqualsToVale =
|
|
conditions.strBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
|
|
|
//
|
|
bool isStrCrossedUnderPeak =
|
|
conditions.strBuffer[cIDX] < conditions.peaksBuffer[cIDX] &&
|
|
!(conditions.strBuffer[pIDX] < conditions.peaksBuffer[pIDX]);
|
|
bool isStrCrossedOverVale =
|
|
conditions.strBuffer[cIDX] > conditions.valesBuffer[cIDX] &&
|
|
!(conditions.strBuffer[pIDX] > conditions.valesBuffer[pIDX]);
|
|
|
|
//
|
|
bool isPeakOverAtrUpper =
|
|
conditions.peaksBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
|
bool isValeUnderAtrLower =
|
|
conditions.valesBuffer[cIDX] > conditions.atrLowerBuffer[cIDX];
|
|
|
|
//
|
|
bool isNewPeakOverAtrUpper =
|
|
isPeakOverAtrUpper &&
|
|
conditions.isNewPeak;
|
|
bool isNewValeUnderAtrLower =
|
|
isValeUnderAtrLower &&
|
|
conditions.isNewVale;
|
|
|
|
//
|
|
bool isStrUpperOverPeak =
|
|
conditions.strBuffer[cIDX] > conditions.peaksBuffer[cIDX];
|
|
bool isStrUpperOverPeakPrev =
|
|
conditions.strBuffer[pIDX] > conditions.peaksBuffer[pIDX];
|
|
|
|
//
|
|
bool isStrUpperUnderPeak =
|
|
conditions.strBuffer[cIDX] < conditions.peaksBuffer[cIDX];
|
|
bool isStrUpperUnderPeakPrev =
|
|
conditions.strBuffer[pIDX] < conditions.peaksBuffer[pIDX];
|
|
|
|
//
|
|
bool isStrUpperCrossedOverPeak = isStrUpperOverPeak &&
|
|
!isStrUpperOverPeakPrev;
|
|
bool isStrUpperCrossedUnderPeak = isStrUpperUnderPeak &&
|
|
!isStrUpperUnderPeakPrev;
|
|
|
|
//
|
|
bool isStrLowerOverVale =
|
|
conditions.strBuffer[cIDX] > conditions.valesBuffer[cIDX];
|
|
bool isStrLowerOverValePrev =
|
|
conditions.strBuffer[pIDX] > conditions.valesBuffer[pIDX];
|
|
|
|
//
|
|
bool isStrLowerUnderVale =
|
|
conditions.strBuffer[cIDX] < conditions.valesBuffer[cIDX];
|
|
bool isStrLowerUnderValePrev =
|
|
conditions.strBuffer[pIDX] < conditions.valesBuffer[pIDX];
|
|
|
|
//
|
|
bool isStrLowerCrossedOverVale = isStrLowerOverVale &&
|
|
!isStrLowerOverValePrev;
|
|
bool isStrLowerCrossedUnderVale = isStrLowerUnderVale &&
|
|
!isStrLowerUnderValePrev;
|
|
|
|
//
|
|
bool isDonHighUpperEqualsToPeak =
|
|
conditions.donHighUpperBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
|
bool isDonLowLowerEqualsToVale =
|
|
conditions.donLowLowerBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
|
|
|
//
|
|
bool isStrUpperOverAtrUpper =
|
|
conditions.strUpBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
|
bool isStrUpperOverAtrUpperPrev =
|
|
conditions.strUpBuffer[pIDX] > conditions.atrUpperBuffer[pIDX];
|
|
bool isStrUpperCrossedOverAtrUpper = isStrUpperOverAtrUpper &&
|
|
!isStrUpperOverAtrUpperPrev;
|
|
|
|
//
|
|
bool isStrUpperUnderAtrUpper =
|
|
conditions.strUpBuffer[cIDX] < conditions.atrUpperBuffer[cIDX];
|
|
bool isStrUpperUnderAtrUpperPrev =
|
|
conditions.strUpBuffer[pIDX] < conditions.atrUpperBuffer[pIDX];
|
|
bool isStrUpperCrossedUnderAtrUpper = isStrUpperUnderAtrUpper &&
|
|
!isStrUpperUnderAtrUpperPrev;
|
|
|
|
//
|
|
bool isStrLowerOverAtrLower =
|
|
conditions.strDownBuffer[cIDX] > conditions.atrLowerBuffer[cIDX];
|
|
bool isStrLowerOverAtrLowerPrev =
|
|
conditions.strDownBuffer[pIDX] > conditions.atrLowerBuffer[pIDX];
|
|
bool isStrLowerCrossedOverAtrLower = isStrLowerOverAtrLower &&
|
|
!isStrLowerOverAtrLowerPrev;
|
|
|
|
//
|
|
bool isStrLowerUnderAtrLower =
|
|
conditions.strDownBuffer[cIDX] < conditions.atrLowerBuffer[cIDX];
|
|
bool isStrLowerUnderAtrLowerPrev =
|
|
conditions.strDownBuffer[pIDX] < conditions.atrLowerBuffer[pIDX];
|
|
bool isStrLowerCrossedUnderAtrLower = isStrLowerUnderAtrLower &&
|
|
!isStrLowerUnderAtrLowerPrev;
|
|
|
|
//
|
|
bool isStrUpperOverDonHighUpper =
|
|
conditions.strUpBuffer[cIDX] > conditions.donHighUpperBuffer[cIDX];
|
|
bool isStrUpperOverDonHighUpperPrev =
|
|
conditions.strUpBuffer[pIDX] > conditions.donHighUpperBuffer[pIDX];
|
|
bool isStrUpperCrossedOverDonHighUpper = isStrUpperOverDonHighUpper &&
|
|
!isStrUpperOverDonHighUpperPrev;
|
|
|
|
//
|
|
bool isStrUpperUnderDonHighUpper =
|
|
conditions.strUpBuffer[cIDX] < conditions.donHighUpperBuffer[cIDX];
|
|
bool isStrUpperUnderDonHighUpperPrev =
|
|
conditions.strUpBuffer[pIDX] < conditions.donHighUpperBuffer[pIDX];
|
|
bool isStrUpperCrossedUnderDonHighUpper = isStrUpperUnderDonHighUpper &&
|
|
!isStrUpperUnderDonHighUpperPrev;
|
|
|
|
//
|
|
bool isStrLowerOverDonLowLower =
|
|
conditions.strDownBuffer[cIDX] > conditions.donLowLowerBuffer[cIDX];
|
|
bool isStrLowerOverDonLowLowerPrev =
|
|
conditions.strDownBuffer[pIDX] > conditions.donLowLowerBuffer[pIDX];
|
|
bool isStrLowerCrossedOverDonLowLower = isStrLowerOverDonLowLower &&
|
|
!isStrLowerOverDonLowLowerPrev;
|
|
|
|
//
|
|
bool isStrLowerUnderDonLowLower =
|
|
conditions.strDownBuffer[cIDX] < conditions.donLowLowerBuffer[cIDX];
|
|
bool isStrLowerUnderDonLowLowerPrev =
|
|
conditions.strDownBuffer[pIDX] < conditions.donLowLowerBuffer[pIDX];
|
|
bool isStrLowerCrossedUnderDonLowLower = isStrLowerUnderDonLowLower &&
|
|
!isStrLowerUnderDonLowLowerPrev;
|
|
|
|
//
|
|
bool isAtrUpperOverPeak = conditions.atrUpperBuffer[cIDX] > conditions.peaksBuffer[cIDX];
|
|
bool isAtrUpperEqualsToPeak = conditions.atrUpperBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
|
|
|
//
|
|
bool isAtrUpperCrossedUpPeak = conditions.atrUpperBuffer[cIDX] > conditions.peaksBuffer[cIDX] &&
|
|
!(conditions.atrUpperBuffer[cIDX] > conditions.peaksBuffer[cIDX]);
|
|
bool isAtrUpperCrossedDownPeak = conditions.atrUpperBuffer[cIDX] < conditions.peaksBuffer[cIDX] &&
|
|
!(conditions.atrUpperBuffer[cIDX] < conditions.peaksBuffer[cIDX]);
|
|
|
|
//
|
|
bool isAtrLowerUnderVale = conditions.atrUpperBuffer[cIDX] < conditions.valesBuffer[cIDX];
|
|
bool isAtrLowerEqualsToVale = conditions.atrUpperBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
|
|
|
//
|
|
bool isAtrLowerCrossedUpVale = conditions.atrUpperBuffer[cIDX] > conditions.valesBuffer[cIDX] &&
|
|
!(conditions.atrUpperBuffer[cIDX] > conditions.valesBuffer[cIDX]);
|
|
bool isAtrLowerCrossedDownVale = conditions.atrUpperBuffer[cIDX] < conditions.valesBuffer[cIDX] &&
|
|
!(conditions.atrUpperBuffer[cIDX] < conditions.valesBuffer[cIDX]);
|
|
|
|
//
|
|
conditions.cheMin = cheMin;
|
|
conditions.cheMax = cheMax;
|
|
conditions.x3maMin = x3maMin;
|
|
conditions.x3maMax = x3maMax;
|
|
conditions.vwapMin = vwapMin;
|
|
conditions.vwapMax = vwapMax;
|
|
|
|
//
|
|
conditions.isSarIncreased = isSarIncreased;
|
|
conditions.isSarDecreased = isSarDecreased;
|
|
conditions.isSarEqualsToPeak = isSarEqualsToPeak;
|
|
conditions.isSarEqualsToVale = isSarEqualsToVale;
|
|
conditions.isStrEqualsToPeak = isStrEqualsToPeak;
|
|
conditions.isStrEqualsToVale = isStrEqualsToVale;
|
|
conditions.isX3MaFatsOverMid = isX3MaFatsOverMid;
|
|
conditions.isX3MaFatsUnderMid = isX3MaFatsUnderMid;
|
|
conditions.isX3MaFatsOverSlow = isX3MaFatsOverSlow;
|
|
conditions.isStrUpperOverPeak = isStrUpperOverPeak;
|
|
conditions.isPeakOverAtrUpper = isPeakOverAtrUpper;
|
|
conditions.isStrLowerOverVale = isStrLowerOverVale;
|
|
conditions.isAtrUpperOverPeak = isAtrUpperOverPeak;
|
|
conditions.isClosedOverX3MaMin = isClosedOverX3MaMin;
|
|
conditions.isClosedOverX3MaMax = isClosedOverX3MaMax;
|
|
conditions.isX3MaFatsUnderSlow = isX3MaFatsUnderSlow;
|
|
conditions.isAtrLowerUnderVale = isAtrLowerUnderVale;
|
|
conditions.isStrLowerUnderVale = isStrLowerUnderVale;
|
|
conditions.isStrUpperUnderPeak = isStrUpperUnderPeak;
|
|
conditions.isValeUnderAtrLower = isValeUnderAtrLower;
|
|
conditions.isClosedOverVWapMin = isClosedOverVWapMin;
|
|
conditions.isClosedOverVWapMax = isClosedOverVWapMax;
|
|
conditions.isClosedUnderX3MaMin = isClosedUnderX3MaMin;
|
|
conditions.isClosedUnderX3MaMax = isClosedUnderX3MaMax;
|
|
conditions.isClosedUnderVWapMin = isClosedUnderVWapMin;
|
|
conditions.isClosedUnderVWapMax = isClosedUnderVWapMax;
|
|
conditions.isSarCrossedOverVale = isSarCrossedOverVale;
|
|
conditions.isStrCrossedOverVale = isStrCrossedOverVale;
|
|
conditions.isX3MaFatsOverMidPrev = isX3MaFatsOverMidPrev;
|
|
conditions.isSarCrossedUnderPeak = isSarCrossedUnderPeak;
|
|
conditions.isStrCrossedUnderPeak = isStrCrossedUnderPeak;
|
|
conditions.isNewPeakOverAtrUpper = isNewPeakOverAtrUpper;
|
|
conditions.isX3MaFatsUnderMidPrev = isX3MaFatsUnderMidPrev;
|
|
conditions.isX3MaFatsOverSlowPrev = isX3MaFatsOverSlowPrev;
|
|
conditions.isAtrUpperEqualsToPeak = isAtrUpperEqualsToPeak;
|
|
conditions.isAtrLowerEqualsToVale = isAtrLowerEqualsToVale;
|
|
conditions.isNewValeUnderAtrLower = isNewValeUnderAtrLower;
|
|
conditions.isStrUpperOverAtrUpper = isStrUpperOverAtrUpper;
|
|
conditions.isStrLowerOverAtrLower = isStrLowerOverAtrLower;
|
|
conditions.isX3MaFatsUnderSlowPrev = isX3MaFatsUnderSlowPrev;
|
|
conditions.isStrUpperUnderAtrUpper = isStrUpperUnderAtrUpper;
|
|
conditions.isStrLowerUnderAtrLower = isStrLowerUnderAtrLower;
|
|
conditions.isAtrUpperCrossedUpPeak = isAtrUpperCrossedUpPeak;
|
|
conditions.isAtrLowerCrossedUpVale = isAtrLowerCrossedUpVale;
|
|
conditions.isX3MaFastCrossedOverMid = isX3MaFastCrossedOverMid;
|
|
conditions.isVWapFastCrossedOverMid = isVWapFastCrossedOverMid;
|
|
conditions.isX3MaFastCrossedUnderMid = isX3MaFastCrossedUnderMid;
|
|
conditions.isX3MaFastCrossedOverSlow = isX3MaFastCrossedOverSlow;
|
|
conditions.isAtrUpperCrossedDownPeak = isAtrUpperCrossedDownPeak;
|
|
conditions.isAtrLowerCrossedDownVale = isAtrLowerCrossedDownVale;
|
|
conditions.isVWapFastCrossedUnderMid = isVWapFastCrossedUnderMid;
|
|
conditions.isDonLowLowerEqualsToVale = isDonLowLowerEqualsToVale;
|
|
conditions.isStrUpperCrossedOverPeak = isStrUpperCrossedOverPeak;
|
|
conditions.isStrLowerCrossedOverVale = isStrLowerCrossedOverVale;
|
|
conditions.isStrLowerOverDonLowLower = isStrLowerOverDonLowLower;
|
|
conditions.isVWapFastCrossedOverSlow = isVWapFastCrossedOverSlow;
|
|
conditions.isX3MaFastCrossedUnderSlow = isX3MaFastCrossedUnderSlow;
|
|
conditions.isVWapFastCrossedUnderSlow = isVWapFastCrossedUnderSlow;
|
|
conditions.isStrUpperOverDonHighUpper = isStrUpperOverDonHighUpper;
|
|
conditions.isStrLowerUnderDonLowLower = isStrLowerUnderDonLowLower;
|
|
conditions.isDonHighUpperEqualsToPeak = isDonHighUpperEqualsToPeak;
|
|
conditions.isStrUpperCrossedUnderPeak = isStrUpperCrossedUnderPeak;
|
|
conditions.isStrLowerCrossedUnderVale = isStrLowerCrossedUnderVale;
|
|
conditions.isStrUpperUnderDonHighUpper = isStrUpperUnderDonHighUpper;
|
|
conditions.isStrLowerCrossedOverAtrLower = isStrLowerCrossedOverAtrLower;
|
|
conditions.isStrUpperCrossedOverAtrUpper = isStrUpperCrossedOverAtrUpper;
|
|
conditions.isStrUpperCrossedUnderAtrUpper = isStrUpperCrossedUnderAtrUpper;
|
|
conditions.isStrLowerCrossedUnderAtrLower = isStrLowerCrossedUnderAtrLower;
|
|
conditions.isStrLowerCrossedOverDonLowLower = isStrLowerCrossedOverDonLowLower;
|
|
conditions.isStrUpperCrossedOverDonHighUpper = isStrUpperCrossedOverDonHighUpper;
|
|
conditions.isStrLowerCrossedUnderDonLowLower = isStrLowerCrossedUnderDonLowLower;
|
|
conditions.isStrUpperCrossedUnderDonHighUpper = isStrUpperCrossedUnderDonHighUpper;
|
|
|
|
//
|
|
//
|
|
xpvConditions.Clean();
|
|
xhkConditions.Clean();
|
|
xichConditions.Clean();
|
|
xmasConditions.Clean();
|
|
xatrConditions.Clean();
|
|
xstrConditions.Clean();
|
|
xcheConditions.Clean();
|
|
xdonConditions.Clean();
|
|
x3maConditions.Clean();
|
|
xvwapConditions.Clean();
|
|
|
|
//
|
|
Free();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
protected:
|
|
//
|
|
|
|
//
|
|
private:
|
|
//
|
|
|
|
//
|
|
string mSymbol; // Trading Symbol
|
|
ENUM_TIMEFRAMES mPeriod; // Trading Period
|
|
|
|
//
|
|
// Inputs ...
|
|
X121Inputs mInputs;
|
|
X121XCCInputs xccInputs;
|
|
X121XPVInputs xpvInputs;
|
|
X121XHKInputs xhkInputs;
|
|
X121XICHInputs xichInputs;
|
|
X121XMASInputs xmasInputs;
|
|
X121XATRInputs xatrInputs;
|
|
X121XDONInputs xdonInputs;
|
|
X121XSTRInputs xstrInputs;
|
|
X121XCHEInputs xcheInputs;
|
|
X121X3MAInputs x3maInputs;
|
|
X121XVWAPInputs xvwapInputs;
|
|
X121XDELTAInputs xdeltaInputs;
|
|
X121XVOLUMEInputs xvolumeInputs;
|
|
|
|
//
|
|
int mRSIHandler;
|
|
};
|
|
|
|
// |