1973 lines
59 KiB
Plaintext
1973 lines
59 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.xdon.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xpv.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xstr.helper.mq5"
|
|
#include "../Helpers/x-saherelm.x121.xvwap.helper.mq5"
|
|
|
|
//
|
|
// Inputs ...
|
|
struct X121Inputs
|
|
{
|
|
//
|
|
// Props ...
|
|
bool showRSI;
|
|
X121XPVInputs xpvInputs;
|
|
X121XATRInputs xatrInputs;
|
|
X121XSTRInputs xstrInputs;
|
|
X121XDONInputs xdonInputs;
|
|
X121XVWAPInputs xvwapInputs;
|
|
|
|
//
|
|
// Constructor ...
|
|
X121Inputs()
|
|
{
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Cleaning Up ...
|
|
*/
|
|
void Clean()
|
|
{
|
|
//
|
|
xpvInputs.Clean();
|
|
xatrInputs.Clean();
|
|
xstrInputs.Clean();
|
|
xdonInputs.Clean();
|
|
xvwapInputs.Clean();
|
|
}
|
|
|
|
/**
|
|
* Set Default Values ...
|
|
*/
|
|
void Default()
|
|
{
|
|
//
|
|
xpvInputs.Default();
|
|
xatrInputs.Default();
|
|
xstrInputs.Default();
|
|
xdonInputs.Default();
|
|
xvwapInputs.Default();
|
|
}
|
|
|
|
/**
|
|
* Validate ...
|
|
*
|
|
* @return ( bool )
|
|
*/
|
|
bool IsValid()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
xpvInputs.IsValid() &&
|
|
xatrInputs.IsValid() &&
|
|
xstrInputs.IsValid() &&
|
|
xdonInputs.IsValid() &&
|
|
xvwapInputs.IsValid()
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Extract Max Input Length ...
|
|
*
|
|
* @return ( int )
|
|
*/
|
|
int Max()
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
int xpvMax = xpvInputs.Max();
|
|
int xatrMax = xatrInputs.Max();
|
|
int xstrMax = xstrInputs.Max();
|
|
int xdonMax = xdonInputs.Max();
|
|
int xvwapMax = xvwapInputs.Max();
|
|
|
|
//
|
|
result = MathMax(xpvMax, xatrMax);
|
|
result = MathMax(result, xstrMax);
|
|
result = MathMax(result, xdonMax);
|
|
result = MathMax(result, xvwapMax);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
};
|
|
|
|
//
|
|
// Conditions ...
|
|
struct X121Conditions
|
|
{
|
|
//
|
|
// Common ...
|
|
string symbol;
|
|
ENUM_TIMEFRAMES period;
|
|
datetime time;
|
|
|
|
//
|
|
// Buffers ...
|
|
double atrUpperBuffer[];
|
|
double atrLowerBuffer[];
|
|
double atrUpperRawBuffer[];
|
|
double atrLowerRawBuffer[];
|
|
double rsiBuffer[];
|
|
double atrBuffer[];
|
|
double strBuffer[];
|
|
double strPriceBuffer[];
|
|
double strUpBuffer[];
|
|
double strDownBuffer[];
|
|
double strStateBuffer[];
|
|
double donOpenUpperBuffer[];
|
|
double donOpenLowerBuffer[];
|
|
double donHighUpperBuffer[];
|
|
double donHighLowerBuffer[];
|
|
double donLowUpperBuffer[];
|
|
double donLowLowerBuffer[];
|
|
double donCloseUpperBuffer[];
|
|
double donCloseLowerBuffer[];
|
|
double peaksBuffer[];
|
|
double valesBuffer[];
|
|
double sarBuffer[];
|
|
double cHHBuffer[];
|
|
double cLLBuffer[];
|
|
double sHHBuffer[];
|
|
double sLLBuffer[];
|
|
double mHHBuffer[];
|
|
double mLLBuffer[];
|
|
double lHHBuffer[];
|
|
double lLLBuffer[];
|
|
double hHHBuffer[];
|
|
double hLLBuffer[];
|
|
double vwapFastBuffer[];
|
|
double vwapMidBuffer[];
|
|
double vwapSlowBuffer[];
|
|
double vwapVolumeBuffer[];
|
|
double vwapPriceBuffer[];
|
|
double vwapFastStateBuffer[];
|
|
double vwapMidStateBuffer[];
|
|
double vwapSlowStateBuffer[];
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
bool isRsiOverBought;
|
|
bool isRsiCrossedOverOverBought;
|
|
bool isRsiCrossedUnderOverBought;
|
|
bool isRsiOverSold;
|
|
bool isRsiCrossedUnderOverSold;
|
|
bool isRsiCrossedOverOverSold;
|
|
|
|
//
|
|
bool isCloseOverAtrUpper;
|
|
bool isCloseOverAtrLower;
|
|
bool isCloseUnderAtrUpper;
|
|
bool isCloseUnderAtrLower;
|
|
|
|
//
|
|
bool isRejectUpAtrUpper;
|
|
bool isRejectDownAtrUpper;
|
|
|
|
//
|
|
bool isRejectUpAtrLower;
|
|
bool isRejectDownAtrLower;
|
|
|
|
//
|
|
bool isBreakUpAtrUpper;
|
|
bool isBreakDownAtrUpper;
|
|
|
|
//
|
|
bool isBreakUpAtrLower;
|
|
bool isBreakDownAtrLower;
|
|
|
|
//
|
|
bool isRejectDonOpenUpper;
|
|
bool isRejectDonHighUpper;
|
|
bool isRejectDonLowUpper;
|
|
bool isRejectDonCloseUpper;
|
|
|
|
//
|
|
bool isRejectDonOpenLower;
|
|
bool isRejectDonHighLower;
|
|
bool isRejectDonLowLower;
|
|
bool isRejectDonCloseLower;
|
|
|
|
//
|
|
bool isBreakDonOpenUpper;
|
|
bool isBreakDonHighUpper;
|
|
bool isBreakDonLowUpper;
|
|
bool isBreakDonCloseUpper;
|
|
|
|
//
|
|
bool isBreakDonOpenLower;
|
|
bool isBreakDonHighLower;
|
|
bool isBreakDonLowLower;
|
|
bool isBreakDonCloseLower;
|
|
|
|
//
|
|
bool isSarBullish;
|
|
bool isSarBearish;
|
|
bool isSarSwitchedToBullish;
|
|
bool isSarSwitchedToBearish;
|
|
|
|
//
|
|
bool isNewPeak;
|
|
bool isNewPeakOverLast;
|
|
bool isNewPeakUnderLast;
|
|
|
|
//
|
|
bool isNewVale;
|
|
bool isNewValeOverLast;
|
|
bool isNewValeUnderLast;
|
|
|
|
//
|
|
bool isStrBullish;
|
|
bool isStrBearish;
|
|
bool isStrSwitchedToBullish;
|
|
bool isStrSwitchedToBearish;
|
|
|
|
//
|
|
bool isVWapFastBullish;
|
|
bool isVWapFastBearish;
|
|
bool isVWapFastNeutural;
|
|
bool isVWapMidBullish;
|
|
bool isVWapMidBearish;
|
|
bool isVWapMidNeutural;
|
|
bool isVWapSlowBullish;
|
|
bool isVWapSlowBearish;
|
|
bool isVWapSlowNeutural;
|
|
bool isVWapFastOverMid;
|
|
bool isVWapMidOverSlow;
|
|
bool isVWapFastUnderMid;
|
|
bool isVWapMidUnderSlow;
|
|
bool isVWapBullishState;
|
|
bool isVWapBearishState;
|
|
bool isVWapNeuturalState;
|
|
bool isVWapBullishOrdered;
|
|
bool isVWapBearishOrdered;
|
|
bool isVWapSwitchedToBullishOrdered;
|
|
bool isVWapSwitchedToBearishOrdered;
|
|
bool isVWapSwitchedToBullishState;
|
|
bool isVWapSwitchedToBearishState;
|
|
bool isVWapSwitchedToNeuturalState;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
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;
|
|
|
|
//
|
|
// Constructor ...
|
|
X121Conditions()
|
|
{
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Cleaning Up ...
|
|
*/
|
|
void Clean()
|
|
{
|
|
//
|
|
// Commons ...
|
|
symbol = NULL;
|
|
period = NULL;
|
|
time = NULL;
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Clean(atrUpperBuffer);
|
|
Clean(atrLowerBuffer);
|
|
Clean(atrUpperRawBuffer);
|
|
Clean(atrLowerRawBuffer);
|
|
Clean(rsiBuffer);
|
|
Clean(atrBuffer);
|
|
Clean(strBuffer);
|
|
Clean(strPriceBuffer);
|
|
Clean(strUpBuffer);
|
|
Clean(strDownBuffer);
|
|
Clean(strStateBuffer);
|
|
Clean(donOpenUpperBuffer);
|
|
Clean(donOpenLowerBuffer);
|
|
Clean(donHighUpperBuffer);
|
|
Clean(donHighLowerBuffer);
|
|
Clean(donLowUpperBuffer);
|
|
Clean(donLowLowerBuffer);
|
|
Clean(donCloseUpperBuffer);
|
|
Clean(donCloseLowerBuffer);
|
|
Clean(peaksBuffer);
|
|
Clean(valesBuffer);
|
|
Clean(sarBuffer);
|
|
Clean(cHHBuffer);
|
|
Clean(cLLBuffer);
|
|
Clean(sHHBuffer);
|
|
Clean(sLLBuffer);
|
|
Clean(mHHBuffer);
|
|
Clean(mLLBuffer);
|
|
Clean(lHHBuffer);
|
|
Clean(lLLBuffer);
|
|
Clean(hHHBuffer);
|
|
Clean(hLLBuffer);
|
|
Clean(vwapFastBuffer);
|
|
Clean(vwapMidBuffer);
|
|
Clean(vwapSlowBuffer);
|
|
Clean(vwapVolumeBuffer);
|
|
Clean(vwapPriceBuffer);
|
|
Clean(vwapFastStateBuffer);
|
|
Clean(vwapMidStateBuffer);
|
|
Clean(vwapSlowStateBuffer);
|
|
|
|
//
|
|
ArraySetAsSeries(atrUpperBuffer, true);
|
|
ArraySetAsSeries(atrLowerBuffer, true);
|
|
ArraySetAsSeries(atrUpperRawBuffer, true);
|
|
ArraySetAsSeries(atrLowerRawBuffer, true);
|
|
ArraySetAsSeries(rsiBuffer, true);
|
|
ArraySetAsSeries(atrBuffer, true);
|
|
ArraySetAsSeries(strBuffer, true);
|
|
ArraySetAsSeries(strPriceBuffer, true);
|
|
ArraySetAsSeries(strUpBuffer, true);
|
|
ArraySetAsSeries(strDownBuffer, true);
|
|
ArraySetAsSeries(strStateBuffer, true);
|
|
ArraySetAsSeries(donOpenUpperBuffer, true);
|
|
ArraySetAsSeries(donOpenLowerBuffer, true);
|
|
ArraySetAsSeries(donHighUpperBuffer, true);
|
|
ArraySetAsSeries(donHighLowerBuffer, true);
|
|
ArraySetAsSeries(donLowUpperBuffer, true);
|
|
ArraySetAsSeries(donLowLowerBuffer, true);
|
|
ArraySetAsSeries(donCloseUpperBuffer, true);
|
|
ArraySetAsSeries(donCloseLowerBuffer, true);
|
|
ArraySetAsSeries(peaksBuffer, true);
|
|
ArraySetAsSeries(valesBuffer, 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(vwapFastBuffer, true);
|
|
ArraySetAsSeries(vwapMidBuffer, true);
|
|
ArraySetAsSeries(vwapSlowBuffer, true);
|
|
ArraySetAsSeries(vwapVolumeBuffer, true);
|
|
ArraySetAsSeries(vwapPriceBuffer, true);
|
|
ArraySetAsSeries(vwapFastStateBuffer, true);
|
|
ArraySetAsSeries(vwapMidStateBuffer, true);
|
|
ArraySetAsSeries(vwapSlowStateBuffer, true);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
// RSI ...
|
|
|
|
//
|
|
isRsiOverBought = false;
|
|
isRsiCrossedOverOverBought = false;
|
|
isRsiCrossedUnderOverBought = false;
|
|
|
|
//
|
|
isRsiOverSold = false;
|
|
isRsiCrossedUnderOverSold = false;
|
|
isRsiCrossedOverOverSold = false;
|
|
|
|
//
|
|
// ATR ...
|
|
|
|
//
|
|
isCloseOverAtrUpper = false;
|
|
isCloseOverAtrLower = false;
|
|
|
|
//
|
|
isCloseUnderAtrUpper = false;
|
|
isCloseUnderAtrLower = false;
|
|
|
|
//
|
|
isRejectUpAtrUpper = false;
|
|
isRejectDownAtrUpper = false;
|
|
|
|
//
|
|
isRejectUpAtrLower = false;
|
|
isRejectDownAtrLower = false;
|
|
|
|
//
|
|
isBreakUpAtrUpper = false;
|
|
isBreakDownAtrUpper = false;
|
|
|
|
//
|
|
isBreakUpAtrLower = false;
|
|
isBreakDownAtrLower = false;
|
|
|
|
//
|
|
// DON ...
|
|
|
|
//
|
|
isRejectDonOpenUpper = false;
|
|
isRejectDonHighUpper = false;
|
|
isRejectDonLowUpper = false;
|
|
isRejectDonCloseUpper = false;
|
|
|
|
//
|
|
isRejectDonOpenLower = false;
|
|
isRejectDonHighLower = false;
|
|
isRejectDonLowLower = false;
|
|
isRejectDonCloseLower = false;
|
|
|
|
//
|
|
isBreakDonOpenUpper = false;
|
|
isBreakDonHighUpper = false;
|
|
isBreakDonLowUpper = false;
|
|
isBreakDonCloseUpper = false;
|
|
|
|
//
|
|
isBreakDonOpenLower = false;
|
|
isBreakDonHighLower = false;
|
|
isBreakDonLowLower = false;
|
|
isBreakDonCloseLower = false;
|
|
|
|
//
|
|
// SAR ...
|
|
|
|
//
|
|
isSarBullish = false;
|
|
isSarBearish = false;
|
|
|
|
//
|
|
isSarSwitchedToBullish = false;
|
|
isSarSwitchedToBearish = false;
|
|
|
|
//
|
|
// PV ...
|
|
|
|
//
|
|
isNewPeak = false;
|
|
isNewPeakOverLast = false;
|
|
isNewPeakUnderLast = false;
|
|
|
|
//
|
|
isNewVale = false;
|
|
isNewValeOverLast = false;
|
|
isNewValeUnderLast = false;
|
|
|
|
//
|
|
// STR ...
|
|
|
|
//
|
|
isStrBullish = false;
|
|
isStrBearish = false;
|
|
|
|
//
|
|
isStrSwitchedToBullish = false;
|
|
isStrSwitchedToBearish = false;
|
|
|
|
//
|
|
// VWAP ...
|
|
|
|
//
|
|
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;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
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;
|
|
|
|
//
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* 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 +
|
|
"STR ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) +
|
|
ToString("isStrBearish", isStrBearish, ignoreFalseConditions, separator) +
|
|
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"PV ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"> RSI ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isRsiOverBought", isRsiOverBought, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedOverOverBought", isRsiCrossedOverOverBought, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedUnderOverBought", isRsiCrossedUnderOverBought, ignoreFalseConditions, separator) +
|
|
ToString("isRsiOverSold", isRsiOverSold, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedUnderOverSold", isRsiCrossedUnderOverSold, ignoreFalseConditions, separator) +
|
|
ToString("isRsiCrossedOverOverSold", isRsiCrossedOverOverSold, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"ATR ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isCloseOverAtrUpper", isCloseOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isCloseOverAtrLower", isCloseOverAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderAtrUpper", isCloseUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderAtrLower", isCloseUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectUpAtrUpper", isRejectUpAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDownAtrUpper", isRejectDownAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectUpAtrLower", isRejectUpAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDownAtrLower", isRejectDownAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakUpAtrUpper", isBreakUpAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDownAtrUpper", isBreakDownAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakUpAtrLower", isBreakUpAtrLower, ignoreFalseConditions, separator) +
|
|
//
|
|
"-----------------------" + separator +
|
|
"DON ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isBreakDownAtrLower", isBreakDownAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonOpenUpper", isRejectDonOpenUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonHighUpper", isRejectDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonLowUpper", isRejectDonLowUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonCloseUpper", isRejectDonCloseUpper, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonOpenLower", isRejectDonOpenLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonHighLower", isRejectDonHighLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonLowLower", isRejectDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isRejectDonCloseLower", isRejectDonCloseLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonOpenUpper", isBreakDonOpenUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonHighUpper", isBreakDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonLowUpper", isBreakDonLowUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonCloseUpper", isBreakDonCloseUpper, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonOpenLower", isBreakDonOpenLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonHighLower", isBreakDonHighLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonLowLower", isBreakDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isBreakDonCloseLower", isBreakDonCloseLower, 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 +
|
|
"Coplex ..." + separator +
|
|
"-----------------------" + separator +
|
|
ToString("isSarEqualsToPeak", isSarEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isSarEqualsToVale", isSarEqualsToVale, ignoreFalseConditions, separator) +
|
|
ToString("isSarCrossedUnderPeak", isSarCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isSarCrossedOverVale", isSarCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrEqualsToPeak", isStrEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrEqualsToVale", isStrEqualsToVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrCrossedUnderPeak", isStrCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrCrossedOverVale", isStrCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isPeakOverAtrUpper", isPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isValeUnderAtrLower", isValeUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverAtrUpper", isNewPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderAtrLower", isNewValeUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperOverPeak", isStrUpperOverPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderPeak", isStrUpperUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedOverPeak", isStrUpperCrossedOverPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedUnderPeak", isStrUpperCrossedUnderPeak, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerOverVale", isStrLowerOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderVale", isStrLowerUnderVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedOverVale", isStrLowerCrossedOverVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedUnderVale", isStrLowerCrossedUnderVale, ignoreFalseConditions, separator) +
|
|
ToString("isDonHighUpperEqualsToPeak", isDonHighUpperEqualsToPeak, ignoreFalseConditions, separator) +
|
|
ToString("isDonLowLowerEqualsToVale", isDonLowLowerEqualsToVale, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperOverAtrUpper", isStrUpperOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderAtrUpper", isStrUpperUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerOverAtrLower", isStrLowerOverAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderAtrLower", isStrLowerUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedOverAtrUpper", isStrUpperCrossedOverAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedUnderAtrUpper", isStrUpperCrossedUnderAtrUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedOverAtrLower", isStrLowerCrossedOverAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedUnderAtrLower", isStrLowerCrossedUnderAtrLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperOverDonHighUpper", isStrUpperOverDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperUnderDonHighUpper", isStrUpperUnderDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerOverDonLowLower", isStrLowerOverDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerUnderDonLowLower", isStrLowerUnderDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedOverDonHighUpper", isStrUpperCrossedOverDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrUpperCrossedUnderDonHighUpper", isStrUpperCrossedUnderDonHighUpper, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedOverDonLowLower", isStrLowerCrossedOverDonLowLower, ignoreFalseConditions, separator) +
|
|
ToString("isStrLowerCrossedUnderDonLowLower", isStrLowerCrossedUnderDonLowLower, 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;
|
|
XCX121XATRHelper *xatrHelper;
|
|
XCX121XSTRHelper *xstrHelper;
|
|
XCX121XDONHelper *xdonHelper;
|
|
XCX121XVWAPHelper *xvwapHelper;
|
|
|
|
//
|
|
// Constructors ...
|
|
XCX121Helper()
|
|
{
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
~XCX121Helper()
|
|
{
|
|
//
|
|
delete xpvHelper;
|
|
delete xatrHelper;
|
|
delete xstrHelper;
|
|
delete xdonHelper;
|
|
delete xvwapHelper;
|
|
}
|
|
|
|
//
|
|
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;
|
|
xatrInputs = inputs.xatrInputs;
|
|
xstrInputs = inputs.xstrInputs;
|
|
xdonInputs = inputs.xdonInputs;
|
|
xvwapInputs = inputs.xvwapInputs;
|
|
|
|
//
|
|
// Initial Helpers ...
|
|
|
|
//
|
|
// XPV ...
|
|
xpvHelper = new XCX121XPVHelper();
|
|
result = xpvHelper.Init(
|
|
symbol,
|
|
period,
|
|
xpvInputs //
|
|
);
|
|
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;
|
|
}
|
|
|
|
//
|
|
// 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;
|
|
}
|
|
|
|
//
|
|
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;
|
|
}
|
|
|
|
//
|
|
// 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;
|
|
}
|
|
|
|
//
|
|
// 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;
|
|
}
|
|
|
|
//
|
|
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;
|
|
}
|
|
|
|
//
|
|
// XATR ...
|
|
X121XATRConditions xatrConditions;
|
|
result = GetATRConditions(
|
|
xatrConditions,
|
|
barIndex,
|
|
loopback //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XSTR ...
|
|
X121XSTRConditions xstrConditions;
|
|
result = GetSTRConditions(
|
|
xstrConditions,
|
|
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;
|
|
}
|
|
|
|
//
|
|
// Fill X121 Conditions Reference by Using
|
|
// Retrieved Conditions ...
|
|
|
|
//
|
|
// 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.isSarSwitchedToBullish = xpvConditions.isSarSwitchedToBullish;
|
|
conditions.isSarSwitchedToBearish = xpvConditions.isSarSwitchedToBearish;
|
|
|
|
//
|
|
// 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.isBreakUpAtrUpper = xatrConditions.isBreakUpAtrUpper;
|
|
conditions.isBreakUpAtrLower = xatrConditions.isBreakUpAtrLower;
|
|
conditions.isCloseOverAtrUpper = xatrConditions.isCloseOverAtrUpper;
|
|
conditions.isRejectUpAtrUpper = xatrConditions.isRejectUpAtrUpper;
|
|
conditions.isRejectUpAtrLower = xatrConditions.isRejectUpAtrLower;
|
|
conditions.isCloseOverAtrLower = xatrConditions.isCloseOverAtrLower;
|
|
conditions.isBreakDownAtrUpper = xatrConditions.isBreakDownAtrUpper;
|
|
conditions.isBreakDownAtrLower = xatrConditions.isBreakDownAtrLower;
|
|
conditions.isCloseUnderAtrUpper = xatrConditions.isCloseUnderAtrUpper;
|
|
conditions.isCloseUnderAtrLower = xatrConditions.isCloseUnderAtrLower;
|
|
conditions.isRejectDownAtrUpper = xatrConditions.isRejectDownAtrUpper;
|
|
conditions.isRejectDownAtrLower = xatrConditions.isRejectDownAtrLower;
|
|
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;
|
|
|
|
//
|
|
// 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.isBreakDonLowUpper = xdonConditions.isBreakDonLowUpper;
|
|
conditions.isBreakDonLowLower = xdonConditions.isBreakDonLowLower;
|
|
conditions.isRejectDonLowUpper = xdonConditions.isRejectDonLowUpper;
|
|
conditions.isRejectDonLowLower = xdonConditions.isRejectDonLowLower;
|
|
conditions.isBreakDonOpenUpper = xdonConditions.isBreakDonOpenUpper;
|
|
conditions.isBreakDonHighUpper = xdonConditions.isBreakDonHighUpper;
|
|
conditions.isBreakDonOpenLower = xdonConditions.isBreakDonOpenLower;
|
|
conditions.isBreakDonHighLower = xdonConditions.isBreakDonHighLower;
|
|
conditions.isRejectDonOpenUpper = xdonConditions.isRejectDonOpenUpper;
|
|
conditions.isRejectDonHighUpper = xdonConditions.isRejectDonHighUpper;
|
|
conditions.isRejectDonOpenLower = xdonConditions.isRejectDonOpenLower;
|
|
conditions.isRejectDonHighLower = xdonConditions.isRejectDonHighLower;
|
|
conditions.isBreakDonCloseUpper = xdonConditions.isBreakDonCloseUpper;
|
|
conditions.isBreakDonCloseLower = xdonConditions.isBreakDonCloseLower;
|
|
conditions.isRejectDonCloseUpper = xdonConditions.isRejectDonCloseUpper;
|
|
conditions.isRejectDonCloseLower = xdonConditions.isRejectDonCloseLower;
|
|
|
|
//
|
|
// 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;
|
|
|
|
//
|
|
// Complex Conditions ...
|
|
|
|
//
|
|
int cIDX = 1;
|
|
int pIDX = cIDX + 1;
|
|
|
|
//
|
|
bool isSarEqualsToPeak =
|
|
conditions.sarBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
|
bool isSarEqualsToVale =
|
|
conditions.sarBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
|
|
|
//
|
|
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;
|
|
|
|
//
|
|
conditions.isSarEqualsToPeak = isSarEqualsToPeak;
|
|
conditions.isSarEqualsToVale = isSarEqualsToVale;
|
|
conditions.isStrEqualsToPeak = isStrEqualsToPeak;
|
|
conditions.isStrEqualsToVale = isStrEqualsToVale;
|
|
conditions.isStrUpperOverPeak = isStrUpperOverPeak;
|
|
conditions.isPeakOverAtrUpper = isPeakOverAtrUpper;
|
|
conditions.isStrLowerOverVale = isStrLowerOverVale;
|
|
conditions.isStrLowerUnderVale = isStrLowerUnderVale;
|
|
conditions.isStrUpperUnderPeak = isStrUpperUnderPeak;
|
|
conditions.isValeUnderAtrLower = isValeUnderAtrLower;
|
|
conditions.isSarCrossedOverVale = isSarCrossedOverVale;
|
|
conditions.isStrCrossedOverVale = isStrCrossedOverVale;
|
|
conditions.isSarCrossedUnderPeak = isSarCrossedUnderPeak;
|
|
conditions.isStrCrossedUnderPeak = isStrCrossedUnderPeak;
|
|
conditions.isNewPeakOverAtrUpper = isNewPeakOverAtrUpper;
|
|
conditions.isNewValeUnderAtrLower = isNewValeUnderAtrLower;
|
|
conditions.isStrUpperOverAtrUpper = isStrUpperOverAtrUpper;
|
|
conditions.isStrLowerOverAtrLower = isStrLowerOverAtrLower;
|
|
conditions.isStrUpperUnderAtrUpper = isStrUpperUnderAtrUpper;
|
|
conditions.isStrLowerUnderAtrLower = isStrLowerUnderAtrLower;
|
|
conditions.isDonLowLowerEqualsToVale = isDonLowLowerEqualsToVale;
|
|
conditions.isStrUpperCrossedOverPeak = isStrUpperCrossedOverPeak;
|
|
conditions.isStrLowerCrossedOverVale = isStrLowerCrossedOverVale;
|
|
conditions.isStrLowerOverDonLowLower = isStrLowerOverDonLowLower;
|
|
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;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
protected:
|
|
//
|
|
|
|
//
|
|
private:
|
|
//
|
|
|
|
//
|
|
string mSymbol; // Trading Symbol
|
|
ENUM_TIMEFRAMES mPeriod; // Trading Period
|
|
|
|
//
|
|
// Inputs ...
|
|
X121Inputs mInputs;
|
|
X121XPVInputs xpvInputs;
|
|
X121XATRInputs xatrInputs;
|
|
X121XDONInputs xdonInputs;
|
|
X121XSTRInputs xstrInputs;
|
|
X121XVWAPInputs xvwapInputs;
|
|
|
|
//
|
|
int mRSIHandler;
|
|
};
|
|
|
|
// |