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