fix xca indicator to calculate all bars if necessary ...
This commit is contained in:
@@ -529,6 +529,9 @@ double resBuffer[];
|
|||||||
// this counts Available Bars ...
|
// this counts Available Bars ...
|
||||||
int limit;
|
int limit;
|
||||||
|
|
||||||
|
//
|
||||||
|
int firstBarIndex;
|
||||||
|
|
||||||
//
|
//
|
||||||
int maxLength;
|
int maxLength;
|
||||||
|
|
||||||
@@ -1404,10 +1407,16 @@ void CalculateBuffers(
|
|||||||
int barsLimit = startCalculationForLastBars > 0
|
int barsLimit = startCalculationForLastBars > 0
|
||||||
? startCalculationForLastBars
|
? startCalculationForLastBars
|
||||||
: 0;
|
: 0;
|
||||||
|
if (barsLimit == 0)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
barsLimit = ratesTotal;
|
||||||
|
firstBarIndex = barsLimit - 1;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// bool canCalculate = true;
|
// bool canCalculate = true;
|
||||||
bool canCalculate =
|
bool canCalculate =
|
||||||
barsLimit == 0 ||
|
|
||||||
bar_index <= barsLimit;
|
bar_index <= barsLimit;
|
||||||
if (canCalculate)
|
if (canCalculate)
|
||||||
{
|
{
|
||||||
@@ -1778,7 +1787,7 @@ void CalculateValues(
|
|||||||
bool isFirstBar =
|
bool isFirstBar =
|
||||||
startCalculationForLastBars > 0
|
startCalculationForLastBars > 0
|
||||||
? bar_index == startCalculationForLastBars
|
? bar_index == startCalculationForLastBars
|
||||||
: bar_index == ratesTotal;
|
: bar_index == firstBarIndex;
|
||||||
|
|
||||||
XOHCL iBar;
|
XOHCL iBar;
|
||||||
bool isInited = iBar.Init(
|
bool isInited = iBar.Init(
|
||||||
@@ -2167,6 +2176,13 @@ bool IsSwingLow(
|
|||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = index + 1 + length <= firstBarIndex;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
for (int i = index + 1; i <= index + length; i++)
|
for (int i = index + 1; i <= index + length; i++)
|
||||||
{
|
{
|
||||||
@@ -2193,6 +2209,13 @@ bool IsSwingHigh(
|
|||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = index + 1 + length <= firstBarIndex;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
for (int i = index + 1; i <= index + length; i++)
|
for (int i = index + 1; i <= index + length; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1074,20 +1074,22 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
bool isCond2Bullish =
|
bool isCond2Bullish =
|
||||||
//
|
//
|
||||||
false &&
|
// false &&
|
||||||
//
|
//
|
||||||
isVolumeOverAvg &&
|
conditions.isRSIOS
|
||||||
isVolumeBullish &&
|
//
|
||||||
isVolumeOverLast &&
|
// isVolumeOverAvg &&
|
||||||
c3MASlowState > 0 &&
|
// isVolumeBullish &&
|
||||||
c3MAMediumState > 0 &&
|
// isVolumeOverLast &&
|
||||||
cBar.GetUp() > pSar &&
|
// c3MASlowState > 0 &&
|
||||||
conditions.isFastOverSlow &&
|
// c3MAMediumState > 0 &&
|
||||||
conditions.isVidyaBullish &&
|
// cBar.GetUp() > pSar &&
|
||||||
conditions.isFastOverMedium &&
|
// conditions.isFastOverSlow &&
|
||||||
isTrendRangeFinishedFromValid &&
|
// conditions.isVidyaBullish &&
|
||||||
conditions.isSwingHighOverLast &&
|
// conditions.isFastOverMedium &&
|
||||||
conditions.isSarSwitchedToBullish
|
// isTrendRangeFinishedFromValid &&
|
||||||
|
// conditions.isSwingHighOverLast &&
|
||||||
|
// conditions.isSarSwitchedToBullish
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// isX3MaBearishState &&
|
// isX3MaBearishState &&
|
||||||
@@ -1114,7 +1116,9 @@ bool DetectXCAEAConditions(
|
|||||||
if (isCond2)
|
if (isCond2)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Print("Cond2");
|
Print("Cond2");
|
||||||
|
isCond2Bullish = false;
|
||||||
|
isCond2Bearish = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -212,12 +212,12 @@ class XCXCAEASignaller : XCBase
|
|||||||
// drawer.Draw(cTime);
|
// drawer.Draw(cTime);
|
||||||
|
|
||||||
//
|
//
|
||||||
// drawer.DrawPeakResSWHPivots(cTime);
|
drawer.DrawPeakResSWHPivots(cTime);
|
||||||
// drawer.DrawValeSupSWLPivots(cTime);
|
drawer.DrawValeSupSWLPivots(cTime);
|
||||||
// drawer.DrawFVGBullishPivots(cTime);
|
// drawer.DrawFVGBullishPivots(cTime);
|
||||||
// drawer.DrawFVGBearishPivots(cTime);
|
// drawer.DrawFVGBearishPivots(cTime);
|
||||||
// drawer.DrawRSICrossedOverOSPivots(cTime);
|
drawer.DrawRSICrossedOverOSPivots(cTime);
|
||||||
// drawer.DrawRSICrossedUnderOBPivots(cTime);
|
drawer.DrawRSICrossedUnderOBPivots(cTime);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retrieve Valid Pviots ...
|
// Retrieve Valid Pviots ...
|
||||||
@@ -849,7 +849,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Oscillators Views ...
|
// Oscillators Views ...
|
||||||
inputs.showRSI = false;
|
inputs.showRSI = true;
|
||||||
inputs.showCCI = false;
|
inputs.showCCI = false;
|
||||||
inputs.showMFI = false;
|
inputs.showMFI = false;
|
||||||
inputs.showRVI = false;
|
inputs.showRVI = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user