add supports for VIDYA in xca and also it's helper and in xcaea ...
This commit is contained in:
@@ -55,9 +55,11 @@ enum ENUM_X121_XCA_BUFFERS
|
|||||||
X121_XCA_SWING_LOW_LINE = 22,
|
X121_XCA_SWING_LOW_LINE = 22,
|
||||||
X121_XCA_SWING_HIGH_LINE = 23,
|
X121_XCA_SWING_HIGH_LINE = 23,
|
||||||
X121_XCA_TKI_LINE = 24,
|
X121_XCA_TKI_LINE = 24,
|
||||||
X121_XCA_TREND_STATE_LINE = 26,
|
X121_XCA_VIDYA_LINE = 26,
|
||||||
X121_XCA_KI_STATE_LINE = 27,
|
X121_XCA_TREND_STATE_LINE = 28,
|
||||||
X121_XCA_TKI_STATE_LINE = 28,
|
X121_XCA_KI_STATE_LINE = 29,
|
||||||
|
X121_XCA_TKI_STATE_LINE = 30,
|
||||||
|
X121_XCA_VIDYA_STATE_LINE = 31,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -111,6 +113,12 @@ struct X121XCAInputs
|
|||||||
// KI ...
|
// KI ...
|
||||||
int kiLength; // KI Length
|
int kiLength; // KI Length
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
int vidyaCMOLength; // CMO (Candle Momentum) Length
|
||||||
|
int vidyaEMALength; // EMA Length
|
||||||
|
ENUM_APPLIED_PRICE vidyaAppliedTo; // Applied To
|
||||||
|
|
||||||
//
|
//
|
||||||
// Swing Detection ...
|
// Swing Detection ...
|
||||||
int swingLength; // Length
|
int swingLength; // Length
|
||||||
@@ -130,6 +138,7 @@ struct X121XCAInputs
|
|||||||
bool showSar; // Show Sar
|
bool showSar; // Show Sar
|
||||||
bool showKI; // Show KI
|
bool showKI; // Show KI
|
||||||
bool showTKI; // Show TKI
|
bool showTKI; // Show TKI
|
||||||
|
bool showVidya; // Show Vidya
|
||||||
bool showTrend; // Show Trend
|
bool showTrend; // Show Trend
|
||||||
bool showSwings; // Show Swings
|
bool showSwings; // Show Swings
|
||||||
bool showFiboLevel1; // Show Fibo Level 1
|
bool showFiboLevel1; // Show Fibo Level 1
|
||||||
@@ -208,6 +217,12 @@ struct X121XCAInputs
|
|||||||
// KI ...
|
// KI ...
|
||||||
kiLength = 0; // KI Length
|
kiLength = 0; // KI Length
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
vidyaCMOLength = 0;
|
||||||
|
vidyaEMALength = 0;
|
||||||
|
vidyaAppliedTo = PRICE_CLOSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Swing Detection ...
|
// Swing Detection ...
|
||||||
swingLength = 0; // Length
|
swingLength = 0; // Length
|
||||||
@@ -227,6 +242,7 @@ struct X121XCAInputs
|
|||||||
showSar = true; // Show Sar
|
showSar = true; // Show Sar
|
||||||
showKI = true; // Show KI
|
showKI = true; // Show KI
|
||||||
showTKI = true; // Show TKI
|
showTKI = true; // Show TKI
|
||||||
|
showVidya = true; // Show Vidya
|
||||||
showTrend = true; // Show Trend
|
showTrend = true; // Show Trend
|
||||||
showSwings = true; // Show Swings
|
showSwings = true; // Show Swings
|
||||||
showFiboLevel1 = true; // Show Fibo Level 1
|
showFiboLevel1 = true; // Show Fibo Level 1
|
||||||
@@ -298,6 +314,12 @@ struct X121XCAInputs
|
|||||||
// KI ...
|
// KI ...
|
||||||
kiLength = 26; // KI Length
|
kiLength = 26; // KI Length
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
vidyaCMOLength = 20;
|
||||||
|
vidyaEMALength = 14;
|
||||||
|
vidyaAppliedTo = PRICE_CLOSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Swing Detection ...
|
// Swing Detection ...
|
||||||
swingLength = 5; // Length
|
swingLength = 5; // Length
|
||||||
@@ -312,6 +334,7 @@ struct X121XCAInputs
|
|||||||
showSar = true; // Show Sar
|
showSar = true; // Show Sar
|
||||||
showKI = true; // Show KI
|
showKI = true; // Show KI
|
||||||
showTKI = true; // Show TKI
|
showTKI = true; // Show TKI
|
||||||
|
showVidya = true; // Show Vidya
|
||||||
showTrend = true; // Show Trend
|
showTrend = true; // Show Trend
|
||||||
showSwings = true; // Show Swings
|
showSwings = true; // Show Swings
|
||||||
showFiboLevel1 = true; // Show Fibo Level 1
|
showFiboLevel1 = true; // Show Fibo Level 1
|
||||||
@@ -349,6 +372,8 @@ struct X121XCAInputs
|
|||||||
kiLength > 0 &&
|
kiLength > 0 &&
|
||||||
swingLength > 0 &&
|
swingLength > 0 &&
|
||||||
sarMax > sarStep &&
|
sarMax > sarStep &&
|
||||||
|
vidyaCMOLength > 0 &&
|
||||||
|
vidyaEMALength > 0 &&
|
||||||
//
|
//
|
||||||
// XCA ...
|
// XCA ...
|
||||||
(IsValid(scMethod, scPeriod) &&
|
(IsValid(scMethod, scPeriod) &&
|
||||||
@@ -371,6 +396,8 @@ struct X121XCAInputs
|
|||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(kiLength, swingLength);
|
result = MathMax(kiLength, swingLength);
|
||||||
|
result = MathMax(result, vidyaCMOLength);
|
||||||
|
result = MathMax(result, vidyaEMALength);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -402,12 +429,14 @@ struct X121XCAConditions
|
|||||||
double sarBuffer[];
|
double sarBuffer[];
|
||||||
double peakBuffer[];
|
double peakBuffer[];
|
||||||
double valeBuffer[];
|
double valeBuffer[];
|
||||||
|
double vidyaBuffer[];
|
||||||
double trendBuffer[];
|
double trendBuffer[];
|
||||||
double kiStateBuffer[];
|
double kiStateBuffer[];
|
||||||
double supportBuffer[];
|
double supportBuffer[];
|
||||||
double tkiStateBuffer[];
|
double tkiStateBuffer[];
|
||||||
double swingLowBuffer[];
|
double swingLowBuffer[];
|
||||||
double swingHighBuffer[];
|
double swingHighBuffer[];
|
||||||
|
double vidyaStateBuffer[];
|
||||||
double resistanceBuffer[];
|
double resistanceBuffer[];
|
||||||
double peakGoldenBuffer[];
|
double peakGoldenBuffer[];
|
||||||
double valeGoldenBuffer[];
|
double valeGoldenBuffer[];
|
||||||
@@ -449,6 +478,21 @@ struct X121XCAConditions
|
|||||||
bool isTKISwitchedToBullish;
|
bool isTKISwitchedToBullish;
|
||||||
bool isTKISwitchedToBearish;
|
bool isTKISwitchedToBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaRejectUp;
|
||||||
|
bool isVidyaRejectDown;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaBullish;
|
||||||
|
bool isVidyaBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaSwitchedToBullish;
|
||||||
|
bool isVidyaSwitchedToBearish;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
|
|
||||||
@@ -596,6 +640,7 @@ struct X121XCAConditions
|
|||||||
Clean(sarBuffer);
|
Clean(sarBuffer);
|
||||||
Clean(peakBuffer);
|
Clean(peakBuffer);
|
||||||
Clean(valeBuffer);
|
Clean(valeBuffer);
|
||||||
|
Clean(vidyaBuffer);
|
||||||
Clean(trendBuffer);
|
Clean(trendBuffer);
|
||||||
Clean(kiStateBuffer);
|
Clean(kiStateBuffer);
|
||||||
Clean(supportBuffer);
|
Clean(supportBuffer);
|
||||||
@@ -608,6 +653,7 @@ struct X121XCAConditions
|
|||||||
Clean(fiboLevel1Buffer);
|
Clean(fiboLevel1Buffer);
|
||||||
Clean(fiboLevel2Buffer);
|
Clean(fiboLevel2Buffer);
|
||||||
Clean(fiboLevel3Buffer);
|
Clean(fiboLevel3Buffer);
|
||||||
|
Clean(vidyaStateBuffer);
|
||||||
Clean(trendStateBuffer);
|
Clean(trendStateBuffer);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -624,6 +670,7 @@ struct X121XCAConditions
|
|||||||
ArraySetAsSeries(sarBuffer, true);
|
ArraySetAsSeries(sarBuffer, true);
|
||||||
ArraySetAsSeries(peakBuffer, true);
|
ArraySetAsSeries(peakBuffer, true);
|
||||||
ArraySetAsSeries(valeBuffer, true);
|
ArraySetAsSeries(valeBuffer, true);
|
||||||
|
ArraySetAsSeries(vidyaBuffer, true);
|
||||||
ArraySetAsSeries(trendBuffer, true);
|
ArraySetAsSeries(trendBuffer, true);
|
||||||
ArraySetAsSeries(kiStateBuffer, true);
|
ArraySetAsSeries(kiStateBuffer, true);
|
||||||
ArraySetAsSeries(supportBuffer, true);
|
ArraySetAsSeries(supportBuffer, true);
|
||||||
@@ -636,6 +683,7 @@ struct X121XCAConditions
|
|||||||
ArraySetAsSeries(fiboLevel1Buffer, true);
|
ArraySetAsSeries(fiboLevel1Buffer, true);
|
||||||
ArraySetAsSeries(fiboLevel2Buffer, true);
|
ArraySetAsSeries(fiboLevel2Buffer, true);
|
||||||
ArraySetAsSeries(fiboLevel3Buffer, true);
|
ArraySetAsSeries(fiboLevel3Buffer, true);
|
||||||
|
ArraySetAsSeries(vidyaStateBuffer, true);
|
||||||
ArraySetAsSeries(trendStateBuffer, true);
|
ArraySetAsSeries(trendStateBuffer, true);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -671,6 +719,21 @@ struct X121XCAConditions
|
|||||||
isTKISwitchedToBullish = false;
|
isTKISwitchedToBullish = false;
|
||||||
isTKISwitchedToBearish = false;
|
isTKISwitchedToBearish = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
isVidyaRejectUp = false;
|
||||||
|
isVidyaRejectDown = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isVidyaBullish = false;
|
||||||
|
isVidyaBearish = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isVidyaSwitchedToBullish = false;
|
||||||
|
isVidyaSwitchedToBearish = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
|
|
||||||
@@ -866,6 +929,37 @@ struct X121XCAConditions
|
|||||||
bearishScore += minScore;
|
bearishScore += minScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isVidyaBullish)
|
||||||
|
{
|
||||||
|
bullishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaRejectUp)
|
||||||
|
{
|
||||||
|
bullishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaSwitchedToBullish)
|
||||||
|
{
|
||||||
|
bullishScore += minScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isVidyaBearish)
|
||||||
|
{
|
||||||
|
bearishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaRejectDown)
|
||||||
|
{
|
||||||
|
bearishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaSwitchedToBearish)
|
||||||
|
{
|
||||||
|
bearishScore += minScore;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
|
|
||||||
@@ -1136,6 +1230,12 @@ struct X121XCAConditions
|
|||||||
ToString("isTKIBearish", isTKIBearish, ignoreFalseConditions, separator) +
|
ToString("isTKIBearish", isTKIBearish, ignoreFalseConditions, separator) +
|
||||||
ToString("isTKISwitchedToBullish", isTKISwitchedToBullish, ignoreFalseConditions, separator) +
|
ToString("isTKISwitchedToBullish", isTKISwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
ToString("isTKISwitchedToBearish", isTKISwitchedToBearish, ignoreFalseConditions, separator) +
|
ToString("isTKISwitchedToBearish", isTKISwitchedToBearish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaRejectUp", isVidyaRejectUp, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaRejectDown", isVidyaRejectDown, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaBullish", isVidyaBullish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaBearish", isVidyaBearish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaSwitchedToBullish", isVidyaSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaSwitchedToBearish", isVidyaSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
@@ -1258,6 +1358,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
Clean(sarBuffer);
|
Clean(sarBuffer);
|
||||||
Clean(peakBuffer);
|
Clean(peakBuffer);
|
||||||
Clean(valeBuffer);
|
Clean(valeBuffer);
|
||||||
|
Clean(vidyaBuffer);
|
||||||
Clean(trendBuffer);
|
Clean(trendBuffer);
|
||||||
Clean(kiStateBuffer);
|
Clean(kiStateBuffer);
|
||||||
Clean(supportBuffer);
|
Clean(supportBuffer);
|
||||||
@@ -1271,6 +1372,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
Clean(fiboLevel2Buffer);
|
Clean(fiboLevel2Buffer);
|
||||||
Clean(fiboLevel3Buffer);
|
Clean(fiboLevel3Buffer);
|
||||||
Clean(trendStateBuffer);
|
Clean(trendStateBuffer);
|
||||||
|
Clean(vidyaStateBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1309,6 +1411,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
ArraySetAsSeries(sarBuffer, true);
|
ArraySetAsSeries(sarBuffer, true);
|
||||||
ArraySetAsSeries(peakBuffer, true);
|
ArraySetAsSeries(peakBuffer, true);
|
||||||
ArraySetAsSeries(valeBuffer, true);
|
ArraySetAsSeries(valeBuffer, true);
|
||||||
|
ArraySetAsSeries(vidyaBuffer, true);
|
||||||
ArraySetAsSeries(trendBuffer, true);
|
ArraySetAsSeries(trendBuffer, true);
|
||||||
ArraySetAsSeries(kiStateBuffer, true);
|
ArraySetAsSeries(kiStateBuffer, true);
|
||||||
ArraySetAsSeries(supportBuffer, true);
|
ArraySetAsSeries(supportBuffer, true);
|
||||||
@@ -1321,6 +1424,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
ArraySetAsSeries(fiboLevel1Buffer, true);
|
ArraySetAsSeries(fiboLevel1Buffer, true);
|
||||||
ArraySetAsSeries(fiboLevel2Buffer, true);
|
ArraySetAsSeries(fiboLevel2Buffer, true);
|
||||||
ArraySetAsSeries(fiboLevel3Buffer, true);
|
ArraySetAsSeries(fiboLevel3Buffer, true);
|
||||||
|
ArraySetAsSeries(vidyaStateBuffer, true);
|
||||||
ArraySetAsSeries(trendStateBuffer, true);
|
ArraySetAsSeries(trendStateBuffer, true);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1356,6 +1460,10 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
mInputs.sarMax,
|
mInputs.sarMax,
|
||||||
"", // KI ...
|
"", // KI ...
|
||||||
mInputs.kiLength,
|
mInputs.kiLength,
|
||||||
|
"", // VIDYA ...
|
||||||
|
mInputs.vidyaCMOLength,
|
||||||
|
mInputs.vidyaEMALength,
|
||||||
|
mInputs.vidyaAppliedTo,
|
||||||
"", // Swing Detection ...
|
"", // Swing Detection ...
|
||||||
mInputs.swingLength,
|
mInputs.swingLength,
|
||||||
"", // Support and Resistance ...
|
"", // Support and Resistance ...
|
||||||
@@ -1366,6 +1474,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
mInputs.showSar,
|
mInputs.showSar,
|
||||||
mInputs.showKI,
|
mInputs.showKI,
|
||||||
mInputs.showTKI,
|
mInputs.showTKI,
|
||||||
|
mInputs.showVidya,
|
||||||
mInputs.showTrend,
|
mInputs.showTrend,
|
||||||
mInputs.showSwings,
|
mInputs.showSwings,
|
||||||
mInputs.showFiboLevel1,
|
mInputs.showFiboLevel1,
|
||||||
@@ -1630,6 +1739,110 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetVidya(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(vidyaBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return vidyaBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
int CopyVidya(
|
||||||
|
int start, // Start
|
||||||
|
int count, // Number of Items for read
|
||||||
|
double &buffer[], // Dest Buffer
|
||||||
|
bool forceClean = true // Force To Clean buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Update Calculations ...
|
||||||
|
Calculate(start);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Items ...
|
||||||
|
return Copy(
|
||||||
|
0,
|
||||||
|
count,
|
||||||
|
vidyaBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA STATE ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetVidyaState(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate(barIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(vidyaStateBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return vidyaStateBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
int CopyVidyaState(
|
||||||
|
int start, // Start
|
||||||
|
int count, // Number of Items for read
|
||||||
|
double &buffer[], // Dest Buffer
|
||||||
|
bool forceClean = true // Force To Clean buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Update Calculations ...
|
||||||
|
Calculate(start);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Items ...
|
||||||
|
return Copy(
|
||||||
|
0,
|
||||||
|
count,
|
||||||
|
vidyaStateBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SHORT ...
|
// SHORT ...
|
||||||
|
|
||||||
@@ -2889,6 +3102,20 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
conditions.tkiStateBuffer //
|
conditions.tkiStateBuffer //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
CopyVidya(
|
||||||
|
zIndex,
|
||||||
|
loopback,
|
||||||
|
conditions.vidyaBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
CopyVidyaState(
|
||||||
|
zIndex,
|
||||||
|
loopback,
|
||||||
|
conditions.vidyaStateBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
CopySHH(
|
CopySHH(
|
||||||
zIndex,
|
zIndex,
|
||||||
@@ -3135,9 +3362,50 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
|
|
||||||
//
|
//
|
||||||
bool isTKISwitchedToBullish = isTKIBullish &&
|
bool isTKISwitchedToBullish = isTKIBullish &&
|
||||||
!isTKIBullishPrev;
|
!isTKIBullishPrev;
|
||||||
bool isTKISwitchedToBearish = isTKIBearish &&
|
bool isTKISwitchedToBearish = isTKIBearish &&
|
||||||
!isTKIBearishPrev;
|
!isTKIBearishPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double cVidya = conditions.vidyaBuffer[cIDX];
|
||||||
|
double pVidya = conditions.vidyaBuffer[pIDX];
|
||||||
|
double p2Vidya = conditions.vidyaBuffer[p2IDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
double cVidyaState = conditions.vidyaStateBuffer[cIDX];
|
||||||
|
double pVidyaState = conditions.vidyaStateBuffer[pIDX];
|
||||||
|
double p2VidyaState = conditions.vidyaStateBuffer[p2IDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaRejectUp = cBar.IsRejected(
|
||||||
|
cVidya,
|
||||||
|
X_DIRECTION_BULLISH,
|
||||||
|
false,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
bool isVidyaRejectDown = cBar.IsRejected(
|
||||||
|
cVidya,
|
||||||
|
X_DIRECTION_BEARISH,
|
||||||
|
false,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaBullish = cVidyaState > 0;
|
||||||
|
bool isVidyaBullishPrev = pVidyaState > 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaBearish = cVidyaState < 0;
|
||||||
|
bool isVidyaBearishPrev = pVidyaState < 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaSwitchedToBullish = isVidyaBullish &&
|
||||||
|
!isVidyaBullishPrev;
|
||||||
|
bool isVidyaSwitchedToBearish = isVidyaBearish &&
|
||||||
|
!isVidyaBearishPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
@@ -3356,6 +3624,8 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
conditions.isTKIRejectUp = isTKIRejectUp;
|
conditions.isTKIRejectUp = isTKIRejectUp;
|
||||||
conditions.isPeakIsPivot = isPeakIsPivot;
|
conditions.isPeakIsPivot = isPeakIsPivot;
|
||||||
conditions.isValeIsPivot = isValeIsPivot;
|
conditions.isValeIsPivot = isValeIsPivot;
|
||||||
|
conditions.isVidyaBullish = isVidyaBullish;
|
||||||
|
conditions.isVidyaBearish = isVidyaBearish;
|
||||||
conditions.isKIRejectDown = isKIRejectDown;
|
conditions.isKIRejectDown = isKIRejectDown;
|
||||||
conditions.isPeakSameLast = isPeakSameLast;
|
conditions.isPeakSameLast = isPeakSameLast;
|
||||||
conditions.isPeakOverLast = isPeakOverLast;
|
conditions.isPeakOverLast = isPeakOverLast;
|
||||||
@@ -3398,6 +3668,8 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
conditions.isLastSwingHighRejected = isLastSwingHighRejected;
|
conditions.isLastSwingHighRejected = isLastSwingHighRejected;
|
||||||
conditions.isLastResistanceBreaked = isLastResistanceBreaked;
|
conditions.isLastResistanceBreaked = isLastResistanceBreaked;
|
||||||
conditions.isSupportSameAsSwingLow = isSupportSameAsSwingLow;
|
conditions.isSupportSameAsSwingLow = isSupportSameAsSwingLow;
|
||||||
|
conditions.isVidyaSwitchedToBullish = isVidyaSwitchedToBullish;
|
||||||
|
conditions.isVidyaSwitchedToBearish = isVidyaSwitchedToBearish;
|
||||||
conditions.isLastResistanceRejected = isLastResistanceRejected;
|
conditions.isLastResistanceRejected = isLastResistanceRejected;
|
||||||
conditions.isTrendSwitchedToBullish = isTrendSwitchedToBullish;
|
conditions.isTrendSwitchedToBullish = isTrendSwitchedToBullish;
|
||||||
conditions.isTrendSwitchedToBearish = isTrendSwitchedToBearish;
|
conditions.isTrendSwitchedToBearish = isTrendSwitchedToBearish;
|
||||||
@@ -3440,6 +3712,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
double sarBuffer[];
|
double sarBuffer[];
|
||||||
double peakBuffer[];
|
double peakBuffer[];
|
||||||
double valeBuffer[];
|
double valeBuffer[];
|
||||||
|
double vidyaBuffer[];
|
||||||
double trendBuffer[];
|
double trendBuffer[];
|
||||||
double kiStateBuffer[];
|
double kiStateBuffer[];
|
||||||
double supportBuffer[];
|
double supportBuffer[];
|
||||||
@@ -3452,6 +3725,7 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
double fiboLevel1Buffer[];
|
double fiboLevel1Buffer[];
|
||||||
double fiboLevel2Buffer[];
|
double fiboLevel2Buffer[];
|
||||||
double fiboLevel3Buffer[];
|
double fiboLevel3Buffer[];
|
||||||
|
double vidyaStateBuffer[];
|
||||||
double trendStateBuffer[];
|
double trendStateBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -3485,6 +3759,15 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
tkiBuffer //
|
tkiBuffer //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
X121_XCA_VIDYA_LINE,
|
||||||
|
barIndex,
|
||||||
|
maxRequiredBars,
|
||||||
|
vidyaBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
CopyBuffer(
|
CopyBuffer(
|
||||||
mHandler,
|
mHandler,
|
||||||
@@ -3611,6 +3894,15 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
tkiStateBuffer //
|
tkiStateBuffer //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
X121_XCA_VIDYA_STATE_LINE,
|
||||||
|
barIndex,
|
||||||
|
maxRequiredBars,
|
||||||
|
vidyaStateBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
CopyBuffer(
|
CopyBuffer(
|
||||||
mHandler,
|
mHandler,
|
||||||
@@ -3719,6 +4011,12 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
maxAllowed //
|
maxAllowed //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
CleanupArray(
|
||||||
|
vidyaBuffer,
|
||||||
|
maxAllowed //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
CleanupArray(
|
CleanupArray(
|
||||||
sHHBuffer,
|
sHHBuffer,
|
||||||
@@ -3803,6 +4101,12 @@ class XCX121XCAHelper : public XCBaseHelper
|
|||||||
maxAllowed //
|
maxAllowed //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
CleanupArray(
|
||||||
|
vidyaStateBuffer,
|
||||||
|
maxAllowed //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
CleanupArray(
|
CleanupArray(
|
||||||
supportBuffer,
|
supportBuffer,
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ input double sarMax = 0.2; // Maximum
|
|||||||
input group "KI";
|
input group "KI";
|
||||||
input int kiLength = 26; // KI Length
|
input int kiLength = 26; // KI Length
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
// Variable Index Dynamic Average ...
|
||||||
|
input group "VIDYA";
|
||||||
|
input int vidyaCMOLength = 20; // CMO (Candle Momentum) Length
|
||||||
|
input int vidyaEMALength = 14; // EMA Length
|
||||||
|
input ENUM_APPLIED_PRICE vidyaAppliedTo = PRICE_CLOSE; // Applied To
|
||||||
|
|
||||||
//
|
//
|
||||||
input group "Swing Detection";
|
input group "Swing Detection";
|
||||||
input int swingLength = 5; // Length
|
input int swingLength = 5; // Length
|
||||||
@@ -96,6 +104,7 @@ input int startCalculationForLastBars = 1000; // Calculate Last n Bars
|
|||||||
input bool showSar = true; // Show Sar
|
input bool showSar = true; // Show Sar
|
||||||
input bool showKI = true; // Show KI
|
input bool showKI = true; // Show KI
|
||||||
input bool showTKI = true; // Show KI Trend
|
input bool showTKI = true; // Show KI Trend
|
||||||
|
input bool showVidya = true; // Show Vidya
|
||||||
input bool showTrend = true; // Show Trend
|
input bool showTrend = true; // Show Trend
|
||||||
input bool showSwings = true; // Show Swings
|
input bool showSwings = true; // Show Swings
|
||||||
input bool showFiboLevel1 = true; // Show Fibo Level 1
|
input bool showFiboLevel1 = true; // Show Fibo Level 1
|
||||||
@@ -137,8 +146,8 @@ input int swingHighArrowCode = 226; // Swing High Arrow Code
|
|||||||
#property indicator_chart_window
|
#property indicator_chart_window
|
||||||
|
|
||||||
//
|
//
|
||||||
#property indicator_buffers 31
|
#property indicator_buffers 34
|
||||||
#property indicator_plots 23
|
#property indicator_plots 24
|
||||||
|
|
||||||
//
|
//
|
||||||
// Plot Buffers ...
|
// Plot Buffers ...
|
||||||
@@ -465,10 +474,29 @@ double tkiColorBuffer[];
|
|||||||
#property indicator_style23 STYLE_DASHDOTDOT
|
#property indicator_style23 STYLE_DASHDOTDOT
|
||||||
#property indicator_width23 2
|
#property indicator_width23 2
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
#define vidyaBufferIndex 26
|
||||||
|
#define vidyaBufferPlotIndex 23
|
||||||
|
double vidyaBuffer[];
|
||||||
|
|
||||||
|
//
|
||||||
|
#define vidyaColorBufferIndex 27
|
||||||
|
double vidyaColorBuffer[];
|
||||||
|
|
||||||
|
//
|
||||||
|
#property indicator_label24 "VIDYA"
|
||||||
|
#property indicator_type24 DRAW_COLOR_LINE
|
||||||
|
#property indicator_color24 CLR_NONE, clrAqua, clrMagenta, clrGray
|
||||||
|
#property indicator_style24 STYLE_SOLID
|
||||||
|
#property indicator_width24 1
|
||||||
|
|
||||||
//
|
//
|
||||||
// Data Buffers ...
|
// Data Buffers ...
|
||||||
|
|
||||||
#define mLastBufferIndex 25
|
#define mLastBufferIndex 27
|
||||||
|
|
||||||
//
|
//
|
||||||
#define trendStateBufferIndex mLastBufferIndex + 1
|
#define trendStateBufferIndex mLastBufferIndex + 1
|
||||||
@@ -483,11 +511,15 @@ double kiStateBuffer[];
|
|||||||
double tkiStateBuffer[];
|
double tkiStateBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
#define supBufferIndex mLastBufferIndex + 4
|
#define vidyaStateBufferIndex mLastBufferIndex + 4
|
||||||
|
double vidyaStateBuffer[];
|
||||||
|
|
||||||
|
//
|
||||||
|
#define supBufferIndex mLastBufferIndex + 5
|
||||||
double supBuffer[];
|
double supBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
#define resBufferIndex mLastBufferIndex + 5
|
#define resBufferIndex mLastBufferIndex + 6
|
||||||
double resBuffer[];
|
double resBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -507,6 +539,7 @@ int sarHandler = INVALID_HANDLE;
|
|||||||
//
|
//
|
||||||
// TREND Handler ...
|
// TREND Handler ...
|
||||||
int tkiHandler = INVALID_HANDLE;
|
int tkiHandler = INVALID_HANDLE;
|
||||||
|
int vidyaHandler = INVALID_HANDLE;
|
||||||
int trendHandler = INVALID_HANDLE;
|
int trendHandler = INVALID_HANDLE;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -585,6 +618,22 @@ int OnInit()
|
|||||||
return INIT_FAILED;
|
return INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
vidyaHandler = iVIDyA(
|
||||||
|
_Symbol,
|
||||||
|
_Period,
|
||||||
|
vidyaCMOLength,
|
||||||
|
vidyaEMALength,
|
||||||
|
0,
|
||||||
|
vidyaAppliedTo //
|
||||||
|
);
|
||||||
|
isInited = vidyaHandler != INVALID_HANDLE;
|
||||||
|
if (!isInited)
|
||||||
|
{
|
||||||
|
return INIT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// TREND ...
|
// TREND ...
|
||||||
trendHandler = iMA(
|
trendHandler = iMA(
|
||||||
@@ -642,6 +691,8 @@ void OnDeinit(const int reason)
|
|||||||
|
|
||||||
//
|
//
|
||||||
IndicatorRelease(sarHandler);
|
IndicatorRelease(sarHandler);
|
||||||
|
IndicatorRelease(tkiHandler);
|
||||||
|
IndicatorRelease(vidyaHandler);
|
||||||
IndicatorRelease(trendHandler);
|
IndicatorRelease(trendHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,6 +747,10 @@ int OnCalculate(
|
|||||||
// TKI ...
|
// TKI ...
|
||||||
int tkiCalculatedBars = BarsCalculated(tkiHandler);
|
int tkiCalculatedBars = BarsCalculated(tkiHandler);
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
int vidyaCalculatedBars = BarsCalculated(vidyaHandler);
|
||||||
|
|
||||||
//
|
//
|
||||||
// TREND ...
|
// TREND ...
|
||||||
int trendCalculatedBars = BarsCalculated(trendHandler);
|
int trendCalculatedBars = BarsCalculated(trendHandler);
|
||||||
@@ -709,6 +764,9 @@ int OnCalculate(
|
|||||||
// TKI ...
|
// TKI ...
|
||||||
tkiCalculatedBars >= maxLength &&
|
tkiCalculatedBars >= maxLength &&
|
||||||
//
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
vidyaCalculatedBars >= maxLength &&
|
||||||
|
//
|
||||||
// TREND ...
|
// TREND ...
|
||||||
trendCalculatedBars >= maxLength
|
trendCalculatedBars >= maxLength
|
||||||
//
|
//
|
||||||
@@ -734,6 +792,10 @@ int OnCalculate(
|
|||||||
// TKI ...
|
// TKI ...
|
||||||
int copiedTKIs = CopyBuffer(tkiHandler, 0, 0, limit, tkiBuffer);
|
int copiedTKIs = CopyBuffer(tkiHandler, 0, 0, limit, tkiBuffer);
|
||||||
|
|
||||||
|
//
|
||||||
|
// TKI ...
|
||||||
|
int copiedVidyas = CopyBuffer(vidyaHandler, 0, 0, limit, vidyaBuffer);
|
||||||
|
|
||||||
//
|
//
|
||||||
// TREND ...
|
// TREND ...
|
||||||
int copiedTrends = CopyBuffer(trendHandler, MAIN_LINE, 0, limit + 1, trendBuffer);
|
int copiedTrends = CopyBuffer(trendHandler, MAIN_LINE, 0, limit + 1, trendBuffer);
|
||||||
@@ -748,6 +810,9 @@ int OnCalculate(
|
|||||||
// TKI ...
|
// TKI ...
|
||||||
copiedTKIs >= limit &&
|
copiedTKIs >= limit &&
|
||||||
//
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
copiedVidyas >= limit &&
|
||||||
|
//
|
||||||
// TREND ...
|
// TREND ...
|
||||||
copiedTrends >= limit
|
copiedTrends >= limit
|
||||||
//
|
//
|
||||||
@@ -801,6 +866,8 @@ bool ValidateInputs()
|
|||||||
kiLength > 0 &&
|
kiLength > 0 &&
|
||||||
swingLength > 0 &&
|
swingLength > 0 &&
|
||||||
sarMax > sarStep &&
|
sarMax > sarStep &&
|
||||||
|
vidyaEMALength > 0 &&
|
||||||
|
vidyaCMOLength > 0 &&
|
||||||
//
|
//
|
||||||
// XCA ...
|
// XCA ...
|
||||||
(IsValid(scMethod, scPeriod) &&
|
(IsValid(scMethod, scPeriod) &&
|
||||||
@@ -826,6 +893,8 @@ int ExtractMaxLengthOfInputs()
|
|||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(kiLength, swingLength);
|
result = MathMax(kiLength, swingLength);
|
||||||
|
result = MathMax(result, vidyaCMOLength);
|
||||||
|
result = MathMax(result, vidyaEMALength);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -1211,6 +1280,27 @@ void DefineBuffers()
|
|||||||
ArraySetAsSeries(tkiColorBuffer, true);
|
ArraySetAsSeries(tkiColorBuffer, true);
|
||||||
SetIndexBuffer(tkiColorBufferIndex, tkiColorBuffer, INDICATOR_COLOR_INDEX);
|
SetIndexBuffer(tkiColorBufferIndex, tkiColorBuffer, INDICATOR_COLOR_INDEX);
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
ENUM_DRAW_TYPE vidyaDrawType = showVidya ? DRAW_COLOR_LINE : DRAW_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
ArraySetAsSeries(vidyaBuffer, true);
|
||||||
|
SetIndexBuffer(vidyaBufferIndex, vidyaBuffer, INDICATOR_DATA);
|
||||||
|
|
||||||
|
//
|
||||||
|
PlotIndexSetInteger(vidyaBufferPlotIndex, PLOT_SHOW_DATA, showKI);
|
||||||
|
// PlotIndexSetInteger(vidyaBufferPlotIndex, PLOT_DRAW_TYPE, vidyaDrawType);
|
||||||
|
|
||||||
|
//
|
||||||
|
PlotIndexSetDouble(vidyaBufferPlotIndex, PLOT_EMPTY_VALUE, emptyValue);
|
||||||
|
|
||||||
|
//
|
||||||
|
ArraySetAsSeries(vidyaColorBuffer, true);
|
||||||
|
SetIndexBuffer(vidyaColorBufferIndex, vidyaColorBuffer, INDICATOR_COLOR_INDEX);
|
||||||
|
|
||||||
//
|
//
|
||||||
// SWINGS ...
|
// SWINGS ...
|
||||||
|
|
||||||
@@ -1258,6 +1348,14 @@ void DefineBuffers()
|
|||||||
ArraySetAsSeries(kiStateBuffer, true);
|
ArraySetAsSeries(kiStateBuffer, true);
|
||||||
SetIndexBuffer(kiStateBufferIndex, kiStateBuffer, INDICATOR_CALCULATIONS);
|
SetIndexBuffer(kiStateBufferIndex, kiStateBuffer, INDICATOR_CALCULATIONS);
|
||||||
|
|
||||||
|
//
|
||||||
|
ArraySetAsSeries(tkiStateBuffer, true);
|
||||||
|
SetIndexBuffer(tkiStateBufferIndex, tkiStateBuffer, INDICATOR_CALCULATIONS);
|
||||||
|
|
||||||
|
//
|
||||||
|
ArraySetAsSeries(vidyaStateBuffer, true);
|
||||||
|
SetIndexBuffer(vidyaStateBufferIndex, vidyaStateBuffer, INDICATOR_CALCULATIONS);
|
||||||
|
|
||||||
//
|
//
|
||||||
ArraySetAsSeries(supBuffer, true);
|
ArraySetAsSeries(supBuffer, true);
|
||||||
SetIndexBuffer(supBufferIndex, supBuffer, INDICATOR_CALCULATIONS);
|
SetIndexBuffer(supBufferIndex, supBuffer, INDICATOR_CALCULATIONS);
|
||||||
@@ -1266,10 +1364,6 @@ void DefineBuffers()
|
|||||||
ArraySetAsSeries(resBuffer, true);
|
ArraySetAsSeries(resBuffer, true);
|
||||||
SetIndexBuffer(resBufferIndex, resBuffer, INDICATOR_CALCULATIONS);
|
SetIndexBuffer(resBufferIndex, resBuffer, INDICATOR_CALCULATIONS);
|
||||||
|
|
||||||
//
|
|
||||||
ArraySetAsSeries(tkiStateBuffer, true);
|
|
||||||
SetIndexBuffer(tkiStateBufferIndex, tkiStateBuffer, INDICATOR_CALCULATIONS);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1541,19 +1635,25 @@ void FillBuffersZero(int barIndex)
|
|||||||
// TREND ...
|
// TREND ...
|
||||||
trendBuffer[barIndex] = emptyValue;
|
trendBuffer[barIndex] = emptyValue;
|
||||||
trendColorBuffer[barIndex] = hideColorIDX;
|
trendColorBuffer[barIndex] = hideColorIDX;
|
||||||
trendStateBuffer[barIndex] = hideColorIDX;
|
trendStateBuffer[barIndex] = neuturalState;
|
||||||
|
|
||||||
//
|
//
|
||||||
// KI ...
|
// KI ...
|
||||||
kiBuffer[barIndex] = emptyValue;
|
kiBuffer[barIndex] = emptyValue;
|
||||||
kiColorBuffer[barIndex] = hideColorIDX;
|
kiColorBuffer[barIndex] = hideColorIDX;
|
||||||
kiStateBuffer[barIndex] = hideColorIDX;
|
kiStateBuffer[barIndex] = neuturalState;
|
||||||
|
|
||||||
//
|
//
|
||||||
// TKI ...
|
// TKI ...
|
||||||
tkiBuffer[barIndex] = emptyValue;
|
tkiBuffer[barIndex] = emptyValue;
|
||||||
tkiColorBuffer[barIndex] = hideColorIDX;
|
tkiColorBuffer[barIndex] = hideColorIDX;
|
||||||
tkiStateBuffer[barIndex] = hideColorIDX;
|
tkiStateBuffer[barIndex] = neuturalState;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
vidyaBuffer[barIndex] = emptyValue;
|
||||||
|
vidyaColorBuffer[barIndex] = hideColorIDX;
|
||||||
|
vidyaStateBuffer[barIndex] = neuturalState;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SWINGS ...
|
// SWINGS ...
|
||||||
@@ -2017,6 +2117,36 @@ void CalculateValues(
|
|||||||
tkiStateBuffer[bar_index] = iTKIState;
|
tkiStateBuffer[bar_index] = iTKIState;
|
||||||
tkiColorBuffer[bar_index] = iTKIColor;
|
tkiColorBuffer[bar_index] = iTKIColor;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA Color ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double iVIDYA = vidyaBuffer[bar_index];
|
||||||
|
|
||||||
|
//
|
||||||
|
double iVIDYAState = neuturalState;
|
||||||
|
double iVIDYAColor = neuturalColorIDX;
|
||||||
|
if (iClose > iVIDYA)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iVIDYAState = bullishState;
|
||||||
|
iVIDYAColor =
|
||||||
|
!showVidya
|
||||||
|
? hideColorIDX
|
||||||
|
: bullishColorIDX;
|
||||||
|
}
|
||||||
|
else if (iClose < iVIDYA)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iVIDYAState = bearishState;
|
||||||
|
iVIDYAColor =
|
||||||
|
!showVidya
|
||||||
|
? hideColorIDX
|
||||||
|
: bearishColorIDX;
|
||||||
|
}
|
||||||
|
vidyaStateBuffer[bar_index] = iVIDYAState;
|
||||||
|
vidyaColorBuffer[bar_index] = iVIDYAColor;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup Resources ...
|
// Cleanup Resources ...
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ struct XCAEAConditions
|
|||||||
double sarBuffer[];
|
double sarBuffer[];
|
||||||
double peakBuffer[];
|
double peakBuffer[];
|
||||||
double valeBuffer[];
|
double valeBuffer[];
|
||||||
|
double vidyaBuffer[];
|
||||||
double trendBuffer[];
|
double trendBuffer[];
|
||||||
double kiStateBuffer[];
|
double kiStateBuffer[];
|
||||||
double supportBuffer[];
|
double supportBuffer[];
|
||||||
@@ -199,6 +200,7 @@ struct XCAEAConditions
|
|||||||
double fiboLevel1Buffer[];
|
double fiboLevel1Buffer[];
|
||||||
double fiboLevel2Buffer[];
|
double fiboLevel2Buffer[];
|
||||||
double fiboLevel3Buffer[];
|
double fiboLevel3Buffer[];
|
||||||
|
double vidyaStateBuffer[];
|
||||||
double trendStateBuffer[];
|
double trendStateBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -234,6 +236,21 @@ struct XCAEAConditions
|
|||||||
bool isTKISwitchedToBullish;
|
bool isTKISwitchedToBullish;
|
||||||
bool isTKISwitchedToBearish;
|
bool isTKISwitchedToBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaRejectUp;
|
||||||
|
bool isVidyaRejectDown;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaBullish;
|
||||||
|
bool isVidyaBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isVidyaSwitchedToBullish;
|
||||||
|
bool isVidyaSwitchedToBearish;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
|
|
||||||
@@ -649,6 +666,7 @@ struct XCAEAConditions
|
|||||||
Clean(sarBuffer);
|
Clean(sarBuffer);
|
||||||
Clean(peakBuffer);
|
Clean(peakBuffer);
|
||||||
Clean(valeBuffer);
|
Clean(valeBuffer);
|
||||||
|
Clean(vidyaBuffer);
|
||||||
Clean(trendBuffer);
|
Clean(trendBuffer);
|
||||||
Clean(kiStateBuffer);
|
Clean(kiStateBuffer);
|
||||||
Clean(supportBuffer);
|
Clean(supportBuffer);
|
||||||
@@ -661,6 +679,7 @@ struct XCAEAConditions
|
|||||||
Clean(fiboLevel1Buffer);
|
Clean(fiboLevel1Buffer);
|
||||||
Clean(fiboLevel2Buffer);
|
Clean(fiboLevel2Buffer);
|
||||||
Clean(fiboLevel3Buffer);
|
Clean(fiboLevel3Buffer);
|
||||||
|
Clean(vidyaStateBuffer);
|
||||||
Clean(trendStateBuffer);
|
Clean(trendStateBuffer);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -677,6 +696,7 @@ struct XCAEAConditions
|
|||||||
ArraySetAsSeries(sarBuffer, true);
|
ArraySetAsSeries(sarBuffer, true);
|
||||||
ArraySetAsSeries(peakBuffer, true);
|
ArraySetAsSeries(peakBuffer, true);
|
||||||
ArraySetAsSeries(valeBuffer, true);
|
ArraySetAsSeries(valeBuffer, true);
|
||||||
|
ArraySetAsSeries(vidyaBuffer, true);
|
||||||
ArraySetAsSeries(trendBuffer, true);
|
ArraySetAsSeries(trendBuffer, true);
|
||||||
ArraySetAsSeries(kiStateBuffer, true);
|
ArraySetAsSeries(kiStateBuffer, true);
|
||||||
ArraySetAsSeries(supportBuffer, true);
|
ArraySetAsSeries(supportBuffer, true);
|
||||||
@@ -689,6 +709,7 @@ struct XCAEAConditions
|
|||||||
ArraySetAsSeries(fiboLevel1Buffer, true);
|
ArraySetAsSeries(fiboLevel1Buffer, true);
|
||||||
ArraySetAsSeries(fiboLevel2Buffer, true);
|
ArraySetAsSeries(fiboLevel2Buffer, true);
|
||||||
ArraySetAsSeries(fiboLevel3Buffer, true);
|
ArraySetAsSeries(fiboLevel3Buffer, true);
|
||||||
|
ArraySetAsSeries(vidyaStateBuffer, true);
|
||||||
ArraySetAsSeries(trendStateBuffer, true);
|
ArraySetAsSeries(trendStateBuffer, true);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -724,6 +745,21 @@ struct XCAEAConditions
|
|||||||
isTKISwitchedToBullish = false;
|
isTKISwitchedToBullish = false;
|
||||||
isTKISwitchedToBearish = false;
|
isTKISwitchedToBearish = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
isVidyaRejectUp = false;
|
||||||
|
isVidyaRejectDown = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isVidyaBullish = false;
|
||||||
|
isVidyaBearish = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isVidyaSwitchedToBullish = false;
|
||||||
|
isVidyaSwitchedToBearish = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
|
|
||||||
@@ -1132,6 +1168,37 @@ struct XCAEAConditions
|
|||||||
bearishScore += minScore;
|
bearishScore += minScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// VIDYA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isVidyaBullish)
|
||||||
|
{
|
||||||
|
bullishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaRejectUp)
|
||||||
|
{
|
||||||
|
bullishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaSwitchedToBullish)
|
||||||
|
{
|
||||||
|
bullishScore += minScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isVidyaBearish)
|
||||||
|
{
|
||||||
|
bearishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaRejectDown)
|
||||||
|
{
|
||||||
|
bearishScore += minScore;
|
||||||
|
}
|
||||||
|
if (isVidyaSwitchedToBearish)
|
||||||
|
{
|
||||||
|
bearishScore += minScore;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SAR ...
|
// SAR ...
|
||||||
|
|
||||||
@@ -1825,6 +1892,12 @@ struct XCAEAConditions
|
|||||||
ToString("isTKIBearish", isTKIBearish, ignoreFalseConditions, separator) +
|
ToString("isTKIBearish", isTKIBearish, ignoreFalseConditions, separator) +
|
||||||
ToString("isTKISwitchedToBullish", isTKISwitchedToBullish, ignoreFalseConditions, separator) +
|
ToString("isTKISwitchedToBullish", isTKISwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
ToString("isTKISwitchedToBearish", isTKISwitchedToBearish, ignoreFalseConditions, separator) +
|
ToString("isTKISwitchedToBearish", isTKISwitchedToBearish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaRejectUp", isVidyaRejectUp, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaRejectDown", isVidyaRejectDown, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaBullish", isVidyaBullish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaBearish", isVidyaBearish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaSwitchedToBullish", isVidyaSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isVidyaSwitchedToBearish", isVidyaSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
@@ -2622,6 +2695,12 @@ class XCXCAEAHelper : XCBase
|
|||||||
conditions.tkiBuffer //
|
conditions.tkiBuffer //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
xcaConditions.vidyaBuffer,
|
||||||
|
conditions.vidyaBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
Copy(
|
Copy(
|
||||||
xcaConditions.sHHBuffer,
|
xcaConditions.sHHBuffer,
|
||||||
@@ -2706,6 +2785,12 @@ class XCXCAEAHelper : XCBase
|
|||||||
conditions.tkiStateBuffer //
|
conditions.tkiStateBuffer //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
xcaConditions.vidyaStateBuffer,
|
||||||
|
conditions.vidyaStateBuffer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
Copy(
|
Copy(
|
||||||
xcaConditions.supportBuffer,
|
xcaConditions.supportBuffer,
|
||||||
@@ -2780,6 +2865,8 @@ class XCXCAEAHelper : XCBase
|
|||||||
conditions.isTKIRejectUp = xcaConditions.isTKIRejectUp;
|
conditions.isTKIRejectUp = xcaConditions.isTKIRejectUp;
|
||||||
conditions.isPeakIsPivot = xcaConditions.isPeakIsPivot;
|
conditions.isPeakIsPivot = xcaConditions.isPeakIsPivot;
|
||||||
conditions.isValeIsPivot = xcaConditions.isValeIsPivot;
|
conditions.isValeIsPivot = xcaConditions.isValeIsPivot;
|
||||||
|
conditions.isVidyaBullish = xcaConditions.isVidyaBullish;
|
||||||
|
conditions.isVidyaBearish = xcaConditions.isVidyaBearish;
|
||||||
conditions.isKIRejectDown = xcaConditions.isKIRejectDown;
|
conditions.isKIRejectDown = xcaConditions.isKIRejectDown;
|
||||||
conditions.isPeakSameLast = xcaConditions.isPeakSameLast;
|
conditions.isPeakSameLast = xcaConditions.isPeakSameLast;
|
||||||
conditions.isPeakOverLast = xcaConditions.isPeakOverLast;
|
conditions.isPeakOverLast = xcaConditions.isPeakOverLast;
|
||||||
@@ -2822,6 +2909,8 @@ class XCXCAEAHelper : XCBase
|
|||||||
conditions.isLastSwingHighRejected = xcaConditions.isLastSwingHighRejected;
|
conditions.isLastSwingHighRejected = xcaConditions.isLastSwingHighRejected;
|
||||||
conditions.isLastResistanceBreaked = xcaConditions.isLastResistanceBreaked;
|
conditions.isLastResistanceBreaked = xcaConditions.isLastResistanceBreaked;
|
||||||
conditions.isSupportSameAsSwingLow = xcaConditions.isSupportSameAsSwingLow;
|
conditions.isSupportSameAsSwingLow = xcaConditions.isSupportSameAsSwingLow;
|
||||||
|
conditions.isVidyaSwitchedToBullish = xcaConditions.isVidyaSwitchedToBullish;
|
||||||
|
conditions.isVidyaSwitchedToBearish = xcaConditions.isVidyaSwitchedToBearish;
|
||||||
conditions.isLastResistanceRejected = xcaConditions.isLastResistanceRejected;
|
conditions.isLastResistanceRejected = xcaConditions.isLastResistanceRejected;
|
||||||
conditions.isTrendSwitchedToBullish = xcaConditions.isTrendSwitchedToBullish;
|
conditions.isTrendSwitchedToBullish = xcaConditions.isTrendSwitchedToBullish;
|
||||||
conditions.isTrendSwitchedToBearish = xcaConditions.isTrendSwitchedToBearish;
|
conditions.isTrendSwitchedToBearish = xcaConditions.isTrendSwitchedToBearish;
|
||||||
|
|||||||
Reference in New Issue
Block a user