1370 lines
29 KiB
Plaintext
1370 lines
29 KiB
Plaintext
enum ENUM_X_SIGNAL_METHODS
|
|
{
|
|
// //
|
|
// // UNKNOWN ...
|
|
// X_SIGNAL_UNKNOWN_METHOD,
|
|
// //
|
|
// // XTM Based ...
|
|
// X_SIGNAL_XTM_METHOD,
|
|
// //
|
|
// // XTD Based ...
|
|
// X_SIGNAL_XTD_METHOD,
|
|
// //
|
|
// // XOBD ...
|
|
// X_SIGNAL_XOBD_METHOD,
|
|
// //
|
|
// // XCHLH ...
|
|
// X_SIGNAL_XCHLH_METHOD,
|
|
// //
|
|
// // XCHMA ...
|
|
// X_SIGNAL_XCHMA_METHOD,
|
|
// //
|
|
// // XRSI ...
|
|
// X_SIGNAL_XRSI_METHOD,
|
|
//
|
|
// These Must Be Used ...
|
|
X_SIGNAL_METHOD_1,
|
|
X_SIGNAL_METHOD_2,
|
|
};
|
|
|
|
|
|
|
|
//
|
|
// Retrieve all Long Signals based on Stuffs ...
|
|
bool isXTMHasSignal = XTMHasLongConditions(xTESTNumberOfItemsPerTick);
|
|
bool isXTDHasSignal = XTDHasLongConditions(xTESTNumberOfItemsPerTick);
|
|
bool isXRSIHasSignal = XRSIHasLongConditions(xTESTNumberOfItemsPerTick);
|
|
bool isXOBDHasSignal = XOBDHasLongConditions(xTESTNumberOfItemsPerTick);
|
|
bool isXCHLHHasSignal = XCHLHHasLongConditions(xTESTNumberOfItemsPerTick);
|
|
bool isXCHMAHasSignal = XCHMAHasLongConditions(xTESTNumberOfItemsPerTick);
|
|
|
|
//
|
|
// START XTM Method ...
|
|
//
|
|
|
|
//
|
|
// Conditions 1 ...
|
|
bool xTMMethodCond1 =
|
|
//
|
|
conditions.isXTDSignalCrossedOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHMCLCHHSame &&
|
|
//
|
|
conditions.isXCHMASCFastUnderSlow &&
|
|
conditions.isXCHMAMCFastOverSlow &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Conditions 2 ...
|
|
bool xTMMethodCond2 =
|
|
//
|
|
conditions.isXTDSignalUnderBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHSCMCLLSame &&
|
|
conditions.isXCHLHSCLCLLSame &&
|
|
conditions.isXCHLHMCLCLLSame &&
|
|
//
|
|
conditions.isXCHMASCFastOverSlow &&
|
|
conditions.isXCHMAMCFastUnderSlow &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Conditions 3 ...
|
|
bool xTMMethodCond3 =
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHMCLCHHSame &&
|
|
//
|
|
conditions.isXCHMASCFastUnderSlow &&
|
|
conditions.isXCHMAMCFastUnderSlow &&
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Conditions 4 ...
|
|
bool xTMMethodCond4 =
|
|
//
|
|
conditions.isXTDSignalCrossedOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBUnderLCLL &&
|
|
conditions.isXCHLHSCMCLLSame &&
|
|
//
|
|
conditions.isXCHMASCFastCrossedOverSlow &&
|
|
conditions.isXCHMAMCFastUnderSlow &&
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Conditions 5 ...
|
|
bool xTMMethodCond5 =
|
|
//
|
|
conditions.isXTDSignalUnderBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHSCMCLLSame &&
|
|
//
|
|
conditions.isXCHMASCFastOverSlow &&
|
|
conditions.isXCHMAMCFastOverSlow &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Conditions 6 ...
|
|
bool xTMMethodCond6 =
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBUnderLCLL &&
|
|
//
|
|
conditions.isXCHMASCFastUnderSlow &&
|
|
conditions.isXCHMAMCFastUnderSlow &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// In this Method we give XTM Signals as a Base and then try to
|
|
// get Verifications from other stuffs ...
|
|
bool isXTMMethodHasSignal =
|
|
//
|
|
isXTMHasSignal
|
|
//
|
|
&&
|
|
//
|
|
// Merge Positions Conditions here ...
|
|
conditions.isXTMVale
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
xTMMethodCond1 ||
|
|
xTMMethodCond2 ||
|
|
xTMMethodCond3 ||
|
|
xTMMethodCond4 ||
|
|
xTMMethodCond5 ||
|
|
xTMMethodCond6
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods Buffer ...
|
|
if (isXTMMethodHasSignal)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_XTM_METHOD;
|
|
}
|
|
|
|
//
|
|
// END XTM Method ...
|
|
//
|
|
|
|
//
|
|
// START XTD Method ...
|
|
//
|
|
|
|
//
|
|
// Condition 1 ...
|
|
bool xTDMethodCond1 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 2 ...
|
|
bool xTDMethodCond2 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 3 ...
|
|
bool xTDMethodCond3 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 4 ...
|
|
bool xTDMethodCond4 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 5 ...
|
|
bool xTDMethodCond5 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 6 ...
|
|
bool xTDMethodCond6 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 7 ...
|
|
bool xTDMethodCond7 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// In this Method we give XTD Signals as a Base and then try to
|
|
// get Verifications from other stuffs ...
|
|
bool isXTDMethodHasSignal =
|
|
//
|
|
isXTDHasSignal
|
|
//
|
|
&&
|
|
//
|
|
// Merge Positions Conditions here ...
|
|
conditions.isXTDSignalVale
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
xTDMethodCond1 ||
|
|
xTDMethodCond2 ||
|
|
xTDMethodCond3 ||
|
|
xTDMethodCond4 ||
|
|
xTDMethodCond5 ||
|
|
xTDMethodCond6 ||
|
|
xTDMethodCond7
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods Buffer ...
|
|
if (isXTDMethodHasSignal)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_XTD_METHOD;
|
|
}
|
|
|
|
//
|
|
// END XTD Method ...
|
|
//
|
|
|
|
//
|
|
// START XOBD Method ...
|
|
//
|
|
|
|
//
|
|
// Implement Market Conditions ...
|
|
bool xOBDMethodCond1 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isXOBDMethodHasSignal =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods Buffer ...
|
|
if (isXOBDMethodHasSignal)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_XOBD_METHOD;
|
|
}
|
|
|
|
//
|
|
// END XOBD Method ...
|
|
//
|
|
|
|
//
|
|
// START XCHMA Method ...
|
|
//
|
|
|
|
//
|
|
// Implement Market Conditions ...
|
|
|
|
//
|
|
// Condition 1 ...
|
|
bool xCHMAMethodCond1 =
|
|
//
|
|
conditions.isXTDSignalUnderBear &&
|
|
//
|
|
conditions.isXOBDSignalOverSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHMCLCHHSame &&
|
|
//
|
|
conditions.isXCHMASCFastCrossedOverSlow &&
|
|
conditions.isXCHMAMCFastOverSlow &&
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 2 ...
|
|
bool xCHMAMethodCond2 =
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHSCMCHHSame &&
|
|
//
|
|
conditions.isXCHMASCFastOverSlow &&
|
|
conditions.isXCHMAMCFastCrossedOverSlow &&
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
;
|
|
|
|
//
|
|
// Condition 3 ...
|
|
// bool xCHMAMethodCond3 =
|
|
// //
|
|
// conditions. &&
|
|
// //
|
|
// conditions. &&
|
|
// //
|
|
// conditions. &&
|
|
// conditions. &&
|
|
// conditions. &&
|
|
// //
|
|
// conditions. &&
|
|
// conditions. &&
|
|
// conditions.
|
|
// //
|
|
// ;
|
|
|
|
//
|
|
bool isXCHMAMethodHasSignal =
|
|
//
|
|
isXCHMAHasSignal
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
xCHMAMethodCond1 ||
|
|
xCHMAMethodCond2
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods Buffer ...
|
|
if (isXCHMAMethodHasSignal)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_XCHMA_METHOD;
|
|
}
|
|
|
|
//
|
|
// END XCHMA Method ...
|
|
//
|
|
|
|
//
|
|
// START XCHLH Method ...
|
|
//
|
|
|
|
//
|
|
// Implement Market Conditions ...
|
|
bool xCHLHMethodCond1 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isXCHLHMethodHasSignal =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods Buffer ...
|
|
if (isXCHLHMethodHasSignal)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_XCHLH_METHOD;
|
|
}
|
|
|
|
//
|
|
// END XCHLH Method ...
|
|
//
|
|
|
|
//
|
|
// START XRSI Method ...
|
|
//
|
|
|
|
//
|
|
// Implement Market Conditions ...
|
|
bool xRSIMethodCond1 =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isXRSIMethodHasSignal =
|
|
//
|
|
false
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods Buffer ...
|
|
if (isXRSIMethodHasSignal)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_XRSI_METHOD;
|
|
}
|
|
|
|
//
|
|
// END XRSI Method ...
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
// Check Market Conditions by Combination of Power of All tools for LONGs ...
|
|
bool XTESTHasLongSignal(
|
|
double &providedSignals // Recieve Which Number of Providers has Conditions here, used for Volume Increasing
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
ENUM_X_SIGNAL_METHODS methods[];
|
|
|
|
//
|
|
// START Custom Mechanism ...
|
|
//
|
|
|
|
//
|
|
// Required Data ...
|
|
double entry = GetEntry(X_SIGNAL_LONG);
|
|
double nearHH = GetHighestHigh(3, 1);
|
|
double nearLL = GetLowestLow(3, 1);
|
|
XOHCL candle1 = GetCandle(1);
|
|
|
|
//
|
|
bool isSharpChanged = IsSharpChanged(
|
|
5,
|
|
1,
|
|
xTMMaBuffer);
|
|
|
|
//
|
|
bool isCandleSharpChanged = IsSharpChanged(
|
|
5,
|
|
1,
|
|
PRICE_CLOSE);
|
|
|
|
//
|
|
// XRSI ...
|
|
bool isXRSIOverLongExit =
|
|
xRSIBuffer[1] > xRSILongExitValue;
|
|
|
|
//
|
|
// XTD ...
|
|
// bool isXTDSignalIncreasing =
|
|
// xTDSignalBuffer[1] > xTDSignalBuffer[2] &&
|
|
// xTDSignalBuffer[1] > xTDSignalBuffer[3];
|
|
|
|
//
|
|
// XCHLH ...
|
|
bool isDecreasingMCHH = IsDecreasing(
|
|
12,
|
|
1,
|
|
xCHLHMcHHBuffer);
|
|
|
|
//
|
|
// XCHMA ...
|
|
//
|
|
double xCHMAMin1 = XCHMAGetMin(1);
|
|
double xCHMAMin2 = XCHMAGetMin(2);
|
|
|
|
//
|
|
double xCHMAMax1 = XCHMAGetMax(1);
|
|
double xCHMAMax2 = XCHMAGetMax(2);
|
|
|
|
//
|
|
double xCHMASCMin1 = MathMin(xCHMAScFastBuffer[1], xCHMAScSlowBuffer[1]);
|
|
double xCHMASCMin2 = MathMin(xCHMAScFastBuffer[2], xCHMAScSlowBuffer[2]);
|
|
|
|
//
|
|
double xCHMASCMax1 = MathMax(xCHMAScFastBuffer[1], xCHMAScSlowBuffer[1]);
|
|
double xCHMASCMax2 = MathMax(xCHMAScFastBuffer[2], xCHMAScSlowBuffer[2]);
|
|
|
|
//
|
|
double xCHMAMCTrend1 = MathAbs(xCHMAMcFastBuffer[1] - xCHMAMcSlowBuffer[1]);
|
|
double xCHMAMCTrend5 = MathAbs(xCHMAMcFastBuffer[5] - xCHMAMcSlowBuffer[5]);
|
|
double xCHMAMCTrend10 = MathAbs(xCHMAMcFastBuffer[10] - xCHMAMcSlowBuffer[10]);
|
|
|
|
//
|
|
bool isXCHMASCCrossedOverMin =
|
|
//
|
|
xCHMASCMin2 <= xCHMAMin2 &&
|
|
xCHMASCMin1 > xCHMAMin1
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isXCHMASCFastCrossedOverMax =
|
|
xCHMASCMax2 < xCHMAMax2 &&
|
|
xCHMASCMax1 >= xCHMAMax1;
|
|
|
|
//
|
|
bool isXCHMASCFastCrossedUnderMin =
|
|
xCHMASCMin2 > xCHMAMin2 &&
|
|
xCHMASCMin1 <= xCHMAMin1;
|
|
|
|
//
|
|
bool isXCHMASCFastCrossedUnderMax =
|
|
xCHMASCMax2 >= xCHMAMax2 &&
|
|
xCHMASCMax1 < xCHMAMax1;
|
|
|
|
//
|
|
// Condition 1 ...
|
|
// this Method waits for XCHMA Short Cycle's Fast to Going down
|
|
// of all Cycles Minimum Value, then Check when its Crossed Over
|
|
// min value and then start to Open Long Trades based On Conditions,
|
|
// and Recieved Verifications from other Indicator/Oscillator(s) ...
|
|
bool customMethodCond1 =
|
|
//
|
|
isXCHMASCCrossedOverMin
|
|
//
|
|
&&
|
|
//
|
|
conditions.isXTDSignalOverBear
|
|
//
|
|
&&
|
|
//
|
|
entry < nearHH
|
|
//
|
|
&&
|
|
//
|
|
candle1.close > xTMMaBuffer[1]
|
|
//
|
|
&&
|
|
//
|
|
!conditions.isXCHLHMCLCLLSame
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
xCHLHSignalTBuffer[1] <= xCHLHScHHBuffer[1] &&
|
|
isDecreasingMCHH
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCFastCrossedOverSlow ||
|
|
conditions.isXCHMASCFastOverSlow
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCFastCrossedOverSlow ||
|
|
conditions.isXCHMAMCFastOverSlow
|
|
//
|
|
) ||
|
|
(
|
|
//
|
|
conditions.isXCHMALCFastCrossedOverSlow ||
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
// Ignore Cases 1 ...
|
|
!(
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
//
|
|
conditions.isXCHMASCFastOverSlow &&
|
|
conditions.isXCHMAMCFastOverSlow &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods ...
|
|
if (customMethodCond1)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_METHOD_1;
|
|
}
|
|
|
|
//
|
|
// Condition 2 ...
|
|
// this Method waits for XCHMA Medium Cycles Fast Line Crossed Over Slow,
|
|
// then start to Open Long Trades based On Conditions, and Recieved Verifications from
|
|
// other Indicator/Oscillator(s) ...
|
|
bool customMethodCond2 =
|
|
//
|
|
// MCFast Based ...
|
|
(
|
|
//
|
|
conditions.isXCHMAMCFastCrossedOverSlow &&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCFastOverSlow
|
|
//
|
|
&&
|
|
//
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh ||
|
|
conditions.isXOBDSignalCrossedUnderSwingHigh
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHSCMCHHSame
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXTDSignalCrossedOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHMCLCLLSame
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
xCHLHScHHBuffer[1] > xCHLHSignalTBuffer[1] &&
|
|
xCHLHScLLBuffer[1] > xCHLHSignalTBuffer[1] &&
|
|
xCHLHSignalBBuffer[1] < xCHLHSignalTBuffer[1] &&
|
|
xCHLHSignalBBuffer[1] < xCHLHMcLLBuffer[1]
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBCrossedOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHSCMCHHSame &&
|
|
conditions.isXCHLHMCLCLLSame
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXTDSignalUnderBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
conditions.isXCHLHMCLCHHSame &&
|
|
conditions.isXCHLHMCLCLLSame
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXRSICrossedOverLongExit &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXTDSignalCrossedUnderBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL
|
|
//
|
|
)
|
|
//
|
|
//
|
|
&&
|
|
//
|
|
entry < nearHH
|
|
//
|
|
&&
|
|
//
|
|
nearHH != candle1.high
|
|
//
|
|
&&
|
|
//
|
|
!isXRSIOverLongExit
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods ...
|
|
if (customMethodCond2)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_METHOD_2;
|
|
}
|
|
|
|
//
|
|
// Condition 3 ...
|
|
// this Method waits for XCHMA Short Cycle's Fast to Crossed Over all Cycles max value
|
|
// and then start to Open Long Trades based On Conditions,
|
|
// and Recieved Verifications from other Indicator/Oscillator(s) ...
|
|
bool customMethodCond3 =
|
|
//
|
|
isXCHMASCFastCrossedOverMax
|
|
//
|
|
&&
|
|
//
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
xCHLHScLLBuffer[1] > xCHLHMcLLBuffer[1] &&
|
|
xCHLHMcLLBuffer[1] > xCHLHSignalBBuffer[1] &&
|
|
xCHLHSignalBBuffer[1] > xCHLHSignalTBuffer[1] &&
|
|
xCHLHSignalTBuffer[1] > xCHLHLcLLBuffer[1]
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
conditions.isXCHLHSignalBUnderSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
(
|
|
//
|
|
conditions.isXCHLHSCMCHHSame ||
|
|
conditions.isXCHLHMCLCLLSame
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHLHSCMCHHSame ||
|
|
conditions.isXCHLHMCLCLLSame ||
|
|
conditions.isXCHLHMCLCHHSame ||
|
|
conditions.isXCHLHSCMCLLSame
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!isSharpChanged
|
|
//
|
|
&&
|
|
//
|
|
!isCandleSharpChanged
|
|
//
|
|
&&
|
|
//
|
|
entry < nearHH
|
|
//
|
|
&&
|
|
//
|
|
candle1.close > xTMMaBuffer[1];
|
|
//
|
|
;
|
|
|
|
//
|
|
// Filling Methods ...
|
|
if (customMethodCond3)
|
|
{
|
|
//
|
|
ArrayResize(
|
|
methods,
|
|
ArraySize(methods) + 1);
|
|
|
|
//
|
|
methods[ArraySize(methods) - 1] = X_SIGNAL_METHOD_3;
|
|
}
|
|
|
|
//
|
|
// Combine Custom Methods together ...
|
|
bool isCustomMethodHasSignal =
|
|
//
|
|
customMethodCond1
|
|
//
|
|
||
|
|
//
|
|
customMethodCond2
|
|
//
|
|
||
|
|
//
|
|
customMethodCond3
|
|
//
|
|
;
|
|
|
|
//
|
|
// END Custom Mechanism ...
|
|
//
|
|
|
|
//
|
|
result =
|
|
//
|
|
// isXTMHasSignal
|
|
// isXTDHasSignal
|
|
// isXCHMAHasSignal
|
|
//
|
|
// isXTMMethodHasSignal
|
|
//
|
|
// ||
|
|
//
|
|
// isXTDMethodHasSignal
|
|
//
|
|
// ||
|
|
// //
|
|
// isXOBDMethodHasSignal
|
|
// //
|
|
// ||
|
|
// //
|
|
// isXCHMAMethodHasSignal
|
|
// //
|
|
// ||
|
|
// //
|
|
// isXCHLHMethodHasSignal
|
|
// //
|
|
// ||
|
|
// //
|
|
// isXRSIMethodHasSignal
|
|
//
|
|
// ||
|
|
isCustomMethodHasSignal
|
|
//
|
|
;
|
|
|
|
//
|
|
if (result)
|
|
{
|
|
//
|
|
// Set Number of Occured Conditions for Increasing Volume ...
|
|
providedSignals = ArraySize(methods);
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
|
|
//
|
|
// Condition 1 ...
|
|
// this Method waits for XCHMA Short Cycle's Fast to Going down
|
|
// of all Cycles Minimum Value, then Check when its Crossed Over
|
|
// min value and then start to Open Long Trades based On Conditions,
|
|
// and Recieved Verifications from other Indicator/Oscillator(s) ...
|
|
bool customMethodCond1 =
|
|
//
|
|
isXCHMASCCrossedOverMin
|
|
//
|
|
&&
|
|
//
|
|
conditions.isXTDSignalOverBear
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
|
|
xTDSignalBuffer[1] < xTDSignalBuffer[2] &&
|
|
xTDSignalBuffer[1] < xTDSignalBuffer[3])
|
|
//
|
|
&&
|
|
//
|
|
entry < nearHH
|
|
//
|
|
&&
|
|
//
|
|
candle1.close > xTMMaBuffer[1]
|
|
//
|
|
&&
|
|
//
|
|
!conditions.isXCHLHMCLCLLSame
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
xCHLHSignalTBuffer[1] <= xCHLHScHHBuffer[1] &&
|
|
isDecreasingMCHH
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCFastCrossedOverSlow ||
|
|
conditions.isXCHMASCFastOverSlow
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCFastCrossedOverSlow ||
|
|
conditions.isXCHMAMCFastOverSlow
|
|
//
|
|
) ||
|
|
(
|
|
//
|
|
conditions.isXCHMALCFastCrossedOverSlow ||
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
// Ignore Cases 1 ...
|
|
!(
|
|
//
|
|
conditions.isXTDSignalOverBear &&
|
|
//
|
|
conditions.isXOBDSignalUnderSwingHigh &&
|
|
//
|
|
conditions.isXCHLHSignalBOverSignalT &&
|
|
conditions.isXCHLHSignalBOverLCLL &&
|
|
//
|
|
conditions.isXCHMASCFastOverSlow &&
|
|
conditions.isXCHMAMCFastOverSlow &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCVale &&
|
|
conditions.isXCHLHSCMCHHSame
|
|
//
|
|
?
|
|
//
|
|
!(
|
|
xCHLHSignalTBuffer[1] > xCHLHSignalBBuffer[1] &&
|
|
xCHLHSignalBBuffer[1] > xCHLHMcLLBuffer[1] &&
|
|
xCHLHSignalBBuffer[1] > xCHLHLcLLBuffer[1] &&
|
|
xCHLHScLLBuffer[1] < xCHLHSignalTBuffer[1])
|
|
//
|
|
:
|
|
//
|
|
true
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCFastUnderSlow ||
|
|
conditions.isXCHMAMCFastCrossedUnderSlow
|
|
//
|
|
?
|
|
//
|
|
!(
|
|
MathMax(xCHMAScFastBuffer[1], xCHMAScSlowBuffer[1]) < xCHMAMcFastBuffer[1])
|
|
//
|
|
:
|
|
//
|
|
true
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
|
|
|
|
|
|
//
|
|
bool isXCHMAVerifiedForMethod1 =
|
|
//
|
|
!(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCVale &&
|
|
conditions.isXCHMAMCVale
|
|
//
|
|
)
|
|
//
|
|
||
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCVale &&
|
|
conditions.isXCHMALCVale
|
|
//
|
|
)
|
|
//
|
|
||
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCVale &&
|
|
conditions.isXCHMAMCVale &&
|
|
conditions.isXCHMALCVale
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCUnderMin &&
|
|
!conditions.isXCHMASCOverMin
|
|
//
|
|
)
|
|
//
|
|
||
|
|
conditions.isXCHMASCCrossedUnderMin
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isXCHLHVerifiedForMethod1 =
|
|
//
|
|
xCHLHMcLLBuffer[1] < xCHLHMcLLBuffer[3]
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHLHSCMCLLSame &&
|
|
!conditions.isXCHLHSCMCHHSame
|
|
//
|
|
?
|
|
//
|
|
!(
|
|
//
|
|
XCHMAGetCycleMaxValue(1, X_XCHMA_CYCLE_MEDIUM) < XCHMAGetCycleMaxValue(1, X_XCHMA_CYCLE_LONG) &&
|
|
XCHMAGetCycleMinValue(1, X_XCHMA_CYCLE_MEDIUM) > XCHMAGetCycleMinValue(1, X_XCHMA_CYCLE_LONG)
|
|
//
|
|
)
|
|
//
|
|
:
|
|
//
|
|
true
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXCHLHSameLLs &&
|
|
conditions.isXCHLHMCOnTopOfLC
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXLHLLDecreased &&
|
|
conditions.isXCHLHSCMCLLSame &&
|
|
conditions.isXCHLHMCOnTopOfLC
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXCHLHMCLCHHSame &&
|
|
conditions.isXCHLHMCLCLLSame &&
|
|
conditions.isXCHLHMCOnTopOfLC
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
|
|
|
|
//
|
|
// IMPORTANT ...
|
|
|
|
//
|
|
bool swingBasedSignal =
|
|
//
|
|
// Selecet Swing Low as base ...
|
|
conditions.isXOBDSwingLow
|
|
//
|
|
&&
|
|
//
|
|
conditions.isXLHLowAttachedLL
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXTMBearish ? !conditions.isXTMVale : true
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCFastUnderSlow &&
|
|
conditions.isXCHMAMCTrendsDown
|
|
? !conditions.isXCHMAMCVale
|
|
: true
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMALCFastUnderSlow &&
|
|
conditions.isXCHMALCTrendsDown
|
|
? !conditions.isXCHMALCVale
|
|
: true
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
!(
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCTrendsUp &&
|
|
conditions.isXCHMASCFastUnderSlow
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMAMCTrendsUp &&
|
|
conditions.isXCHMAMCFastUnderSlow
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMALCTrendsUp &&
|
|
conditions.isXCHMALCFastUnderSlow
|
|
//
|
|
)
|
|
//
|
|
)
|
|
//
|
|
&&
|
|
//
|
|
(
|
|
//
|
|
conditions.isXCHMASCFastUnderSlow &&
|
|
conditions.isXCHMASCTrendsDown &&
|
|
conditions.isXCHMASCVale
|
|
?
|
|
//
|
|
!(
|
|
//
|
|
conditions.isXCHMAMCTrendsUp &&
|
|
conditions.isXCHMAMCFastOverSlow &&
|
|
conditions.isXCHMALCTrendsUp &&
|
|
conditions.isXCHMALCFastOverSlow
|
|
//
|
|
)
|
|
//
|
|
:
|
|
//
|
|
true
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
if (swingBasedSignal)
|
|
{
|
|
//
|
|
info.signalPusher++;
|
|
|
|
//
|
|
info.tp = (MathAbs(xLHHHBuffer[1] - entry));
|
|
info.riskFree = (MathAbs(xLHSignalBuffer[1] - entry));
|
|
}
|