Last Preparation ...
This commit is contained in:
@@ -583,3 +583,381 @@
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Bar Has Signal Based on Strategy 1 ...
|
||||
*
|
||||
* Pattern‑based reversal:
|
||||
* - Detects Pin Bar or Signal Key Bar.
|
||||
* - Confirms with POI detector.
|
||||
* - Good for reversals at support/resistance.
|
||||
*
|
||||
* @param bar: XOHCL, reference to Bar ...
|
||||
* @param zone: XBoxZone, reference to holds affected zone ...
|
||||
* @param targets: XTarget, reference to detected Signal's Targets collections ...
|
||||
* @param dir: ENUM_X_DIRECTION, detected Signal's direction ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Strategy1HasSignal(
|
||||
XOHCL &bar,
|
||||
XBoxZone &zone,
|
||||
XTarget &targets[],
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
zone.Clean();
|
||||
XClean(targets);
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int barIndex = bar.Index() + 1;
|
||||
|
||||
//
|
||||
// Safe for Entry ...
|
||||
bool isSafeForBullishEntry = kiParser.IsSafeBullishEntry(barIndex);
|
||||
bool isSafeForBearishEntry = kiParser.IsSafeBearishEntry(barIndex);
|
||||
|
||||
//
|
||||
// POI ...
|
||||
bool isPOI = poiDetector.IsPOI(dir, barIndex);
|
||||
bool isBullishPOI = isPOI &&
|
||||
IsXBullish(dir);
|
||||
bool isBearishPOI = isPOI &&
|
||||
IsXBearish(dir);
|
||||
if (isPOI)
|
||||
{
|
||||
//
|
||||
// Print("isPOI: ", ToXString(dir));
|
||||
// DebugBreak();
|
||||
}
|
||||
|
||||
//
|
||||
// Breakout POI ...
|
||||
bool isBreakoutPOI = poiDetector.IsBreakoutPOI(dir, barIndex);
|
||||
bool isBullishBreakoutPOI = isBreakoutPOI &&
|
||||
IsXBullish(dir);
|
||||
bool isBearishBreakoutPOI = isBreakoutPOI &&
|
||||
IsXBearish(dir);
|
||||
if (isBreakoutPOI)
|
||||
{
|
||||
//
|
||||
// Print("isBreakoutPOI: ", ToXString(dir));
|
||||
// DebugBreak();
|
||||
}
|
||||
|
||||
//
|
||||
// Reversal POI ...
|
||||
bool isReversalPOI = poiDetector.IsReversalPOI(dir, barIndex);
|
||||
bool isBullishReversalPOI = isReversalPOI &&
|
||||
IsXBullish(dir);
|
||||
bool isBearishReversalPOI = isReversalPOI &&
|
||||
IsXBearish(dir);
|
||||
if (isReversalPOI)
|
||||
{
|
||||
// //
|
||||
// Print("isReversalPOI: ", ToXString(dir));
|
||||
// DebugBreak();
|
||||
}
|
||||
|
||||
//
|
||||
// Continuation POI ...
|
||||
bool isContinuationPOI = poiDetector.IsContinuationPOI(dir, barIndex);
|
||||
bool isBullishContinuationPOI = isContinuationPOI &&
|
||||
IsXBullish(dir);
|
||||
bool isBearishContinuationPOI = isContinuationPOI &&
|
||||
IsXBearish(dir);
|
||||
if (isContinuationPOI)
|
||||
{
|
||||
//
|
||||
// Print("isContinuationPOI: ", ToXString(dir));
|
||||
// DebugBreak();
|
||||
}
|
||||
|
||||
//
|
||||
// Exhaustion POI ...
|
||||
bool isExhaustionPOI = poiDetector.IsExhaustionPOI(dir, barIndex);
|
||||
bool isBullishExhaustionPOI = isExhaustionPOI &&
|
||||
IsXBullish(dir);
|
||||
bool isBearishExhaustionPOI = isExhaustionPOI &&
|
||||
IsXBearish(dir);
|
||||
if (isExhaustionPOI)
|
||||
{
|
||||
//
|
||||
// Print("isExhaustionPOI: ", ToXString(dir));
|
||||
// DebugBreak();
|
||||
}
|
||||
|
||||
//
|
||||
// TrendExhausted POI ...
|
||||
bool isTrendExhaustedPOI = poiDetector.IsTrendExhaustedPOI(dir, barIndex);
|
||||
bool isBullishTrendExhaustedPOI = isTrendExhaustedPOI &&
|
||||
IsXBullish(dir);
|
||||
bool isBearishTrendExhaustedPOI = isTrendExhaustedPOI &&
|
||||
IsXBearish(dir);
|
||||
if (isTrendExhaustedPOI)
|
||||
{
|
||||
//
|
||||
Print("isTrendExhaustedPOI: ", ToXString(dir));
|
||||
DebugBreak();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check Bar Has Signal Based on Strategy 2 ...
|
||||
*
|
||||
* Trend‑following:
|
||||
* - Requires KI Fast + KI Slow alignment.
|
||||
* - Confirms with MA crossover.
|
||||
* - RSI filter to avoid false signals.
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Strategy2HasSignal(
|
||||
XOHCL &bar,
|
||||
XBoxZone &zone,
|
||||
XTarget &targets[],
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
zone.Clean();
|
||||
XClean(targets);
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int barIndex = bar.Index() + 1;
|
||||
|
||||
//
|
||||
bool isBullish = kiParser.IsBullishMomentumTrend(bar.Index());
|
||||
bool isBearish = kiParser.IsBearishMomentumTrend(bar.Index());
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
dir = isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: isBearish
|
||||
? X_DIRECTION_BEARISH
|
||||
: X_DIRECTION_NONE;
|
||||
result = ToBox(bar, zone, dir, X_BAR_PATTERN_MOMENTUM);
|
||||
result =
|
||||
result &&
|
||||
zone.IsValid() &&
|
||||
HasDirection(dir);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Bar Has Signal Based on Strategy 3 ...
|
||||
*
|
||||
* Breakout:
|
||||
* - Detects price breaking KI bands with ATR confirmation.
|
||||
* - Confirms with Momentum Bar pattern.
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Strategy3HasSignal(
|
||||
XOHCL &bar,
|
||||
XBoxZone &zone,
|
||||
XTarget &targets[],
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
zone.Clean();
|
||||
XClean(targets);
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = poiDetector.IsBullishBreakoutPOI(bar.Index());
|
||||
bool isBearish = poiDetector.IsBearishBreakoutPOI(bar.Index());
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
dir = isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: isBearish
|
||||
? X_DIRECTION_BEARISH
|
||||
: X_DIRECTION_NONE;
|
||||
result = ToBox(bar, zone, dir, X_BAR_PATTERN_TRUE_GAPED);
|
||||
result =
|
||||
result &&
|
||||
zone.IsValid() &&
|
||||
HasDirection(dir);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Bar Has Signal Based on Strategy 4 ...
|
||||
*
|
||||
* Exhaustion:
|
||||
* - Strong trend + RSI extreme + volatility low.
|
||||
* - Confirms with Piercing/Dark Cloud Cover candlestick.
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Strategy4HasSignal(
|
||||
XOHCL &bar,
|
||||
XBoxZone &zone,
|
||||
XTarget &targets[],
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
zone.Clean();
|
||||
XClean(targets);
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = poiDetector.IsBullishTrendExhaustedPOI(bar.Index());
|
||||
bool isBearish = poiDetector.IsBearishTrendExhaustedPOI(bar.Index());
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
dir = isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: isBearish
|
||||
? X_DIRECTION_BEARISH
|
||||
: X_DIRECTION_NONE;
|
||||
result = ToBox(bar, zone, dir, X_BAR_PATTERN_PIERCING);
|
||||
result =
|
||||
result &&
|
||||
zone.IsValid() &&
|
||||
HasDirection(dir);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Bar Has Signal Based on Strategy 5 ...
|
||||
*
|
||||
* Continuation:
|
||||
* - Requires strong trend confirmation (KI fast/slow + MA crossover + RSI filter).
|
||||
* - Confirms with continuation candlestick patterns (Flag or Rising pattern).
|
||||
* - Ensures zone validity for entry.
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Strategy5HasSignal(
|
||||
XOHCL &bar,
|
||||
XBoxZone &zone,
|
||||
XTarget &targets[],
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
zone.Clean();
|
||||
XClean(targets);
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = kiParser.IsTrendStrongBullish(bar.Index());
|
||||
bool isBearish = kiParser.IsTrendStrongBearish(bar.Index());
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Confirm Direction by Candlestick Continuation Patterns ...
|
||||
isBullish =
|
||||
isBullish &&
|
||||
poiDetector.IsBullishContinuationPOI(bar.Index());
|
||||
isBearish =
|
||||
isBearish &&
|
||||
poiDetector.IsBearishContinuationPOI(bar.Index());
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
dir = isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: isBearish
|
||||
? X_DIRECTION_BEARISH
|
||||
: X_DIRECTION_NONE;
|
||||
result = ToBox(bar, zone, dir, X_BAR_PATTERN_PIERCING);
|
||||
result =
|
||||
result &&
|
||||
zone.IsValid() &&
|
||||
HasDirection(dir);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -13,58 +13,7 @@
|
||||
{
|
||||
"id": "6f8db3d6-fcaa-4522-bee5-0e3e38c96e73",
|
||||
"title": "Doing",
|
||||
"cards": [
|
||||
{
|
||||
"id": "1b86f94a-a66e-482c-9172-c9dbb338bb63",
|
||||
"listId": "6f8db3d6-fcaa-4522-bee5-0e3e38c96e73",
|
||||
"title": "Testing POI(s) for Strategies ...",
|
||||
"description": "we have some POIs in POI Detectors ...\nin this task we have to test them Works ...",
|
||||
"labels": [],
|
||||
"checkboxes": [
|
||||
{
|
||||
"id": "224b6c66-341f-4dda-aa25-6b45ab034a6e",
|
||||
"title": "Add Support Testing them;",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "50caaa08-a3a4-4be5-85d8-4ab41e8dd945",
|
||||
"title": "Add Support for Safe Entry;",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "95ee0eba-4e0d-4a6a-be62-93aa562ab767",
|
||||
"title": "POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "aec8ebe5-0d88-4ea7-bfd3-eb1a26af8a55",
|
||||
"title": "Breakout POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "6104db5f-95b2-401a-9efd-354b685e7a5f",
|
||||
"title": "Reversal POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "05aaad69-af4d-4253-89a7-e46a80cae593",
|
||||
"title": "Continuation POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "a7a75d64-00dd-4004-bab2-5040a47b8441",
|
||||
"title": "Exhaustion POI",
|
||||
"checked": false
|
||||
},
|
||||
{
|
||||
"id": "a9c52b07-9a50-4c30-abf9-cd8e3febb6aa",
|
||||
"title": "TrendExhausted POI",
|
||||
"checked": false
|
||||
}
|
||||
],
|
||||
"comments": []
|
||||
}
|
||||
]
|
||||
"cards": []
|
||||
},
|
||||
{
|
||||
"id": "c6b07a7f-d2e7-4f67-a5a9-0d93cd8bf981",
|
||||
@@ -119,6 +68,61 @@
|
||||
"comment": "here we are going to test changes ..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1b86f94a-a66e-482c-9172-c9dbb338bb63",
|
||||
"listId": "c6b07a7f-d2e7-4f67-a5a9-0d93cd8bf981",
|
||||
"title": "Testing POI(s) for Strategies ...",
|
||||
"description": "we have some POIs in POI Detectors ...\nin this task we have to test them Works ...",
|
||||
"labels": [],
|
||||
"checkboxes": [
|
||||
{
|
||||
"id": "224b6c66-341f-4dda-aa25-6b45ab034a6e",
|
||||
"title": "Add Support Testing them;",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "50caaa08-a3a4-4be5-85d8-4ab41e8dd945",
|
||||
"title": "Add Support for Safe Entry;",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "95ee0eba-4e0d-4a6a-be62-93aa562ab767",
|
||||
"title": "POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "aec8ebe5-0d88-4ea7-bfd3-eb1a26af8a55",
|
||||
"title": "Breakout POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "6104db5f-95b2-401a-9efd-354b685e7a5f",
|
||||
"title": "Reversal POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "05aaad69-af4d-4253-89a7-e46a80cae593",
|
||||
"title": "Continuation POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "a7a75d64-00dd-4004-bab2-5040a47b8441",
|
||||
"title": "Exhaustion POI",
|
||||
"checked": true
|
||||
},
|
||||
{
|
||||
"id": "a9c52b07-9a50-4c30-abf9-cd8e3febb6aa",
|
||||
"title": "TrendExhausted POI",
|
||||
"checked": true
|
||||
}
|
||||
],
|
||||
"comments": [
|
||||
{
|
||||
"id": "cbcb5bf5-898d-4f5a-88bc-55007a11244c",
|
||||
"comment": "all POI(s) noe well tested ...\nand everythings ready for implementing Strategies ..."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user