last ...
This commit is contained in:
@@ -0,0 +1,431 @@
|
||||
//
|
||||
bool isPeakPivot = conditions.isPeakIsPivot;
|
||||
bool isValePivot = conditions.isValeIsPivot;
|
||||
|
||||
//
|
||||
bool isPivotBullish = isValePivot &&
|
||||
isCBarValidForBullish;
|
||||
|
||||
//
|
||||
bool isPivotBearish = isPeakPivot &&
|
||||
isCBarValidForBearish;
|
||||
|
||||
//
|
||||
bool isPivotBullishReversal =
|
||||
//
|
||||
isPivotBullish &&
|
||||
conditions.isKIBearish &&
|
||||
conditions.isSarBearish &&
|
||||
conditions.isTrendBearish &&
|
||||
conditions.isLastSupportRejected
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPivotBearishReversal =
|
||||
//
|
||||
isPivotBearish &&
|
||||
conditions.isKIBullish &&
|
||||
conditions.isSarBullish &&
|
||||
conditions.isTrendBullish &&
|
||||
conditions.isLastResistanceRejected
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPivot = isPivotBullishReversal ||
|
||||
isPivotBearishReversal;
|
||||
|
||||
if (isPivot)
|
||||
{
|
||||
Print("Pivot: ");
|
||||
|
||||
//
|
||||
if (isPivotBullish)
|
||||
{
|
||||
Print("Bullish: ", isPivotBullish);
|
||||
}
|
||||
|
||||
//
|
||||
if (isPivotBearish)
|
||||
{
|
||||
Print("Bearish: ", isPivotBearish);
|
||||
}
|
||||
|
||||
//
|
||||
Print("Bullish Score: ", bullishScore);
|
||||
Print("Bearish Score: ", bearishScore);
|
||||
}
|
||||
|
||||
//
|
||||
bool isOverFib2 = pBar.low > conditions.fiboLevel2Buffer[cIDX];
|
||||
bool isUnderFib2 = pBar.high < conditions.fiboLevel2Buffer[cIDX];
|
||||
|
||||
//
|
||||
bool isTrendBasedBullish =
|
||||
isUnderFib2 &&
|
||||
isCBarValidForBullish &&
|
||||
conditions.isTrendRejectUp;
|
||||
|
||||
//
|
||||
bool isTrendBasedBearish =
|
||||
isOverFib2 &&
|
||||
isCBarValidForBearish &&
|
||||
conditions.isTrendRejectDown;
|
||||
|
||||
//
|
||||
bool isTrend =
|
||||
isTrendBasedBullish ||
|
||||
isTrendBasedBearish;
|
||||
|
||||
//
|
||||
if (isTrend)
|
||||
{
|
||||
Print("Trend Based ...");
|
||||
}
|
||||
|
||||
//
|
||||
bool isBarBreakedKITrendBullish =
|
||||
cBar.IsBullish() &&
|
||||
isCBarBullishMomentum &&
|
||||
cBar.open < conditions.kiBuffer[cIDX] &&
|
||||
cBar.close > conditions.kiBuffer[cIDX] &&
|
||||
cBar.open < conditions.trendBuffer[cIDX] &&
|
||||
cBar.close > conditions.trendBuffer[cIDX];
|
||||
|
||||
//
|
||||
bool isBarBreakedKITrendBearish =
|
||||
cBar.IsBearish() &&
|
||||
isCBarBearishMomentum &&
|
||||
cBar.open > conditions.kiBuffer[cIDX] &&
|
||||
cBar.close < conditions.kiBuffer[cIDX] &&
|
||||
cBar.open > conditions.trendBuffer[cIDX] &&
|
||||
cBar.close > conditions.trendBuffer[cIDX];
|
||||
|
||||
//
|
||||
bool isKITrendBreaked =
|
||||
isBarBreakedKITrendBullish ||
|
||||
isBarBreakedKITrendBearish;
|
||||
|
||||
//
|
||||
if (isKITrendBreaked)
|
||||
{
|
||||
Print("KI Trend Breaked ...");
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// while (index <= end)
|
||||
// {
|
||||
// //
|
||||
// XCAEAConditions iConditions;
|
||||
// bool has = helper.GetConditions(
|
||||
// iConditions,
|
||||
// index,
|
||||
// 5 //
|
||||
// );
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// iConditions.Clean();
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// //
|
||||
// zIDX = 0;
|
||||
// cIDX = zIDX + 1;
|
||||
// pIDX = cIDX + 1;
|
||||
// p2IDX = pIDX + 1;
|
||||
|
||||
// //
|
||||
// XOHCL cBar;
|
||||
// has = cBar.Init(
|
||||
// iConditions.symbol,
|
||||
// iConditions.period,
|
||||
// index + 1 //
|
||||
// );
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// cBar.Clean();
|
||||
// iConditions.Clean();
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Read Reuired Data ...
|
||||
|
||||
// //
|
||||
// // KI ...
|
||||
|
||||
// //
|
||||
// double cKI = iConditions.kiBuffer[cIDX];
|
||||
// double pKI = iConditions.kiBuffer[pIDX];
|
||||
// double p2KI = iConditions.kiBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// double cKIState = iConditions.kiStateBuffer[cIDX];
|
||||
// double pKIState = iConditions.kiStateBuffer[pIDX];
|
||||
// double p2KIState = iConditions.kiStateBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // TKI ...
|
||||
|
||||
// //
|
||||
// double cTKI = iConditions.tkiBuffer[cIDX];
|
||||
// double pTKI = iConditions.tkiBuffer[pIDX];
|
||||
// double p2TKI = iConditions.tkiBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// double cTKIState = iConditions.tkiStateBuffer[cIDX];
|
||||
// double pTKIState = iConditions.tkiStateBuffer[pIDX];
|
||||
// double p2TKIState = iConditions.tkiStateBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // TREND ...
|
||||
|
||||
// //
|
||||
// double cTrend = iConditions.trendBuffer[cIDX];
|
||||
// double pTrend = iConditions.trendBuffer[pIDX];
|
||||
// double p2Trend = iConditions.trendBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// double ctrendState = iConditions.trendStateBuffer[cIDX];
|
||||
// double ptrendState = iConditions.trendStateBuffer[pIDX];
|
||||
// double p2trendState = iConditions.trendStateBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // SWING Low ...
|
||||
|
||||
// //
|
||||
// double cSWL = iConditions.swingLowBuffer[cIDX];
|
||||
// double pSWL = iConditions.swingLowBuffer[pIDX];
|
||||
// double p2SWL = iConditions.swingLowBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // SWING High ...
|
||||
|
||||
// //
|
||||
// double cSWH = iConditions.swingHighBuffer[cIDX];
|
||||
// double pSWH = iConditions.swingHighBuffer[pIDX];
|
||||
// double p2SWH = iConditions.swingHighBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // PEAK ...
|
||||
|
||||
// //
|
||||
// double cPeak = iConditions.peakBuffer[cIDX];
|
||||
// double pPeak = iConditions.peakBuffer[pIDX];
|
||||
// double p2Peak = iConditions.peakBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // VALE ...
|
||||
|
||||
// //
|
||||
// double cVale = iConditions.valeBuffer[cIDX];
|
||||
// double pVale = iConditions.valeBuffer[pIDX];
|
||||
// double p2Vale = iConditions.valeBuffer[p2IDX];
|
||||
|
||||
// //
|
||||
// // Required Condirions ...
|
||||
|
||||
// //
|
||||
// bool isTKITRNDBullish =
|
||||
// iConditions.isKIBullish &&
|
||||
// iConditions.isTKIBullish &&
|
||||
// iConditions.isTrendBullish;
|
||||
|
||||
// //
|
||||
// bool isTKITRNDBearish =
|
||||
// iConditions.isKIBearish &&
|
||||
// iConditions.isTKIBearish &&
|
||||
// iConditions.isTrendBearish;
|
||||
|
||||
// //
|
||||
// XBoxZone iBox;
|
||||
|
||||
// //
|
||||
// // Check FVG ...
|
||||
// bool isFVG = barAnalyser.IsFVG(
|
||||
// cBar,
|
||||
// iBox,
|
||||
// false // Force Same Bars ...
|
||||
// );
|
||||
// if (isFVG)
|
||||
// {
|
||||
// //
|
||||
// // Validate FVG ...
|
||||
// bool isFVGBullish = iBox.IsBullish();
|
||||
|
||||
// // //
|
||||
// // isFVG =
|
||||
// // isFVGBullish
|
||||
// // ? isTKITRNDBullish
|
||||
// // : isTKITRNDBearish;
|
||||
|
||||
// //
|
||||
// if (isFVG)
|
||||
// {
|
||||
// //
|
||||
// XCBoxObject *iObj;
|
||||
// has = drawer.DrawBox(
|
||||
// iBox,
|
||||
// iObj //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// iObj.BoxWidth(2);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// index++;
|
||||
// cBar.Clean();
|
||||
// iConditions.Clean();
|
||||
// }
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
XBoxZone tmpFVGBoxes[];
|
||||
|
||||
//
|
||||
int index = barIndex;
|
||||
int end = index + loopback;
|
||||
while (index <= end)
|
||||
{
|
||||
//
|
||||
XOHCL cBar;
|
||||
bool has = cBar.Init(
|
||||
helper.GetSymbol(),
|
||||
helper.GetPeriod(),
|
||||
index + 1 //
|
||||
);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
cBar.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Check FVG ...
|
||||
XBoxZone iBox;
|
||||
bool isFVG = barAnalyser.IsFVG(
|
||||
cBar,
|
||||
iBox,
|
||||
false // Force Same Bars ...
|
||||
);
|
||||
if (isFVG)
|
||||
{
|
||||
//
|
||||
AddBox(
|
||||
iBox,
|
||||
tmpFVGBoxes //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
index++;
|
||||
cBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
bool has = false;
|
||||
if (HasChild(tmpFVGBoxes))
|
||||
{
|
||||
//
|
||||
while (HasChild(tmpFVGBoxes))
|
||||
{
|
||||
//
|
||||
idx = GetYoungest(tmpFVGBoxes);
|
||||
has = IsValidIndex(idx);
|
||||
if (!has)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
XBoxZone iBox = tmpFVGBoxes[idx];
|
||||
ArrayRemove(
|
||||
tmpFVGBoxes,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
// Here We Have to Validate FVG ...
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
has = HasPeakPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
count = CountPeakPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot = peakPivots[i];
|
||||
|
||||
//
|
||||
int toIDX = iPivot.ToIndex();
|
||||
int fromIDX = iPivot.FromIndex();
|
||||
has = IsValidIndex(toIDX) &&
|
||||
IsValidIndex(fromIDX);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
iPivot.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
for (int j = toIDX; j <= fromIDX; j++) {
|
||||
//
|
||||
XCAEAConditions jConditions;
|
||||
has = helper.GetConditions(
|
||||
jConditions,
|
||||
j,
|
||||
5 //
|
||||
);
|
||||
if (!has) {
|
||||
//
|
||||
jConditions.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
datetime jTime = GetBarTime(
|
||||
jConditions.symbol,
|
||||
jConditions.period,
|
||||
j //
|
||||
);
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -0,0 +1,481 @@
|
||||
///////////////////////////////////////////////////////
|
||||
//
|
||||
// SaherElm IT Center MQL5 Indicator
|
||||
// -------------------------------------------------
|
||||
// Name: XCXCAEAPOIDetector ...
|
||||
// Description: Class for XCAEA POI Detector ...
|
||||
//
|
||||
//
|
||||
// Maintainer:
|
||||
// ------------
|
||||
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
||||
//
|
||||
//////////////////////////////////////////////////////
|
||||
//
|
||||
// Global Properties ...
|
||||
#property copyright "Copyright 2023, SaherElm IT Center"
|
||||
#property link "https://saherelm.ir"
|
||||
#property version "1.00"
|
||||
#property description "SaherElm Class for XCAEA POI Detector"
|
||||
#property strict
|
||||
|
||||
//
|
||||
// Imports ...
|
||||
#include "../../Classes/x-saherelm.x-bar.analyser.class.mq5"
|
||||
#include "../Helpers/xcaea.helper.mq5"
|
||||
|
||||
//
|
||||
// Definitions ...
|
||||
|
||||
// enum ENUM_X_PIVOT_KINDS
|
||||
// {
|
||||
// X_PIVOT_SWL, // SWL
|
||||
// X_PIVOT_SWH, // SWH
|
||||
// };
|
||||
|
||||
// string ToString(ENUM_X_PIVOT_KINDS value)
|
||||
// {
|
||||
// //
|
||||
// string result = NULL;
|
||||
|
||||
// //
|
||||
// result = EnumToString(value);
|
||||
|
||||
// //
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// struct XSamePivot
|
||||
// {
|
||||
// //
|
||||
// // Props ...
|
||||
// datetime to;
|
||||
// string type;
|
||||
// double value;
|
||||
// datetime from;
|
||||
// string symbol;
|
||||
// ENUM_X_DIRECTION dir;
|
||||
// ENUM_TIMEFRAMES period;
|
||||
|
||||
// //
|
||||
// // Constructor ...
|
||||
// XSamePivot()
|
||||
// {
|
||||
// Clean();
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Tools ...
|
||||
|
||||
// /**
|
||||
// * Cleanup Model ...
|
||||
// */
|
||||
// void Clean()
|
||||
// {
|
||||
// //
|
||||
// to = NULL;
|
||||
// value = 0;
|
||||
// from = NULL;
|
||||
// type = NULL;
|
||||
// symbol = NULL;
|
||||
// period = NULL;
|
||||
// dir = X_DIRECTION_NONE;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Validate Model ...
|
||||
// *
|
||||
// * @return ( bool )
|
||||
// */
|
||||
// bool IsValid()
|
||||
// {
|
||||
// //
|
||||
// bool result = false;
|
||||
|
||||
// //
|
||||
// result =
|
||||
// //
|
||||
// from < to &&
|
||||
// value != 0 &&
|
||||
// IsValid(to) &&
|
||||
// IsValid(from) &&
|
||||
// IsValid(symbol) &&
|
||||
// IsValid(period) &&
|
||||
// HasDirection(dir)
|
||||
// //
|
||||
// ;
|
||||
|
||||
// //
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Check a Model is Same As Other ...
|
||||
// *
|
||||
// * @return ( bool )
|
||||
// */
|
||||
// bool IsSameAs(XSamePivot &item)
|
||||
// {
|
||||
// //
|
||||
// bool result = false;
|
||||
|
||||
// //
|
||||
// result = IsValid() &&
|
||||
// item.IsValid();
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// //
|
||||
// result =
|
||||
// //
|
||||
// to == item.to &&
|
||||
// dir == item.dir &&
|
||||
// from == item.from &&
|
||||
// type == item.type &&
|
||||
// value == item.value &&
|
||||
// symbol == item.symbol &&
|
||||
// period == item.period
|
||||
// //
|
||||
// ;
|
||||
|
||||
// //
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// //
|
||||
// };
|
||||
|
||||
//
|
||||
// Implementations ...
|
||||
class XCXCAEAPOIDetector : public XCBase
|
||||
{
|
||||
//
|
||||
// Public ...
|
||||
public:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Constructors ...
|
||||
XCXCAEAPOIDetector(
|
||||
XCXCAEAHelper *_helper //
|
||||
)
|
||||
{
|
||||
//
|
||||
helper = _helper;
|
||||
barAnalyser = new XCBarAnalyser();
|
||||
|
||||
//
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
// De Constructors ...
|
||||
~XCXCAEAPOIDetector()
|
||||
{
|
||||
//
|
||||
Clean(tkitrndPivots);
|
||||
|
||||
//
|
||||
ZeroMemory(helper);
|
||||
ZeroMemory(barAnalyser);
|
||||
}
|
||||
|
||||
//
|
||||
// Properties ...
|
||||
|
||||
int TITrndPivotVerification()
|
||||
{
|
||||
return tkitrndPivotVerification;
|
||||
}
|
||||
|
||||
void TKITrndPivotVerification(int value)
|
||||
{
|
||||
//
|
||||
value = NormalizeInt(value, 0);
|
||||
|
||||
//
|
||||
tkitrndPivotVerification = value;
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
virtual void Default()
|
||||
{
|
||||
//
|
||||
TKITrndPivotVerification(10);
|
||||
}
|
||||
|
||||
//
|
||||
void Update(
|
||||
int barIndex = 0,
|
||||
int loopback = 100 //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
loopback = NormalizeInt(loopback, 100);
|
||||
|
||||
//
|
||||
int index = barIndex;
|
||||
int end = index + loopback;
|
||||
while (index <= end)
|
||||
{
|
||||
//
|
||||
XCAEAConditions iConditions;
|
||||
bool has = helper.GetConditions(
|
||||
iConditions,
|
||||
index,
|
||||
loopback //
|
||||
);
|
||||
|
||||
//
|
||||
// Detecting Same Pivots ...
|
||||
// HandleTKITRNDPivotDetection(iConditions, index);
|
||||
|
||||
//
|
||||
index++;
|
||||
iConditions.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// POI Handlers ...
|
||||
|
||||
// bool HasTKITRNDPivots()
|
||||
// {
|
||||
// return HasChild(tkitrndPivots);
|
||||
// }
|
||||
|
||||
// int CountTKITRNDPivots()
|
||||
// {
|
||||
// return ArraySize(tkitrndPivots);
|
||||
// }
|
||||
|
||||
// int FillTKITRNDPivots(XSamePivot &pivots[])
|
||||
// {
|
||||
// //
|
||||
// int result = 0;
|
||||
|
||||
// //
|
||||
// if (!HasTKITRNDPivots())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// //
|
||||
// Copy(
|
||||
// tkitrndPivots,
|
||||
// pivots //
|
||||
// );
|
||||
|
||||
// //
|
||||
// result = ArraySize(pivots);
|
||||
|
||||
// //
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// bool IsTKITRNDPivotExists(
|
||||
// int &index,
|
||||
// XSamePivot &pivot //
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// bool result = false;
|
||||
|
||||
// //
|
||||
// index = -1;
|
||||
|
||||
// //
|
||||
// result = pivot.IsValid() &&
|
||||
// HasTKITRNDPivots();
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// //
|
||||
// int count = CountTKITRNDPivots();
|
||||
// for (int i = 0; i < count; i++)
|
||||
// {
|
||||
// //
|
||||
// XSamePivot iPivot = tkitrndPivots[i];
|
||||
|
||||
// //
|
||||
// bool isSame =
|
||||
// pivot.IsSameAs(iPivot);
|
||||
// if (isSame)
|
||||
// {
|
||||
// //
|
||||
// index = i;
|
||||
// iPivot.Clean();
|
||||
|
||||
// //
|
||||
// break;
|
||||
// }
|
||||
|
||||
// //
|
||||
// iPivot.Clean();
|
||||
// }
|
||||
|
||||
// //
|
||||
// result = IsValidIndex(index);
|
||||
|
||||
// //
|
||||
// return result;
|
||||
// }
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
// //
|
||||
// void HandleTKITRNDPivotDetection(
|
||||
// XCAEAConditions &conditions,
|
||||
// int barIndex = 0 //
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// if (barIndex < 0)
|
||||
// {
|
||||
// barIndex = 0;
|
||||
// }
|
||||
|
||||
// //
|
||||
// if (tkitrndPivotVerification <= 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// //
|
||||
// datetime barTime = GetBarTime(
|
||||
// conditions.symbol,
|
||||
// conditions.period,
|
||||
// barIndex + 1 //
|
||||
// );
|
||||
|
||||
// //
|
||||
// int index = 2;
|
||||
// datetime cTime = barTime;
|
||||
// int end = ArraySize(conditions.swingLowBuffer);
|
||||
|
||||
// //
|
||||
// int swingLowVerified = 0;
|
||||
// datetime swingLowFinishAt = NULL;
|
||||
// datetime swingLowStartAt = barTime;
|
||||
// double swingLow = conditions.swingLowBuffer[1];
|
||||
// bool canLookupSwingLow = true;
|
||||
|
||||
// //
|
||||
// bool isVerified = false;
|
||||
// bool canContinue = true;
|
||||
// while (index < end && canContinue)
|
||||
// {
|
||||
// //
|
||||
// cTime += PeriodSeconds(conditions.period);
|
||||
|
||||
// //
|
||||
// // Swing Low ...
|
||||
// double iSWL = conditions.swingLowBuffer[index];
|
||||
// if (iSWL == swingLow)
|
||||
// {
|
||||
// swingLowVerified++;
|
||||
// }
|
||||
// else if (iSWL != swingLow)
|
||||
// {
|
||||
// //
|
||||
// isVerified = swingLowVerified >= tkitrndPivotVerification;
|
||||
// if (isVerified)
|
||||
// {
|
||||
// //
|
||||
// swingLowFinishAt = cTime;
|
||||
|
||||
// //
|
||||
// XSamePivot iPivot;
|
||||
|
||||
// //
|
||||
// iPivot.value = swingLow;
|
||||
// iPivot.to = swingLowFinishAt;
|
||||
// iPivot.from = swingLowStartAt;
|
||||
// iPivot.dir = X_DIRECTION_BULLISH;
|
||||
// iPivot.symbol = conditions.symbol;
|
||||
// iPivot.period = conditions.period;
|
||||
// iPivot.type = ToString(X_PIVOT_SWL);
|
||||
|
||||
// //
|
||||
// if (iPivot.IsValid())
|
||||
// {
|
||||
// AddOrUpdateTKITRNDPivot(iPivot);
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Reset ...
|
||||
// swingLow = iSWL;
|
||||
// swingLowVerified = 0;
|
||||
// swingLowFinishAt = NULL;
|
||||
// swingLowStartAt = cTime;
|
||||
// canLookupSwingLow = true;
|
||||
// }
|
||||
|
||||
// //
|
||||
// index++;
|
||||
|
||||
// //
|
||||
// canContinue = canLookupSwingLow;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// void AddOrUpdateTKITRNDPivot(XSamePivot &pivot)
|
||||
// {
|
||||
// //
|
||||
// int idx = -1;
|
||||
// bool isExists = IsTKITRNDPivotExists(
|
||||
// idx,
|
||||
// pivot //
|
||||
// );
|
||||
// if (isExists)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// //
|
||||
// AddRef(
|
||||
// pivot,
|
||||
// tkitrndPivots //
|
||||
// );
|
||||
// }
|
||||
|
||||
//
|
||||
// Prrivate ...
|
||||
private:
|
||||
//
|
||||
// Props ...
|
||||
int tkitrndPivotVerification; // KI/TKI/Trend Verification ...
|
||||
|
||||
//
|
||||
XCXCAEAHelper *helper;
|
||||
XCBarAnalyser *barAnalyser;
|
||||
|
||||
//
|
||||
// Same Pivots ...
|
||||
// XSamePivot tkitrndPivots[]; // TKITrend is Bullish/Bearish and Swing Low/High Under / Over Min / Max ...
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user