complete all indicator/oscillator(s) helper classes ...
This commit is contained in:
@@ -39,7 +39,9 @@ struct XXFIInputs
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
string tmp;
|
||||
int length; // Length
|
||||
ENUM_MA_METHOD method; // MA Method
|
||||
ENUM_APPLIED_VOLUME appliedTo; // Applied To
|
||||
|
||||
//
|
||||
// Constructor(s) ...
|
||||
@@ -57,6 +59,9 @@ struct XXFIInputs
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
length = 0;
|
||||
method = MODE_SMA;
|
||||
appliedTo = VOLUME_TICK;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -64,6 +69,9 @@ struct XXFIInputs
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
length = 18;
|
||||
method = MODE_SMA;
|
||||
appliedTo = VOLUME_TICK;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -76,7 +84,7 @@ struct XXFIInputs
|
||||
//
|
||||
result =
|
||||
//
|
||||
false
|
||||
length >= 2
|
||||
//
|
||||
;
|
||||
|
||||
@@ -92,7 +100,7 @@ struct XXFIInputs
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
result = MathMax(0, 0);
|
||||
result = MathMax(result, length);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -124,7 +132,7 @@ public:
|
||||
bool Init(
|
||||
string symbol, // Trading Symbol
|
||||
ENUM_TIMEFRAMES period, // Trading Period
|
||||
XXFIInputs &inputs // Inputs
|
||||
XXFIInputs &inputs // Inputs
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -144,21 +152,24 @@ public:
|
||||
//
|
||||
mInputs = inputs;
|
||||
|
||||
// //
|
||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
||||
// mHandler = iCustom(
|
||||
// mSymbol,
|
||||
// mPeriod,
|
||||
// "x-saherelm.x",
|
||||
// //
|
||||
// // Inputs ...
|
||||
// //
|
||||
// );
|
||||
// result = mHandler != INVALID_HANDLE;
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
ArraySetAsSeries(mainBuffer, true);
|
||||
mHandler = iCustom(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
"x-saherelm.xfi",
|
||||
//
|
||||
// Inputs ...
|
||||
mInputs.length, // Length
|
||||
mInputs.method, // MA Method
|
||||
mInputs.appliedTo // Applied To
|
||||
//
|
||||
);
|
||||
result = mHandler != INVALID_HANDLE;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -190,55 +201,55 @@ public:
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
// //
|
||||
// double GetMain(
|
||||
// int barIndex // Bar Index
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// if (barIndex < 0)
|
||||
// {
|
||||
// barIndex = 0;
|
||||
// }
|
||||
//
|
||||
double GetMain(
|
||||
int barIndex // Bar Index
|
||||
)
|
||||
{
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
// //
|
||||
// Calculate();
|
||||
//
|
||||
Calculate();
|
||||
|
||||
// //
|
||||
// int count = ArraySize(mainBuffer);
|
||||
// if (barIndex >= count)
|
||||
// {
|
||||
// barIndex = count - 1;
|
||||
// }
|
||||
//
|
||||
int count = ArraySize(mainBuffer);
|
||||
if (barIndex >= count)
|
||||
{
|
||||
barIndex = count - 1;
|
||||
}
|
||||
|
||||
// //
|
||||
// return mainBuffer[barIndex];
|
||||
// }
|
||||
//
|
||||
return mainBuffer[barIndex];
|
||||
}
|
||||
|
||||
// //
|
||||
// // Copy Required Long Exits 2 ...
|
||||
// int CopyLongExit2(
|
||||
// int start, // Start
|
||||
// int count, // Number of Items for read
|
||||
// double &buffer[], // Dest Buffer
|
||||
// bool forceClean = true // Force To Clean buffer
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// // Update Calculations ...
|
||||
// Calculate();
|
||||
//
|
||||
// Copy Required Items ...
|
||||
int CopyMain(
|
||||
int start, // Start
|
||||
int count, // Number of Items for read
|
||||
double &buffer[], // Dest Buffer
|
||||
bool forceClean = true // Force To Clean buffer
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
// //
|
||||
// // Copy Items ...
|
||||
// return Copy(
|
||||
// start,
|
||||
// count,
|
||||
// longExit2Buffer,
|
||||
// buffer,
|
||||
// forceClean
|
||||
// //
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
start,
|
||||
count,
|
||||
mainBuffer,
|
||||
buffer,
|
||||
forceClean
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
@@ -252,7 +263,7 @@ private:
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
// double longExit1Buffer[];
|
||||
double mainBuffer[];
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
Reference in New Issue
Block a user