last ...
This commit is contained in:
@@ -192,8 +192,7 @@ public:
|
||||
// Register Required Buffers ...
|
||||
XBuffer main;
|
||||
result = main.Init(
|
||||
"XSCMid",
|
||||
false //
|
||||
"XSCMid" //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
@@ -276,6 +275,7 @@ public:
|
||||
{
|
||||
//
|
||||
int max = mInputs.Max();
|
||||
int limit = CountLimit();
|
||||
int totalBars = CountBars();
|
||||
int prevCalculated = GetCalculatedBars();
|
||||
|
||||
@@ -302,14 +302,6 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// start = prevCalculated - 1;
|
||||
// }
|
||||
|
||||
//
|
||||
// Loop through Bars ...
|
||||
@@ -327,7 +319,7 @@ public:
|
||||
double iValue = iBar.close;
|
||||
|
||||
//
|
||||
Print("BarIndex: " + ToString(i), ", iValue: ", iValue);
|
||||
// Print("BarIndex: " + ToString(i), ", iValue: ", iValue);
|
||||
|
||||
//
|
||||
if (i > ArraySize(mBuffers[mainIDX].values) - 1)
|
||||
|
||||
@@ -2971,46 +2971,6 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Longs Use Common Conditions ...
|
||||
|
||||
//
|
||||
// if (hasLong)
|
||||
// {
|
||||
// //
|
||||
// int pusher = 0;
|
||||
// result = HasBaseLongConditions(
|
||||
// mConditions,
|
||||
// pusher //
|
||||
// );
|
||||
|
||||
// //
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// if (hasShort)
|
||||
// {
|
||||
// //
|
||||
// int pusher = 0;
|
||||
// result = HasBaseShortConditions(
|
||||
// mConditions,
|
||||
// pusher //
|
||||
// );
|
||||
|
||||
// //
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Prepare Signal ...
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
@@ -3183,10 +3143,13 @@ public:
|
||||
if (isPrepared)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
sSignal,
|
||||
mSignal.supports //
|
||||
);
|
||||
mSignal = sSignal;
|
||||
|
||||
// //
|
||||
// AddRef(
|
||||
// sSignal,
|
||||
// mSignal.supports //
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ struct XBuffer
|
||||
//
|
||||
string title; // Buffer Title
|
||||
double values[]; // Buffer Values
|
||||
bool asSeries; // As Series Flag
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
@@ -46,8 +45,7 @@ struct XBuffer
|
||||
//
|
||||
// Tools ...
|
||||
bool Init(
|
||||
string mTitle, // Title
|
||||
bool mAsSeries = true // As Series Flag
|
||||
string mTitle // Title
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -76,10 +74,6 @@ struct XBuffer
|
||||
//
|
||||
result = IsValid();
|
||||
|
||||
//
|
||||
asSeries = mAsSeries;
|
||||
ArraySetAsSeries(values, mAsSeries);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -163,9 +157,6 @@ struct XBuffer
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
ArraySetAsSeries(values, true);
|
||||
|
||||
//
|
||||
int count = Count();
|
||||
ArrayResize(
|
||||
@@ -179,9 +170,6 @@ struct XBuffer
|
||||
//
|
||||
result = Count();
|
||||
|
||||
//
|
||||
ArraySetAsSeries(values, asSeries);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -189,8 +177,7 @@ struct XBuffer
|
||||
//
|
||||
// Get Specified Index Value ...
|
||||
double Get(
|
||||
int index, // Specified Index
|
||||
bool reverse = false // Retrieve Reversal Index Value
|
||||
int index // Specified Index
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -202,21 +189,9 @@ struct XBuffer
|
||||
values //
|
||||
);
|
||||
|
||||
//
|
||||
if (reverse)
|
||||
{
|
||||
ArraySetAsSeries(values, !asSeries);
|
||||
}
|
||||
|
||||
//
|
||||
result = values[index];
|
||||
|
||||
//
|
||||
if (reverse)
|
||||
{
|
||||
ArraySetAsSeries(values, asSeries);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -409,7 +384,7 @@ public:
|
||||
//
|
||||
// Calculate Limit ...
|
||||
// this means Required Bars for Calculation ...
|
||||
int CalculateLimit()
|
||||
int CountLimit()
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
@@ -588,12 +563,21 @@ public:
|
||||
Calculate();
|
||||
|
||||
//
|
||||
for (int i = start; i < start + count - 1; i++)
|
||||
{
|
||||
result = ArrayCopy(
|
||||
buffer,
|
||||
mBuffers[bufferIDX].values,
|
||||
start,
|
||||
start,
|
||||
count //
|
||||
);
|
||||
|
||||
//
|
||||
result++;
|
||||
buffer[i] = mBuffers[bufferIDX].values[i];
|
||||
}
|
||||
// for (int i = start; i < start + count - 1; i++)
|
||||
// {
|
||||
// //
|
||||
// result++;
|
||||
// buffer[i] = mBuffers[bufferIDX].values[i];
|
||||
// }
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
@@ -108,7 +108,7 @@ int OnCalculate(
|
||||
//
|
||||
// Check Calculated Bars ...
|
||||
int midCalculatedBars = mMid.GetCalculatedBars();
|
||||
if (!IsValidSize(midCalculatedBars))
|
||||
if (prev_calculated > 0 && midCalculatedBars != prev_calculated)
|
||||
{
|
||||
return prev_calculated;
|
||||
}
|
||||
@@ -121,17 +121,19 @@ int OnCalculate(
|
||||
|
||||
//
|
||||
Print("Limit: ", limit);
|
||||
mMid.Calculate();
|
||||
// mMid.Calculate();
|
||||
|
||||
//
|
||||
// int midMainBufferCopied = mMid.CopyBuffer(
|
||||
// "XSCMid",
|
||||
// mainBuffer
|
||||
// );
|
||||
// if (!IsValidSize(midMainBufferCopied))
|
||||
// {
|
||||
// return prev_calculated;
|
||||
// }
|
||||
int midMainBufferCopied = mMid.CopyBuffer(
|
||||
"XSCMid",
|
||||
mainBuffer,
|
||||
0,
|
||||
limit //
|
||||
);
|
||||
if (!IsValidSize(midMainBufferCopied))
|
||||
{
|
||||
return prev_calculated;
|
||||
}
|
||||
|
||||
//
|
||||
// ChartRedraw();
|
||||
|
||||
Reference in New Issue
Block a user