3380 lines
112 KiB
Plaintext
3380 lines
112 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.xatr.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xche.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xdon.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xhk.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xpv.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xstr.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xtrend.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xvwap.helper.mq5"
|
|
|
|
//
|
|
// Inputs ...
|
|
struct X121Inputs
|
|
{
|
|
//
|
|
// Props ...
|
|
bool showRSI;
|
|
X121XPVInputs xpvInputs;
|
|
X121XHKInputs xhkInputs;
|
|
X121XATRInputs xatrInputs;
|
|
X121XSTRInputs xstrInputs;
|
|
X121XCHEInputs xcheInputs;
|
|
X121XDONInputs xdonInputs;
|
|
X121XVWAPInputs xvwapInputs;
|
|
X121XTRENDInputs xtrendInputs;
|
|
|
|
//
|
|
// Constructor ...
|
|
X121Inputs()
|
|
{
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Cleaning Up ...
|
|
*/
|
|
void Clean()
|
|
{
|
|
//
|
|
xpvInputs.Clean();
|
|
xhkInputs.Clean();
|
|
xatrInputs.Clean();
|
|
xstrInputs.Clean();
|
|
xcheInputs.Clean();
|
|
xdonInputs.Clean();
|
|
xvwapInputs.Clean();
|
|
xtrendInputs.Clean();
|
|
|
|
//
|
|
ZeroMemory(this);
|
|
}
|
|
|
|
/**
|
|
* Set Default Values ...
|
|
*/
|
|
void Default()
|
|
{
|
|
//
|
|
xpvInputs.Default();
|
|
xhkInputs.Default();
|
|
xatrInputs.Default();
|
|
xstrInputs.Default();
|
|
xcheInputs.Default();
|
|
xdonInputs.Default();
|
|
xvwapInputs.Default();
|
|
xtrendInputs.Default();
|
|
}
|
|
|
|
/**
|
|
* Validate ...
|
|
*
|
|
* @return ( bool )
|
|
*/
|
|
bool IsValid()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
xpvInputs.IsValid() &&
|
|
xhkInputs.IsValid() &&
|
|
xatrInputs.IsValid() &&
|
|
xstrInputs.IsValid() &&
|
|
xcheInputs.IsValid() &&
|
|
xdonInputs.IsValid() &&
|
|
xvwapInputs.IsValid() &&
|
|
xtrendInputs.IsValid()
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Extract Max Input Length ...
|
|
*
|
|
* @return ( int )
|
|
*/
|
|
int Max()
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
int xpvMax = xpvInputs.Max();
|
|
int xhkMax = xpvInputs.Max();
|
|
int xatrMax = xatrInputs.Max();
|
|
int xstrMax = xstrInputs.Max();
|
|
int xcheMax = xcheInputs.Max();
|
|
int xdonMax = xdonInputs.Max();
|
|
int xvwapMax = xvwapInputs.Max();
|
|
int xtrendMax = xtrendInputs.Max();
|
|
|
|
//
|
|
result = MathMax(xpvMax, xhkMax);
|
|
result = MathMax(result, xatrMax);
|
|
result = MathMax(result, xstrMax);
|
|
result = MathMax(result, xcheMax);
|
|
result = MathMax(result, xdonMax);
|
|
result = MathMax(result, xvwapMax);
|
|
result = MathMax(result, xtrendMax);
|
|
|
|
//
|
|
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 strDownBuffer[];
|
|
double vwapMidBuffer[];
|
|
double upTrendBuffer[];
|
|
double le1StartBuffer[];
|
|
double se1StartBuffer[];
|
|
double le2StartBuffer[];
|
|
double se2StartBuffer[];
|
|
double strPriceBuffer[];
|
|
double atrUpperBuffer[];
|
|
double atrLowerBuffer[];
|
|
double strStateBuffer[];
|
|
double vwapFastBuffer[];
|
|
double vwapSlowBuffer[];
|
|
double xhkSMLowBuffer[];
|
|
double downTrendBuffer[];
|
|
double vwapPriceBuffer[];
|
|
double xhkRawLowBuffer[];
|
|
double xhkSMOpenBuffer[];
|
|
double xhkSMHighBuffer[];
|
|
double xhkRawOpenBuffer[];
|
|
double xhkRawHighBuffer[];
|
|
double xhkSMCloseBuffer[];
|
|
double vwapVolumeBuffer[];
|
|
double xhkRawCloseBuffer[];
|
|
double atrUpperRawBuffer[];
|
|
double atrLowerRawBuffer[];
|
|
double donLowUpperBuffer[];
|
|
double donLowLowerBuffer[];
|
|
double vwapMidStateBuffer[];
|
|
double donOpenUpperBuffer[];
|
|
double donOpenLowerBuffer[];
|
|
double donHighUpperBuffer[];
|
|
double donHighLowerBuffer[];
|
|
double vwapFastStateBuffer[];
|
|
double vwapSlowStateBuffer[];
|
|
double donCloseUpperBuffer[];
|
|
double donCloseLowerBuffer[];
|
|
|
|
//
|
|
double rsiSlope;
|
|
double strSlope;
|
|
double atrUpperSlope;
|
|
double atrLowerSlope;
|
|
double vwapFastSlope;
|
|
double vwapMidSlope;
|
|
double vwapSlowSlope;
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
// XTrend ...
|
|
|
|
//
|
|
bool isTrendBullish;
|
|
bool isTrendBearish;
|
|
bool isTrendSwitchedToBullish;
|
|
bool isTrendSwitchedToBearish;
|
|
|
|
//
|
|
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 isRejectedUpAtrUpper;
|
|
bool isRejectedDownAtrUpper;
|
|
|
|
//
|
|
bool isRejectedUpAtrLower;
|
|
bool isRejectedDownAtrLower;
|
|
|
|
//
|
|
bool isBreakedUpAtrUpper;
|
|
bool isBreakedDownAtrUpper;
|
|
|
|
//
|
|
bool isBreakedUpAtrLower;
|
|
bool isBreakedDownAtrLower;
|
|
|
|
//
|
|
bool isRejectedDonOpenUpper;
|
|
bool isRejectedDonHighUpper;
|
|
bool isRejectedDonLowUpper;
|
|
bool isRejectedDonCloseUpper;
|
|
|
|
//
|
|
bool isRejectedDonOpenLower;
|
|
bool isRejectedDonHighLower;
|
|
bool isRejectedDonLowLower;
|
|
bool isRejectedDonCloseLower;
|
|
|
|
//
|
|
bool isBreakedDonOpenUpper;
|
|
bool isBreakedDonHighUpper;
|
|
bool isBreakedDonLowUpper;
|
|
bool isBreakedDonCloseUpper;
|
|
|
|
//
|
|
bool isBreakedDonOpenLower;
|
|
bool isBreakedDonHighLower;
|
|
bool isBreakedDonLowLower;
|
|
bool isBreakedDonCloseLower;
|
|
|
|
//
|
|
bool isSarBullish;
|
|
bool isSarBearish;
|
|
bool isSarSwitchedToBullish;
|
|
bool isSarSwitchedToBearish;
|
|
|
|
//
|
|
bool isNewPeak;
|
|
bool isNewPeakOverLast;
|
|
bool isNewPeakUnderLast;
|
|
bool isRejectedPrevPeak;
|
|
bool isBreakedUpPrevPeak;
|
|
|
|
//
|
|
bool isNewVale;
|
|
bool isNewValeOverLast;
|
|
bool isNewValeUnderLast;
|
|
bool isRejectedPrevVale;
|
|
bool isBreakedDownPrevVale;
|
|
|
|
//
|
|
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 isSMHKBullish;
|
|
bool isRawHKBullish;
|
|
bool isSMHKBearish;
|
|
bool isRawHKBearish;
|
|
bool isBreakedUpSMHK;
|
|
bool isBreakedUpRawHK;
|
|
bool isRejectedUpSMHK;
|
|
bool isClosedOverSMHK;
|
|
bool isRejectedUpRawHK;
|
|
bool isBreakedDownSMHK;
|
|
bool isClosedUnderSMHK;
|
|
bool isClosedOverRawHK;
|
|
bool isClosedUnderRawHK;
|
|
bool isBreakedDownRawHK;
|
|
bool isRejectedDownSMHK;
|
|
bool isRejectedDownRawHK;
|
|
bool isRawHKBreakedUpSMHK;
|
|
bool isRawHKClosedOverSMHK;
|
|
bool isRawHKClosedUnderSMHK;
|
|
bool isRawHKBreakedDownSMHK;
|
|
bool isSMHKSwitchedToBullish;
|
|
bool isSMHKSwitchedToBearish;
|
|
bool isRawHKSwitchedToBearish;
|
|
bool isRawHKSwitchedToBullish;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
double cheMin;
|
|
double cheMax;
|
|
double vwapMin;
|
|
double vwapMax;
|
|
|
|
//
|
|
bool isBreakedUpPrevCheMin;
|
|
bool isBreakedUpPrevCheMax;
|
|
bool isBreakedDownPrevCheMin;
|
|
bool isBreakedDownPrevCheMax;
|
|
bool isBreakedUpPrevCheLE1;
|
|
bool isBreakedUpPrevCheLE2;
|
|
bool isBreakedUpPrevCheSE1;
|
|
bool isBreakedUpPrevCheSE2;
|
|
bool isBreakedDownPrevCheLE1;
|
|
bool isBreakedDownPrevCheLE2;
|
|
bool isBreakedDownPrevCheSE1;
|
|
bool isBreakedDownPrevCheSE2;
|
|
|
|
//
|
|
bool isClosedOverCheMin;
|
|
bool isClosedOverCheMax;
|
|
bool isClosedUnderCheMin;
|
|
bool isClosedUnderCheMax;
|
|
|
|
//
|
|
bool isSarIncreased;
|
|
bool isSarDecreased;
|
|
|
|
//
|
|
bool isVWapMinBreakedUp;
|
|
bool isVWapMaxBreakedUp;
|
|
|
|
//
|
|
bool isVWapMinBreakedDown;
|
|
bool isVWapMaxBreakedDown;
|
|
|
|
//
|
|
bool isClosedOverVWapMin;
|
|
bool isClosedUnderVWapMin;
|
|
|
|
//
|
|
bool isClosedOverVWapMax;
|
|
bool isClosedUnderVWapMax;
|
|
|
|
//
|
|
bool isVWapFastCrossedOverMid;
|
|
bool isVWapFastCrossedUnderMid;
|
|
|
|
//
|
|
bool isVWapFastCrossedOverSlow;
|
|
bool isVWapFastCrossedUnderSlow;
|
|
|
|
//
|
|
bool isBreakedUpPrevSar;
|
|
bool isBreakedDownPrevSar;
|
|
|
|
//
|
|
bool isBreakedUpPrevStr;
|
|
bool isBreakedDownPrevStr;
|
|
|
|
//
|
|
bool isBreakedUpPrevAtrUpper;
|
|
bool isBreakedDownPrevAtrUpper;
|
|
|
|
//
|
|
bool isBreakedUpPrevAtrLower;
|
|
bool isBreakedDownPrevAtrLower;
|
|
|
|
//
|
|
bool isRejectedUpPrevAtrUpper;
|
|
bool isRejectedDownPrevAtrUpper;
|
|
|
|
//
|
|
bool isRejectedUpPrevAtrLower;
|
|
bool isRejectedDownPrevAtrLower;
|
|
|
|
//
|
|
bool isSarEqualsToPeak;
|
|
bool isSarEqualsToVale;
|
|
|
|
//
|
|
bool isSarCrossedUnderPeak;
|
|
bool isSarCrossedOverVale;
|
|
|
|
//
|
|
bool isStrEqualsToPeak;
|
|
bool isStrEqualsToVale;
|
|
|
|
//
|
|
bool isStrCrossedUnderPeak;
|
|
bool isStrCrossedOverVale;
|
|
|
|
//
|
|
bool isPeakOverAtrUpper;
|
|
bool isValeUnderAtrLower;
|
|
|
|
//
|
|
bool isNewPeakOverAtrUpper;
|
|
bool isNewValeUnderAtrLower;
|
|
|
|
//
|
|
bool isStrUpperOverPeak;
|
|
bool isStrUpperUnderPeak;
|
|
|
|
//
|
|
bool isStrUpperCrossedOverPeak;
|
|
bool isStrUpperCrossedUnderPeak;
|
|
|
|
//
|
|
bool isStrLowerOverVale;
|
|
bool isStrLowerUnderVale;
|
|
|
|
//
|
|
bool isStrLowerCrossedOverVale;
|
|
bool isStrLowerCrossedUnderVale;
|
|
|
|
//
|
|
bool isDonHighUpperEqualsToPeak;
|
|
bool isDonLowLowerEqualsToVale;
|
|
|
|
//
|
|
bool isStrUpperOverAtrUpper;
|
|
bool isStrUpperUnderAtrUpper;
|
|
|
|
//
|
|
bool isStrLowerOverAtrLower;
|
|
bool isStrLowerUnderAtrLower;
|
|
|
|
//
|
|
bool isStrUpperCrossedOverAtrUpper;
|
|
bool isStrUpperCrossedUnderAtrUpper;
|
|
|
|
//
|
|
bool isStrLowerCrossedOverAtrLower;
|
|
bool isStrLowerCrossedUnderAtrLower;
|
|
|
|
//
|
|
bool isStrUpperOverDonHighUpper;
|
|
bool isStrUpperUnderDonHighUpper;
|
|
|
|
//
|
|
bool isStrLowerOverDonLowLower;
|
|
bool isStrLowerUnderDonLowLower;
|
|
|
|
//
|
|
bool isStrUpperCrossedOverDonHighUpper;
|
|
bool isStrUpperCrossedUnderDonHighUpper;
|
|
|
|
//
|
|
bool isStrLowerCrossedOverDonLowLower;
|
|
bool isStrLowerCrossedUnderDonLowLower;
|
|
|
|
//
|
|
bool isAtrUpperOverPeak;
|
|
bool isAtrUpperEqualsToPeak;
|
|
bool isAtrUpperCrossedUpPeak;
|
|
bool isAtrUpperCrossedDownPeak;
|
|
|
|
//
|
|
bool isAtrLowerUnderVale;
|
|
bool isAtrLowerEqualsToVale;
|
|
bool isAtrLowerCrossedUpVale;
|
|
bool isAtrLowerCrossedDownVale;
|
|
|
|
//
|
|
// 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(volumeBuffer);
|
|
Clean(peaksBuffer);
|
|
Clean(valesBuffer);
|
|
Clean(strUpBuffer);
|
|
Clean(downTBuffer);
|
|
Clean(strDownBuffer);
|
|
Clean(vwapMidBuffer);
|
|
Clean(upTrendBuffer);
|
|
Clean(le1StartBuffer);
|
|
Clean(se1StartBuffer);
|
|
Clean(le2StartBuffer);
|
|
Clean(se2StartBuffer);
|
|
Clean(strPriceBuffer);
|
|
Clean(atrUpperBuffer);
|
|
Clean(atrLowerBuffer);
|
|
Clean(strStateBuffer);
|
|
Clean(vwapFastBuffer);
|
|
Clean(vwapSlowBuffer);
|
|
Clean(xhkSMLowBuffer);
|
|
Clean(downTrendBuffer);
|
|
Clean(vwapPriceBuffer);
|
|
Clean(xhkRawLowBuffer);
|
|
Clean(xhkSMOpenBuffer);
|
|
Clean(xhkSMHighBuffer);
|
|
Clean(xhkRawOpenBuffer);
|
|
Clean(xhkRawHighBuffer);
|
|
Clean(xhkSMCloseBuffer);
|
|
Clean(vwapVolumeBuffer);
|
|
Clean(xhkRawCloseBuffer);
|
|
Clean(atrUpperRawBuffer);
|
|
Clean(atrLowerRawBuffer);
|
|
Clean(donLowUpperBuffer);
|
|
Clean(donLowLowerBuffer);
|
|
Clean(vwapMidStateBuffer);
|
|
Clean(donOpenUpperBuffer);
|
|
Clean(donOpenLowerBuffer);
|
|
Clean(donHighUpperBuffer);
|
|
Clean(donHighLowerBuffer);
|
|
Clean(vwapFastStateBuffer);
|
|
Clean(vwapSlowStateBuffer);
|
|
Clean(donCloseUpperBuffer);
|
|
Clean(donCloseLowerBuffer);
|
|
|
|
//
|
|
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(volumeBuffer, true);
|
|
ArraySetAsSeries(peaksBuffer, true);
|
|
ArraySetAsSeries(valesBuffer, true);
|
|
ArraySetAsSeries(strUpBuffer, true);
|
|
ArraySetAsSeries(downTBuffer, true);
|
|
ArraySetAsSeries(strDownBuffer, true);
|
|
ArraySetAsSeries(vwapMidBuffer, true);
|
|
ArraySetAsSeries(upTrendBuffer, 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(downTrendBuffer, true);
|
|
ArraySetAsSeries(vwapPriceBuffer, true);
|
|
ArraySetAsSeries(xhkRawLowBuffer, true);
|
|
ArraySetAsSeries(xhkSMOpenBuffer, true);
|
|
ArraySetAsSeries(xhkSMHighBuffer, true);
|
|
ArraySetAsSeries(xhkRawOpenBuffer, true);
|
|
ArraySetAsSeries(xhkRawHighBuffer, true);
|
|
ArraySetAsSeries(xhkSMCloseBuffer, true);
|
|
ArraySetAsSeries(vwapVolumeBuffer, true);
|
|
ArraySetAsSeries(xhkRawCloseBuffer, true);
|
|
ArraySetAsSeries(atrUpperRawBuffer, true);
|
|
ArraySetAsSeries(atrLowerRawBuffer, true);
|
|
ArraySetAsSeries(donLowUpperBuffer, true);
|
|
ArraySetAsSeries(donLowLowerBuffer, true);
|
|
ArraySetAsSeries(vwapMidStateBuffer, true);
|
|
ArraySetAsSeries(donOpenUpperBuffer, true);
|
|
ArraySetAsSeries(donOpenLowerBuffer, true);
|
|
ArraySetAsSeries(donHighUpperBuffer, true);
|
|
ArraySetAsSeries(donHighLowerBuffer, true);
|
|
ArraySetAsSeries(vwapFastStateBuffer, true);
|
|
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
|
ArraySetAsSeries(donCloseUpperBuffer, true);
|
|
ArraySetAsSeries(donCloseLowerBuffer, true);
|
|
|
|
//
|
|
cheMin = 0;
|
|
cheMax = 0;
|
|
vwapMin = 0;
|
|
vwapMax = 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;
|
|
|
|
//
|
|
isRejectedUpAtrUpper = false;
|
|
isRejectedDownAtrUpper = false;
|
|
|
|
//
|
|
isRejectedUpAtrLower = false;
|
|
isRejectedDownAtrLower = false;
|
|
|
|
//
|
|
isBreakedUpAtrUpper = false;
|
|
isBreakedDownAtrUpper = false;
|
|
|
|
//
|
|
isBreakedUpAtrLower = false;
|
|
isBreakedDownAtrLower = false;
|
|
|
|
//
|
|
// DON ...
|
|
|
|
//
|
|
isRejectedDonOpenUpper = false;
|
|
isRejectedDonHighUpper = false;
|
|
isRejectedDonLowUpper = false;
|
|
isRejectedDonCloseUpper = false;
|
|
|
|
//
|
|
isRejectedDonOpenLower = false;
|
|
isRejectedDonHighLower = false;
|
|
isRejectedDonLowLower = false;
|
|
isRejectedDonCloseLower = false;
|
|
|
|
//
|
|
isBreakedDonOpenUpper = false;
|
|
isBreakedDonHighUpper = false;
|
|
isBreakedDonLowUpper = false;
|
|
isBreakedDonCloseUpper = false;
|
|
|
|
//
|
|
isBreakedDonOpenLower = false;
|
|
isBreakedDonHighLower = false;
|
|
isBreakedDonLowLower = false;
|
|
isBreakedDonCloseLower = false;
|
|
|
|
//
|
|
// SAR ...
|
|
|
|
//
|
|
isSarBullish = false;
|
|
isSarBearish = false;
|
|
|
|
//
|
|
isSarSwitchedToBullish = false;
|
|
isSarSwitchedToBearish = false;
|
|
|
|
//
|
|
// PV ...
|
|
|
|
//
|
|
isNewPeak = false;
|
|
isNewPeakOverLast = false;
|
|
isNewPeakUnderLast = false;
|
|
isRejectedPrevPeak = false;
|
|
isBreakedUpPrevPeak = false;
|
|
|
|
//
|
|
isNewVale = false;
|
|
isNewValeOverLast = false;
|
|
isNewValeUnderLast = false;
|
|
isRejectedPrevVale = false;
|
|
isBreakedDownPrevVale = false;
|
|
|
|
//
|
|
// STR ...
|
|
|
|
//
|
|
isStrBullish = false;
|
|
isStrBearish = false;
|
|
|
|
//
|
|
isStrSwitchedToBullish = false;
|
|
isStrSwitchedToBearish = false;
|
|
|
|
//
|
|
// VWAP ...
|
|
|
|
//
|
|
isVWapFastBullish = false;
|
|
isVWapFastBearish = false;
|
|
isVWapFastNeutural = false;
|
|
|
|
//
|
|
isVWapMidBullish = false;
|
|
isVWapMidBearish = false;
|
|
isVWapMidNeutural = false;
|
|
|
|
//
|
|
isVWapSlowBullish = false;
|
|
isVWapSlowBearish = false;
|
|
isVWapSlowNeutural = false;
|
|
|
|
//
|
|
isVWapFastOverMid = false;
|
|
isVWapMidOverSlow = 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;
|
|
|
|
//
|
|
// CHE ...
|
|
|
|
//
|
|
isChe1Bullish = false;
|
|
isChe1Bearish = false;
|
|
|
|
//
|
|
isChe1SwitchedToBullish = false;
|
|
isChe1SwitchedToBearish = false;
|
|
|
|
//
|
|
isChe2Bullish = false;
|
|
isChe2Bearish = false;
|
|
|
|
//
|
|
isChe2SwitchedToBullish = false;
|
|
isChe2SwitchedToBearish = false;
|
|
|
|
//
|
|
isCheBullish = false;
|
|
isCheBearish = false;
|
|
|
|
//
|
|
isCheSwitchedToBullish = false;
|
|
isCheSwitchedToBearish = false;
|
|
|
|
//
|
|
isClosedOverCheMin = false;
|
|
isClosedOverCheMax = false;
|
|
|
|
//
|
|
isClosedUnderCheMin = false;
|
|
isClosedUnderCheMax = false;
|
|
|
|
//
|
|
// XHK ...
|
|
isSMHKBullish = false;
|
|
isRawHKBullish = false;
|
|
isSMHKBearish = false;
|
|
isRawHKBearish = false;
|
|
isBreakedUpSMHK = false;
|
|
isBreakedUpRawHK = false;
|
|
isRejectedUpSMHK = false;
|
|
isClosedOverSMHK = false;
|
|
isRejectedUpRawHK = false;
|
|
isBreakedDownSMHK = false;
|
|
isClosedUnderSMHK = false;
|
|
isClosedOverRawHK = false;
|
|
isClosedUnderRawHK = false;
|
|
isBreakedDownRawHK = false;
|
|
isRejectedDownSMHK = false;
|
|
isRejectedDownRawHK = false;
|
|
isRawHKBreakedUpSMHK = false;
|
|
isRawHKClosedOverSMHK = false;
|
|
isSMHKSwitchedToBearish = false;
|
|
isRawHKSwitchedToBearish = false;
|
|
isRawHKClosedUnderSMHK = false;
|
|
isRawHKBreakedDownSMHK = false;
|
|
isSMHKSwitchedToBullish = false;
|
|
isRawHKSwitchedToBullish = false;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
isVWapMinBreakedUp = false;
|
|
isVWapMaxBreakedUp = false;
|
|
|
|
//
|
|
isVWapMinBreakedDown = false;
|
|
isVWapMaxBreakedDown = false;
|
|
|
|
//
|
|
isClosedOverVWapMin = false;
|
|
isClosedUnderVWapMin = false;
|
|
|
|
//
|
|
isClosedOverVWapMax = false;
|
|
isClosedUnderVWapMax = false;
|
|
|
|
//
|
|
isVWapFastCrossedOverMid = false;
|
|
isVWapFastCrossedUnderMid = false;
|
|
|
|
//
|
|
isVWapFastCrossedOverSlow = false;
|
|
isVWapFastCrossedUnderSlow = false;
|
|
|
|
//
|
|
isBreakedUpPrevSar = false;
|
|
isBreakedDownPrevSar = false;
|
|
|
|
//
|
|
isBreakedUpPrevStr = false;
|
|
isBreakedDownPrevStr = false;
|
|
|
|
//
|
|
isBreakedUpPrevAtrUpper = false;
|
|
isBreakedDownPrevAtrUpper = false;
|
|
|
|
//
|
|
isRejectedUpPrevAtrUpper = false;
|
|
isRejectedDownPrevAtrUpper = false;
|
|
|
|
//
|
|
isBreakedUpPrevAtrLower = false;
|
|
isBreakedDownPrevAtrLower = false;
|
|
|
|
//
|
|
isRejectedUpPrevAtrLower = false;
|
|
isRejectedDownPrevAtrLower = false;
|
|
|
|
//
|
|
isBreakedUpPrevCheMin = false;
|
|
isBreakedUpPrevCheMax = false;
|
|
isBreakedDownPrevCheMin = false;
|
|
isBreakedDownPrevCheMax = false;
|
|
isBreakedUpPrevCheLE1 = false;
|
|
isBreakedUpPrevCheLE2 = false;
|
|
isBreakedUpPrevCheSE1 = false;
|
|
isBreakedUpPrevCheSE2 = false;
|
|
isBreakedDownPrevCheLE1 = false;
|
|
isBreakedDownPrevCheLE2 = false;
|
|
isBreakedDownPrevCheSE1 = false;
|
|
isBreakedDownPrevCheSE2 = false;
|
|
|
|
//
|
|
isSarIncreased = false;
|
|
isSarDecreased = false;
|
|
|
|
//
|
|
isSarEqualsToPeak = false;
|
|
isSarEqualsToVale = false;
|
|
|
|
//
|
|
isSarCrossedUnderPeak = false;
|
|
isSarCrossedOverVale = false;
|
|
|
|
//
|
|
isStrEqualsToPeak = false;
|
|
isStrEqualsToVale = false;
|
|
|
|
//
|
|
isStrCrossedUnderPeak = false;
|
|
isStrCrossedOverVale = false;
|
|
|
|
//
|
|
isPeakOverAtrUpper = false;
|
|
isValeUnderAtrLower = false;
|
|
|
|
//
|
|
isNewPeakOverAtrUpper = false;
|
|
isNewValeUnderAtrLower = false;
|
|
|
|
//
|
|
isStrUpperOverPeak = false;
|
|
isStrUpperUnderPeak = false;
|
|
|
|
//
|
|
isStrUpperCrossedOverPeak = false;
|
|
isStrUpperCrossedUnderPeak = false;
|
|
|
|
//
|
|
isStrLowerOverVale = false;
|
|
isStrLowerUnderVale = false;
|
|
|
|
//
|
|
isAtrUpperOverPeak = false;
|
|
isAtrUpperEqualsToPeak = false;
|
|
isAtrUpperCrossedUpPeak = false;
|
|
isAtrUpperCrossedDownPeak = false;
|
|
|
|
//
|
|
isAtrLowerUnderVale = false;
|
|
isAtrLowerEqualsToVale = false;
|
|
isAtrLowerCrossedUpVale = false;
|
|
isAtrLowerCrossedDownVale = false;
|
|
|
|
//
|
|
isStrLowerCrossedOverVale = false;
|
|
isStrLowerCrossedUnderVale = false;
|
|
|
|
//
|
|
isDonHighUpperEqualsToPeak = false;
|
|
isDonLowLowerEqualsToVale = false;
|
|
|
|
//
|
|
isStrUpperOverAtrUpper = false;
|
|
isStrUpperUnderAtrUpper = false;
|
|
|
|
//
|
|
isStrLowerOverAtrLower = false;
|
|
isStrLowerUnderAtrLower = false;
|
|
|
|
//
|
|
isStrUpperCrossedOverAtrUpper = false;
|
|
isStrUpperCrossedUnderAtrUpper = false;
|
|
|
|
//
|
|
isStrLowerCrossedOverAtrLower = false;
|
|
isStrLowerCrossedUnderAtrLower = false;
|
|
|
|
//
|
|
isStrUpperOverDonHighUpper = false;
|
|
isStrUpperUnderDonHighUpper = false;
|
|
|
|
//
|
|
isStrLowerOverDonLowLower = false;
|
|
isStrLowerUnderDonLowLower = false;
|
|
|
|
//
|
|
isStrUpperCrossedOverDonHighUpper = false;
|
|
isStrUpperCrossedUnderDonHighUpper = false;
|
|
|
|
//
|
|
isStrLowerCrossedOverDonLowLower = false;
|
|
isStrLowerCrossedUnderDonLowLower = 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;
|
|
}
|
|
|
|
/**
|
|
* 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 +
|
|
"Trend ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isTrendBullish", isTrendBullish, ignoreFalseConditions, separator) +
|
|
ToString("isTrendBearish", isTrendBearish, ignoreFalseConditions, separator) +
|
|
ToString("isTrendSwitchedToBullish", isTrendSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isTrendSwitchedToBearish", isTrendSwitchedToBearish, 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("isRejectedPrevPeak", isRejectedPrevPeak, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevPeak", isBreakedUpPrevPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedPrevVale", isRejectedPrevVale, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevVale", isBreakedDownPrevVale, 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) +
|
|
ToString("isRejectedUpAtrUpper", isRejectedUpAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDownAtrUpper", isRejectedDownAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedUpAtrLower", isRejectedUpAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDownAtrLower", isRejectedDownAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpAtrUpper", isBreakedUpAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownAtrUpper", isBreakedDownAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpAtrLower", isBreakedUpAtrLower, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"DON ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isBreakedDownAtrLower", isBreakedDownAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonOpenUpper", isRejectedDonOpenUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonHighUpper", isRejectedDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonLowUpper", isRejectedDonLowUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonCloseUpper", isRejectedDonCloseUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonOpenLower", isRejectedDonOpenLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonHighLower", isRejectedDonHighLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonLowLower", isRejectedDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDonCloseLower", isRejectedDonCloseLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonOpenUpper", isBreakedDonOpenUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonHighUpper", isBreakedDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonLowUpper", isBreakedDonLowUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonCloseUpper", isBreakedDonCloseUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonOpenLower", isBreakedDonOpenLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonHighLower", isBreakedDonHighLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonLowLower", isBreakedDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDonCloseLower", isBreakedDonCloseLower, ignoreFalseConditions, 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 +
|
|
"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("isBreakedUpSMHK", isBreakedUpSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpRawHK", isBreakedUpRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedUpSMHK", isRejectedUpSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverSMHK", isClosedOverSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedUpRawHK", isRejectedUpRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownSMHK", isBreakedDownSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderSMHK", isClosedUnderSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedOverRawHK", isClosedOverRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderRawHK", isClosedUnderRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownRawHK", isBreakedDownRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDownSMHK", isRejectedDownSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDownRawHK", isRejectedDownRawHK, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKBreakedUpSMHK", isRawHKBreakedUpSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKClosedOverSMHK", isRawHKClosedOverSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isSMHKSwitchedToBearish", isSMHKSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKSwitchedToBearish", isRawHKSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKClosedUnderSMHK", isRawHKClosedUnderSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKBreakedDownSMHK", isRawHKBreakedDownSMHK, ignoreFalseConditions, separator) +
|
|
ToString("isSMHKSwitchedToBullish", isSMHKSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isRawHKSwitchedToBullish", isRawHKSwitchedToBullish, 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("isBreakedUpPrevSar", isBreakedUpPrevSar, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevStr", isBreakedUpPrevStr, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMinBreakedUp", isVWapMinBreakedUp, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMaxBreakedUp", isVWapMaxBreakedUp, 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("isVWapMinBreakedDown", isVWapMinBreakedDown, ignoreFalseConditions, separator) +
|
|
ToString("isVWapMaxBreakedDown", isVWapMaxBreakedDown, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderVWapMin", isClosedUnderVWapMin, ignoreFalseConditions, separator) +
|
|
ToString("isClosedUnderVWapMax", isClosedUnderVWapMax, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevSar", isBreakedDownPrevSar, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevStr", isBreakedDownPrevStr, ignoreFalseConditions, separator) +
|
|
ToString("isSarCrossedOverVale", isSarCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrCrossedOverVale", isStrCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevCheLE1", isBreakedUpPrevCheLE1, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevCheLE2", isBreakedUpPrevCheLE2, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevCheSE1", isBreakedUpPrevCheSE1, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevCheSE2", isBreakedUpPrevCheSE2, ignoreFalseConditions, separator) +
|
|
ToString("isSarCrossedUnderPeak", isSarCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrCrossedUnderPeak", isStrCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverAtrUpper", isNewPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevCheMin", isBreakedUpPrevCheMin, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevCheMax", isBreakedUpPrevCheMax, 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("isBreakedDownPrevCheMin", isBreakedDownPrevCheMin, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevCheMax", isBreakedDownPrevCheMax, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevCheLE1", isBreakedDownPrevCheLE1, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevCheLE2", isBreakedDownPrevCheLE2, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevCheSE1", isBreakedDownPrevCheSE1, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevCheSE2", isBreakedDownPrevCheSE2, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperCrossedUpPeak", isAtrUpperCrossedUpPeak, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerCrossedUpVale", isAtrLowerCrossedUpVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderAtrUpper", isStrUpperUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderAtrLower", isStrLowerUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevAtrUpper", isBreakedUpPrevAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevAtrLower", isBreakedUpPrevAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isVWapFastCrossedOverMid", isVWapFastCrossedOverMid, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedUpPrevAtrUpper", isRejectedUpPrevAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedUpPrevAtrLower", isRejectedUpPrevAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isAtrUpperCrossedDownPeak", isAtrUpperCrossedDownPeak, ignoreFalseConditions, separator) +
|
|
ToString("isAtrLowerCrossedDownVale", isAtrLowerCrossedDownVale, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevAtrUpper", isBreakedDownPrevAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevAtrLower", isBreakedDownPrevAtrLower, 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("isRejectedDownPrevAtrUpper", isRejectedDownPrevAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedDownPrevAtrLower", isRejectedDownPrevAtrLower, 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 ...
|
|
// XCX121XPVHelper *xpvHelper;
|
|
// XCX121XHKHelper *xhkHelper;
|
|
// XCX121XATRHelper *xatrHelper;
|
|
// XCX121XSTRHelper *xstrHelper;
|
|
// XCX121XCHEHelper *xcheHelper;
|
|
// XCX121XDONHelper *xdonHelper;
|
|
// XCX121XVWAPHelper *xvwapHelper;
|
|
// XCX121XTRENDHelper *xtrendHelper;
|
|
|
|
//
|
|
// Constructors ...
|
|
XCX121Helper()
|
|
{
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
~XCX121Helper()
|
|
{
|
|
// //
|
|
// delete xpvHelper;
|
|
// delete xhkHelper;
|
|
// delete xatrHelper;
|
|
// delete xstrHelper;
|
|
// delete xcheHelper;
|
|
// delete xdonHelper;
|
|
// delete xvwapHelper;
|
|
// delete xtrendHelper;
|
|
|
|
// //
|
|
// ZeroMemory(xpvHelper);
|
|
// ZeroMemory(xhkHelper);
|
|
// ZeroMemory(xatrHelper);
|
|
// ZeroMemory(xstrHelper);
|
|
// ZeroMemory(xcheHelper);
|
|
// ZeroMemory(xdonHelper);
|
|
// ZeroMemory(xvwapHelper);
|
|
// ZeroMemory(xtrendHelper);
|
|
}
|
|
|
|
//
|
|
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;
|
|
// xpvInputs = inputs.xpvInputs;
|
|
// xhkInputs = inputs.xhkInputs;
|
|
// xatrInputs = inputs.xatrInputs;
|
|
// xstrInputs = inputs.xstrInputs;
|
|
// xcheInputs = inputs.xcheInputs;
|
|
// xdonInputs = inputs.xdonInputs;
|
|
// xvwapInputs = inputs.xvwapInputs;
|
|
// xtrendInputs = inputs.xtrendInputs;
|
|
|
|
// //
|
|
// // Initial Helpers ...
|
|
|
|
// //
|
|
// // XPV ...
|
|
// xpvHelper = new XCX121XPVHelper();
|
|
// result = xpvHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xpvInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XHK ...
|
|
// xhkHelper = new XCX121XHKHelper();
|
|
// result = xhkHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xhkInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XATR ...
|
|
// xatrHelper = new XCX121XATRHelper();
|
|
// result = xatrHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xatrInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XSTR ...
|
|
// xstrHelper = new XCX121XSTRHelper();
|
|
// result = xstrHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xstrInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XCHE ...
|
|
// xcheHelper = new XCX121XCHEHelper();
|
|
// result = xcheHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xcheInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XDON ...
|
|
// xdonHelper = new XCX121XDONHelper();
|
|
// result = xdonHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xdonInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XVWAP ...
|
|
// xvwapHelper = new XCX121XVWAPHelper();
|
|
// result = xvwapHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xvwapInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XTREND ...
|
|
// xtrendHelper = new XCX121XTRENDHelper();
|
|
// result = xtrendHelper.Init(
|
|
// symbol,
|
|
// period,
|
|
// xtrendInputs //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// if (inputs.showRSI)
|
|
// {
|
|
// //
|
|
// mRSIHandler = iRSI(
|
|
// symbol,
|
|
// period,
|
|
// xatrInputs.rsiLength,
|
|
// xatrInputs.rsiAppliedTo //
|
|
// );
|
|
|
|
// //
|
|
// result = mRSIHandler != INVALID_HANDLE;
|
|
// if (!result)
|
|
// {
|
|
// 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;
|
|
// }
|
|
|
|
// //
|
|
// // 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;
|
|
// }
|
|
|
|
// //
|
|
// // XVWAP ...
|
|
// bool GetVWAPConditions(
|
|
// X121XVWAPConditions &conditions, //
|
|
// int barIndex = 0, //
|
|
// int loopback = 5 //
|
|
// )
|
|
// {
|
|
// //
|
|
// bool result = false;
|
|
|
|
// //
|
|
// result = xvwapHelper.GetConditions(
|
|
// conditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
|
|
// //
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XTREND ...
|
|
// bool GetTrendConditions(
|
|
// X121XTRENDConditions &conditions, //
|
|
// int barIndex = 0, //
|
|
// int loopback = 5 //
|
|
// )
|
|
// {
|
|
// //
|
|
// bool result = false;
|
|
|
|
// //
|
|
// result = xtrendHelper.GetConditions(
|
|
// conditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
|
|
// //
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// void Free()
|
|
// {
|
|
// //
|
|
// xpvHelper.Free();
|
|
// xhkHelper.Free();
|
|
// xatrHelper.Free();
|
|
// xstrHelper.Free();
|
|
// xcheHelper.Free();
|
|
// xdonHelper.Free();
|
|
// xvwapHelper.Free();
|
|
// xtrendHelper.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)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XHK ...
|
|
// X121XHKConditions xhkConditions;
|
|
// result = GetHKConditions(
|
|
// xhkConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XATR ...
|
|
// X121XATRConditions xatrConditions;
|
|
// result = GetATRConditions(
|
|
// xatrConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XSTR ...
|
|
// X121XSTRConditions xstrConditions;
|
|
// result = GetSTRConditions(
|
|
// xstrConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XCHE ...
|
|
// X121XCHEConditions xcheConditions;
|
|
// result = GetCHEConditions(
|
|
// xcheConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XDON ...
|
|
// X121XDONConditions xdonConditions;
|
|
// result = GetDONConditions(
|
|
// xdonConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XVWAP ...
|
|
// X121XVWAPConditions xvwapConditions;
|
|
// result = GetVWAPConditions(
|
|
// xvwapConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// return result;
|
|
// }
|
|
|
|
// //
|
|
// // XTREND ...
|
|
// X121XTRENDConditions xtrendConditions;
|
|
// result = GetTrendConditions(
|
|
// xtrendConditions,
|
|
// barIndex,
|
|
// loopback //
|
|
// );
|
|
// if (!result)
|
|
// {
|
|
// 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.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 //
|
|
// );
|
|
|
|
// //
|
|
// // 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.isRejectedPrevVale = xpvConditions.isRejectedPrevVale;
|
|
// conditions.isRejectedPrevPeak = xpvConditions.isRejectedPrevPeak;
|
|
// conditions.isBreakedUpPrevPeak = xpvConditions.isBreakedUpPrevPeak;
|
|
// conditions.isBreakedDownPrevVale = xpvConditions.isBreakedDownPrevVale;
|
|
// 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.isBreakedUpSMHK = xhkConditions.isBreakedUpSMHK;
|
|
// conditions.isBreakedUpRawHK = xhkConditions.isBreakedUpRawHK;
|
|
// conditions.isRejectedUpSMHK = xhkConditions.isRejectedUpSMHK;
|
|
// conditions.isClosedOverSMHK = xhkConditions.isClosedOverSMHK;
|
|
// conditions.isRejectedUpRawHK = xhkConditions.isRejectedUpRawHK;
|
|
// conditions.isBreakedDownSMHK = xhkConditions.isBreakedDownSMHK;
|
|
// conditions.isClosedUnderSMHK = xhkConditions.isClosedUnderSMHK;
|
|
// conditions.isClosedOverRawHK = xhkConditions.isClosedOverRawHK;
|
|
// conditions.isClosedUnderRawHK = xhkConditions.isClosedUnderRawHK;
|
|
// conditions.isBreakedDownRawHK = xhkConditions.isBreakedDownRawHK;
|
|
// conditions.isRejectedDownSMHK = xhkConditions.isRejectedDownSMHK;
|
|
// conditions.isRejectedDownRawHK = xhkConditions.isRejectedDownRawHK;
|
|
// conditions.isRawHKBreakedUpSMHK = xhkConditions.isRawHKBreakedUpSMHK;
|
|
// conditions.isRawHKClosedOverSMHK = xhkConditions.isRawHKClosedOverSMHK;
|
|
// conditions.isSMHKSwitchedToBearish = xhkConditions.isSMHKSwitchedToBearish;
|
|
// conditions.isRawHKSwitchedToBearish = xhkConditions.isRawHKSwitchedToBearish;
|
|
// conditions.isRawHKClosedUnderSMHK = xhkConditions.isRawHKClosedUnderSMHK;
|
|
// conditions.isRawHKBreakedDownSMHK = xhkConditions.isRawHKBreakedDownSMHK;
|
|
// conditions.isSMHKSwitchedToBullish = xhkConditions.isSMHKSwitchedToBullish;
|
|
// conditions.isRawHKSwitchedToBullish = xhkConditions.isRawHKSwitchedToBullish;
|
|
|
|
// //
|
|
// // XTREND ...
|
|
|
|
// //
|
|
// // Buffers ...
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.upTrendBuffer,
|
|
// conditions.upTrendBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.downTrendBuffer,
|
|
// conditions.downTrendBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.maBuffer,
|
|
// conditions.maBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.adxBuffer,
|
|
// conditions.adxBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.adxPBuffer,
|
|
// conditions.adxPBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.adxMBuffer,
|
|
// conditions.adxMBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.upTBuffer,
|
|
// conditions.upTBuffer //
|
|
// );
|
|
|
|
// //
|
|
// Copy(
|
|
// xtrendConditions.downTBuffer,
|
|
// conditions.downTBuffer //
|
|
// );
|
|
|
|
// //
|
|
// conditions.isTrendBullish = xtrendConditions.isTrendBullish;
|
|
// conditions.isTrendBearish = xtrendConditions.isTrendBearish;
|
|
// conditions.isTrendSwitchedToBullish = xtrendConditions.isTrendSwitchedToBullish;
|
|
// conditions.isTrendSwitchedToBearish = xtrendConditions.isTrendSwitchedToBearish;
|
|
|
|
// //
|
|
// // 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.isBreakedUpAtrUpper = xatrConditions.isBreakedUpAtrUpper;
|
|
// conditions.isBreakedUpAtrLower = xatrConditions.isBreakedUpAtrLower;
|
|
// conditions.isClosedOverAtrUpper = xatrConditions.isClosedOverAtrUpper;
|
|
// conditions.isRejectedUpAtrUpper = xatrConditions.isRejectedUpAtrUpper;
|
|
// conditions.isRejectedUpAtrLower = xatrConditions.isRejectedUpAtrLower;
|
|
// conditions.isClosedOverAtrLower = xatrConditions.isClosedOverAtrLower;
|
|
// conditions.isBreakedDownAtrUpper = xatrConditions.isBreakedDownAtrUpper;
|
|
// conditions.isBreakedDownAtrLower = xatrConditions.isBreakedDownAtrLower;
|
|
// conditions.isClosedUnderAtrUpper = xatrConditions.isClosedUnderAtrUpper;
|
|
// conditions.isClosedUnderAtrLower = xatrConditions.isClosedUnderAtrLower;
|
|
// conditions.isRejectedDownAtrUpper = xatrConditions.isRejectedDownAtrUpper;
|
|
// conditions.isRejectedDownAtrLower = xatrConditions.isRejectedDownAtrLower;
|
|
// 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 ...
|
|
|
|
// //
|
|
// conditions.isBreakedDonLowUpper = xdonConditions.isBreakedDonLowUpper;
|
|
// conditions.isBreakedDonLowLower = xdonConditions.isBreakedDonLowLower;
|
|
// conditions.isRejectedDonLowUpper = xdonConditions.isRejectedDonLowUpper;
|
|
// conditions.isRejectedDonLowLower = xdonConditions.isRejectedDonLowLower;
|
|
// conditions.isBreakedDonOpenUpper = xdonConditions.isBreakedDonOpenUpper;
|
|
// conditions.isBreakedDonHighUpper = xdonConditions.isBreakedDonHighUpper;
|
|
// conditions.isBreakedDonOpenLower = xdonConditions.isBreakedDonOpenLower;
|
|
// conditions.isBreakedDonHighLower = xdonConditions.isBreakedDonHighLower;
|
|
// conditions.isRejectedDonOpenUpper = xdonConditions.isRejectedDonOpenUpper;
|
|
// conditions.isRejectedDonHighUpper = xdonConditions.isRejectedDonHighUpper;
|
|
// conditions.isRejectedDonOpenLower = xdonConditions.isRejectedDonOpenLower;
|
|
// conditions.isRejectedDonHighLower = xdonConditions.isRejectedDonHighLower;
|
|
// conditions.isBreakedDonCloseUpper = xdonConditions.isBreakedDonCloseUpper;
|
|
// conditions.isBreakedDonCloseLower = xdonConditions.isBreakedDonCloseLower;
|
|
// conditions.isRejectedDonCloseUpper = xdonConditions.isRejectedDonCloseUpper;
|
|
// conditions.isRejectedDonCloseLower = xdonConditions.isRejectedDonCloseLower;
|
|
|
|
// //
|
|
// // 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;
|
|
|
|
// //
|
|
// // 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 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 isVWapMinBreakedUp = IsBarBreak(
|
|
// vwapMin,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isVWapMinBreakedDown = IsBarBreak(
|
|
// vwapMin,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isVWapMaxBreakedUp = IsBarBreak(
|
|
// vwapMax,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isVWapMaxBreakedDown = IsBarBreak(
|
|
// vwapMax,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// 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 isBreakedUpPrevSar = IsBarBreak(
|
|
// prevSar,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevSar = IsBarBreak(
|
|
// prevSar,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedUpPrevStr = IsBarBreak(
|
|
// prevStr,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevStr = IsBarBreak(
|
|
// prevStr,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isRejectedUpPrevAtrUpper = IsBarReject(
|
|
// prevAtrUpper,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isRejectedDownPrevAtrUpper = IsBarReject(
|
|
// prevAtrUpper,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isRejectedUpPrevAtrLower = IsBarReject(
|
|
// prevAtrLower,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isRejectedDownPrevAtrLower = IsBarReject(
|
|
// prevAtrLower,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedUpPrevAtrUpper = IsBarBreak(
|
|
// prevAtrUpper,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevAtrUpper = IsBarBreak(
|
|
// prevAtrUpper,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedUpPrevAtrLower = IsBarBreak(
|
|
// prevAtrLower,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevAtrLower = IsBarBreak(
|
|
// prevAtrLower,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedUpPrevCheLE1 = IsBarBreak(
|
|
// prevCheLE1,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedUpPrevCheLE2 = IsBarBreak(
|
|
// prevCheLE2,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedUpPrevCheSE1 = IsBarBreak(
|
|
// prevCheSE1,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedUpPrevCheSE2 = IsBarBreak(
|
|
// prevCheSE2,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedDownPrevCheLE1 = IsBarBreak(
|
|
// prevCheLE1,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevCheLE2 = IsBarBreak(
|
|
// prevCheLE2,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevCheSE1 = IsBarBreak(
|
|
// prevCheSE1,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevCheSE2 = IsBarBreak(
|
|
// prevCheSE2,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedUpPrevCheMin = IsBarBreak(
|
|
// cheMin,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevCheMin = IsBarBreak(
|
|
// cheMin,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// bool isBreakedUpPrevCheMax = IsBarBreak(
|
|
// cheMax,
|
|
// X_DIRECTION_BULLISH,
|
|
// cBar //
|
|
// );
|
|
// bool isBreakedDownPrevCheMax = IsBarBreak(
|
|
// cheMax,
|
|
// X_DIRECTION_BEARISH,
|
|
// cBar //
|
|
// );
|
|
|
|
// //
|
|
// 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.vwapMin = vwapMin;
|
|
// conditions.vwapMax = vwapMax;
|
|
|
|
// //
|
|
// conditions.isSarIncreased = isSarIncreased;
|
|
// conditions.isSarDecreased = isSarDecreased;
|
|
// conditions.isSarEqualsToPeak = isSarEqualsToPeak;
|
|
// conditions.isSarEqualsToVale = isSarEqualsToVale;
|
|
// conditions.isStrEqualsToPeak = isStrEqualsToPeak;
|
|
// conditions.isStrEqualsToVale = isStrEqualsToVale;
|
|
// conditions.isStrUpperOverPeak = isStrUpperOverPeak;
|
|
// conditions.isPeakOverAtrUpper = isPeakOverAtrUpper;
|
|
// conditions.isStrLowerOverVale = isStrLowerOverVale;
|
|
// conditions.isVWapMinBreakedUp = isVWapMinBreakedUp;
|
|
// conditions.isVWapMaxBreakedUp = isVWapMaxBreakedUp;
|
|
// conditions.isBreakedUpPrevSar = isBreakedUpPrevSar;
|
|
// conditions.isBreakedUpPrevStr = isBreakedUpPrevStr;
|
|
// conditions.isAtrUpperOverPeak = isAtrUpperOverPeak;
|
|
// conditions.isAtrLowerUnderVale = isAtrLowerUnderVale;
|
|
// conditions.isStrLowerUnderVale = isStrLowerUnderVale;
|
|
// conditions.isStrUpperUnderPeak = isStrUpperUnderPeak;
|
|
// conditions.isValeUnderAtrLower = isValeUnderAtrLower;
|
|
// conditions.isClosedOverVWapMin = isClosedOverVWapMin;
|
|
// conditions.isClosedOverVWapMax = isClosedOverVWapMax;
|
|
// conditions.isClosedUnderVWapMin = isClosedUnderVWapMin;
|
|
// conditions.isClosedUnderVWapMax = isClosedUnderVWapMax;
|
|
// conditions.isVWapMinBreakedDown = isVWapMinBreakedDown;
|
|
// conditions.isVWapMaxBreakedDown = isVWapMaxBreakedDown;
|
|
// conditions.isSarCrossedOverVale = isSarCrossedOverVale;
|
|
// conditions.isStrCrossedOverVale = isStrCrossedOverVale;
|
|
// conditions.isBreakedDownPrevStr = isBreakedDownPrevStr;
|
|
// conditions.isBreakedDownPrevSar = isBreakedDownPrevSar;
|
|
// conditions.isSarCrossedUnderPeak = isSarCrossedUnderPeak;
|
|
// conditions.isStrCrossedUnderPeak = isStrCrossedUnderPeak;
|
|
// conditions.isNewPeakOverAtrUpper = isNewPeakOverAtrUpper;
|
|
// conditions.isBreakedUpPrevCheLE1 = isBreakedUpPrevCheLE1;
|
|
// conditions.isBreakedUpPrevCheLE2 = isBreakedUpPrevCheLE2;
|
|
// conditions.isBreakedUpPrevCheSE1 = isBreakedUpPrevCheSE1;
|
|
// conditions.isBreakedUpPrevCheSE2 = isBreakedUpPrevCheSE2;
|
|
// conditions.isBreakedUpPrevCheMin = isBreakedUpPrevCheMin;
|
|
// conditions.isBreakedUpPrevCheMax = isBreakedUpPrevCheMax;
|
|
// conditions.isAtrUpperEqualsToPeak = isAtrUpperEqualsToPeak;
|
|
// conditions.isAtrLowerEqualsToVale = isAtrLowerEqualsToVale;
|
|
// conditions.isNewValeUnderAtrLower = isNewValeUnderAtrLower;
|
|
// conditions.isStrUpperOverAtrUpper = isStrUpperOverAtrUpper;
|
|
// conditions.isStrLowerOverAtrLower = isStrLowerOverAtrLower;
|
|
// conditions.isBreakedDownPrevCheMin = isBreakedDownPrevCheMin;
|
|
// conditions.isBreakedDownPrevCheMax = isBreakedDownPrevCheMax;
|
|
// conditions.isBreakedDownPrevCheLE1 = isBreakedDownPrevCheLE1;
|
|
// conditions.isBreakedDownPrevCheLE2 = isBreakedDownPrevCheLE2;
|
|
// conditions.isBreakedDownPrevCheSE1 = isBreakedDownPrevCheSE1;
|
|
// conditions.isBreakedDownPrevCheSE2 = isBreakedDownPrevCheSE2;
|
|
// conditions.isStrUpperUnderAtrUpper = isStrUpperUnderAtrUpper;
|
|
// conditions.isStrLowerUnderAtrLower = isStrLowerUnderAtrLower;
|
|
// conditions.isBreakedUpPrevAtrUpper = isBreakedUpPrevAtrUpper;
|
|
// conditions.isBreakedUpPrevAtrLower = isBreakedUpPrevAtrLower;
|
|
// conditions.isAtrUpperCrossedUpPeak = isAtrUpperCrossedUpPeak;
|
|
// conditions.isAtrLowerCrossedUpVale = isAtrLowerCrossedUpVale;
|
|
// conditions.isVWapFastCrossedOverMid = isVWapFastCrossedOverMid;
|
|
// conditions.isRejectedUpPrevAtrUpper = isRejectedUpPrevAtrUpper;
|
|
// conditions.isRejectedUpPrevAtrLower = isRejectedUpPrevAtrLower;
|
|
// conditions.isAtrUpperCrossedDownPeak = isAtrUpperCrossedDownPeak;
|
|
// conditions.isAtrLowerCrossedDownVale = isAtrLowerCrossedDownVale;
|
|
// conditions.isBreakedDownPrevAtrUpper = isBreakedDownPrevAtrUpper;
|
|
// conditions.isBreakedDownPrevAtrLower = isBreakedDownPrevAtrLower;
|
|
// conditions.isVWapFastCrossedUnderMid = isVWapFastCrossedUnderMid;
|
|
// conditions.isDonLowLowerEqualsToVale = isDonLowLowerEqualsToVale;
|
|
// conditions.isStrUpperCrossedOverPeak = isStrUpperCrossedOverPeak;
|
|
// conditions.isStrLowerCrossedOverVale = isStrLowerCrossedOverVale;
|
|
// conditions.isStrLowerOverDonLowLower = isStrLowerOverDonLowLower;
|
|
// conditions.isVWapFastCrossedOverSlow = isVWapFastCrossedOverSlow;
|
|
// conditions.isRejectedDownPrevAtrUpper = isRejectedDownPrevAtrUpper;
|
|
// conditions.isRejectedDownPrevAtrLower = isRejectedDownPrevAtrLower;
|
|
// 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();
|
|
// xatrConditions.Clean();
|
|
// xstrConditions.Clean();
|
|
// xcheConditions.Clean();
|
|
// xdonConditions.Clean();
|
|
// xvwapConditions.Clean();
|
|
// xtrendConditions.Clean();
|
|
|
|
// //
|
|
// Free();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
protected:
|
|
//
|
|
|
|
//
|
|
private:
|
|
//
|
|
|
|
//
|
|
string mSymbol; // Trading Symbol
|
|
ENUM_TIMEFRAMES mPeriod; // Trading Period
|
|
|
|
//
|
|
// Inputs ...
|
|
// X121Inputs mInputs;
|
|
// X121XPVInputs xpvInputs;
|
|
// X121XHKInputs xhkInputs;
|
|
// X121XATRInputs xatrInputs;
|
|
// X121XDONInputs xdonInputs;
|
|
// X121XSTRInputs xstrInputs;
|
|
// X121XCHEInputs xcheInputs;
|
|
// X121XVWAPInputs xvwapInputs;
|
|
// X121XTRENDInputs xtrendInputs;
|
|
|
|
//
|
|
int mRSIHandler;
|
|
};
|
|
|
|
// |