381 lines
8.9 KiB
Plaintext
381 lines
8.9 KiB
Plaintext
//
|
|
bool result = false;
|
|
|
|
//
|
|
double bullishScore = 0;
|
|
double bearishScore = 0;
|
|
|
|
//
|
|
mConditions.GenerateScore(
|
|
bullishScore,
|
|
bearishScore //
|
|
);
|
|
|
|
//
|
|
bool scorePassed = bearishScore > 2 * bullishScore;
|
|
|
|
//
|
|
// Candlestick ...
|
|
bool cMCandlestickPassed =
|
|
//
|
|
mConditions.cMarketConditions.isLastBullish ||
|
|
mConditions.cMarketConditions.isCurrentBullish ||
|
|
mConditions.cMarketConditions.isCurrentMidLineOverLastMidLine
|
|
//
|
|
;
|
|
bool sMCandlestickPassed =
|
|
//
|
|
mConditions.sMarketConditions.isLastBullish ||
|
|
mConditions.sMarketConditions.isCurrentBullish ||
|
|
mConditions.sMarketConditions.isCurrentMidLineOverLastMidLine
|
|
//
|
|
;
|
|
bool mMCandlestickPassed =
|
|
//
|
|
mConditions.mMarketConditions.isLastBullish ||
|
|
mConditions.mMarketConditions.isCurrentBullish ||
|
|
mConditions.mMarketConditions.isCurrentMidLineOverLastMidLine
|
|
//
|
|
;
|
|
bool lMCandlestickPassed =
|
|
//
|
|
mConditions.lMarketConditions.isLastBullish ||
|
|
mConditions.lMarketConditions.isCurrentBullish ||
|
|
mConditions.lMarketConditions.isCurrentMidLineOverLastMidLine
|
|
//
|
|
;
|
|
bool hMCandlestickPassed =
|
|
//
|
|
mConditions.hMarketConditions.isLastBullish ||
|
|
mConditions.hMarketConditions.isCurrentBullish ||
|
|
mConditions.hMarketConditions.isCurrentMidLineOverLastMidLine
|
|
//
|
|
;
|
|
bool marketsCandlesticPassed =
|
|
//
|
|
cMCandlestickPassed &&
|
|
sMCandlestickPassed &&
|
|
mMCandlestickPassed &&
|
|
lMCandlestickPassed &&
|
|
hMCandlestickPassed
|
|
//
|
|
;
|
|
|
|
//
|
|
|
|
|
|
// //
|
|
// isSenkouSpanAOverB
|
|
// isSenkouSpanAOverLast
|
|
// isFutureSenkouSpanAOverB
|
|
// isFutureSenkouSpanAOverLast
|
|
|
|
// //
|
|
// isCloseOverKijunSen
|
|
|
|
// //
|
|
// isTenkanSenOverKijunSen
|
|
// isTenkanSenCrossedOverKijunSen
|
|
|
|
// //
|
|
// isFastOverSlow
|
|
// isFastOverVerifier
|
|
// isSlowOverVerifier
|
|
// isCloseOverFast
|
|
// isCloseOverSlow
|
|
// isCloseOverVerifier
|
|
|
|
// //
|
|
// isTrendBullish
|
|
|
|
// //
|
|
// isCHEInLong
|
|
// isCHEInStrongLong
|
|
|
|
// //
|
|
// isRVILongStart
|
|
|
|
// //
|
|
// isBullPowerOverLast
|
|
// isBullPowerOverZero
|
|
|
|
// //
|
|
// isBearPoswerUnderLast
|
|
// isBearPoswerUnderZero
|
|
|
|
// //
|
|
// isCCIPositive
|
|
// isCCIOverPositiveHundred
|
|
|
|
// //
|
|
// isSTDDEVOverAVG
|
|
// isSTDDEVOverLast
|
|
|
|
// //
|
|
// isMACDPositiove
|
|
// isMACDOverSignal
|
|
|
|
//
|
|
// isDONAttachedMinLower
|
|
// isDONCrossedOverMaxLower
|
|
|
|
//
|
|
// isPVFiboIncreased
|
|
// isPVNewPeakUnderLast
|
|
|
|
// //
|
|
// isPVSCBullish
|
|
// isPVMCBullish
|
|
// isPVLCBullish
|
|
// isPVHCBullish
|
|
|
|
// //
|
|
// isPVSCLLBullish
|
|
// isPVMCLLBullish
|
|
// isPVLCLLBullish
|
|
// isPVHCLLBullish
|
|
|
|
// //
|
|
// isPVSCSwitchedToBullish
|
|
// isPVMCSwitchedToBullish
|
|
// isPVLCSwitchedToBullish
|
|
// isPVHCSwitchedToBullish
|
|
|
|
//
|
|
result =
|
|
//
|
|
scorePassed &&
|
|
mConditions.lMarketConditions.isCurrentMidLineOverLastMidLine
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
|
|
|
|
//
|
|
isPriceCrossedOverLastLowOfHMarket
|
|
//
|
|
// //
|
|
// (bullishScore > bearishScore &&
|
|
// MathAbs(bullishScore - bearishScore) > threshold)
|
|
// //
|
|
// &&
|
|
// //
|
|
// ((isPriceCrossedOverLastMidLineOfHMarket ||
|
|
// isPriceCrossedOverCurrentMidLineOfHMarket) &&
|
|
// mConditions.hMarketConditions.isCurrentMidLineOverLastMidLine)
|
|
// //
|
|
|
|
|
|
|
|
//
|
|
double entry = GetEntry(mConditions.symbol);
|
|
XOHCL cHBar = hMarket.GetBar(0);
|
|
XOHCL pHBar = hMarket.GetBar(1);
|
|
double lastHBarMid = pHBar.GetMid();
|
|
double currentHBarMid = cHBar.GetMid();
|
|
bool isPriceCrossedOverLastMidLineOfHMarket =
|
|
//
|
|
(mConditions.bars[1].high < lastHBarMid ||
|
|
mConditions.bars[1].open < lastHBarMid)
|
|
//
|
|
&&
|
|
//
|
|
(mConditions.bars[0].low > lastHBarMid ||
|
|
mConditions.bars[0].close > lastHBarMid)
|
|
//
|
|
;
|
|
bool isPriceCrossedOverCurrentMidLineOfHMarket =
|
|
//
|
|
(mConditions.bars[1].high < currentHBarMid ||
|
|
mConditions.bars[1].open < currentHBarMid)
|
|
//
|
|
&&
|
|
//
|
|
(mConditions.bars[0].low > currentHBarMid ||
|
|
mConditions.bars[0].close > currentHBarMid)
|
|
//
|
|
;
|
|
bool isPriceCrossedOverLastLowOfHMarket =
|
|
//
|
|
mConditions.bars[2].close < pHBar.low &&
|
|
mConditions.bars[1].close > pHBar.low
|
|
//
|
|
;
|
|
|
|
// //
|
|
// isSenkouSpanAOverB
|
|
// isSenkouSpanAOverLast
|
|
// isFutureSenkouSpanAOverB
|
|
// isFutureSenkouSpanAOverLast
|
|
|
|
// //
|
|
// isCloseOverKijunSen
|
|
|
|
// //
|
|
// isTenkanSenOverKijunSen
|
|
// isTenkanSenCrossedOverKijunSen
|
|
|
|
// //
|
|
// isFastOverSlow
|
|
// isFastOverVerifier
|
|
// isSlowOverVerifier
|
|
// isCloseOverFast
|
|
// isCloseOverSlow
|
|
// isCloseOverVerifier
|
|
|
|
// //
|
|
// isTrendBullish
|
|
|
|
// //
|
|
// isCHEInLong
|
|
// isCHEInStrongLong
|
|
|
|
// //
|
|
// isRVILongStart
|
|
|
|
// //
|
|
// isBullPowerOverLast
|
|
// isBullPowerOverZero
|
|
|
|
// //
|
|
// isBearPoswerUnderLast
|
|
// isBearPoswerUnderZero
|
|
|
|
// //
|
|
// isCCIPositive
|
|
// isCCIOverPositiveHundred
|
|
|
|
// //
|
|
// isSTDDEVOverAVG
|
|
// isSTDDEVOverLast
|
|
|
|
// //
|
|
// isMACDPositiove
|
|
// isMACDOverSignal
|
|
|
|
//
|
|
// isDONAttachedMinLower
|
|
// isDONCrossedOverMaxLower
|
|
|
|
//
|
|
// isPVFiboIncreased
|
|
// isPVNewPeakUnderLast
|
|
|
|
// //
|
|
// isPVSCBullish
|
|
// isPVMCBullish
|
|
// isPVLCBullish
|
|
// isPVHCBullish
|
|
|
|
// //
|
|
// isPVSCLLBullish
|
|
// isPVMCLLBullish
|
|
// isPVLCLLBullish
|
|
// isPVHCLLBullish
|
|
|
|
// //
|
|
// isPVSCSwitchedToBullish
|
|
// isPVMCSwitchedToBullish
|
|
// isPVLCSwitchedToBullish
|
|
// isPVHCSwitchedToBullish
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //
|
|
// double bullishScore = 0;
|
|
// double bearishScore = 0;
|
|
|
|
// //
|
|
// mConditions.GenerateScore(
|
|
// bullishScore,
|
|
// bearishScore //
|
|
// );
|
|
|
|
//
|
|
// result =
|
|
// //
|
|
// bullishScore < bearishScore &&
|
|
// mConditions.zigzags[prev] == mConditions.pvPeaks[prev]
|
|
// //
|
|
// ;
|
|
|
|
// //
|
|
// for (int i = 1; i < 6; i++)
|
|
// {
|
|
// //
|
|
// X121MarketConditions iConditions;
|
|
// GetMarketConditions(iConditions, i);
|
|
|
|
// //
|
|
// double iBullishScore = 0;
|
|
// double iBearishScore = 0;
|
|
|
|
// //
|
|
// iConditions.GenerateScore(
|
|
// iBullishScore,
|
|
// iBearishScore,
|
|
// 1);
|
|
|
|
// //
|
|
// bullishScore += iBullishScore;
|
|
// bearishScore += iBearishScore;
|
|
// }
|
|
|
|
// //
|
|
// result =
|
|
// //
|
|
// bearishScore > bullishScore &&
|
|
// (bullishScore < 0
|
|
// ? bearishScore > MathAbs(bullishScore)
|
|
// : bearishScore > bullishScore * 2)
|
|
// //
|
|
// ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
double bullishScore = 0;
|
|
double bearishScore = 0;
|
|
|
|
//
|
|
mConditions.GenerateScore(
|
|
bullishScore,
|
|
bearishScore //
|
|
);
|
|
|
|
//
|
|
result =
|
|
//
|
|
mConditions.bars[1].low == mConditions.bars[2].low &&
|
|
mConditions.bars[1].low == mConditions.pvVales[1] &&
|
|
mConditions.bars[2].low == mConditions.pvVales[2]
|
|
//
|
|
;
|
|
if (result)
|
|
{
|
|
//
|
|
Print("bullishScore: " + ToString(bullishScore));
|
|
Print("bearishScore: " + ToString(bearishScore));
|
|
|
|
//
|
|
Print(mConditions.GenerateSummary());
|
|
|
|
//
|
|
Print(mConditions.pvVales[0]);
|
|
ArrayPrint(mConditions.pvVales);
|
|
}
|