complete all indicator/oscillator(s) helper classes ...
This commit is contained in:
@@ -486,55 +486,364 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
// Short ...
|
||||||
// int barIndex // Bar Index
|
|
||||||
// )
|
|
||||||
// {
|
|
||||||
// //
|
|
||||||
// if (barIndex < 0)
|
|
||||||
// {
|
|
||||||
// barIndex = 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
double GetSCHH(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
Calculate();
|
||||||
// if (barIndex >= count)
|
|
||||||
// {
|
|
||||||
// barIndex = count - 1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
int count = ArraySize(scHHBuffer);
|
||||||
// }
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
return scHHBuffer[barIndex];
|
||||||
// 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 Items ...
|
// Copy Required Items ...
|
||||||
// return Copy(
|
int CopySCHH(
|
||||||
// start,
|
int start, // Start
|
||||||
// count,
|
int count, // Number of Items for read
|
||||||
// longExit2Buffer,
|
double &buffer[], // Dest Buffer
|
||||||
// buffer,
|
bool forceClean = true // Force To Clean buffer
|
||||||
// forceClean
|
)
|
||||||
// //
|
{
|
||||||
// );
|
//
|
||||||
// }
|
// Update Calculations ...
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Items ...
|
||||||
|
return Copy(
|
||||||
|
start,
|
||||||
|
count,
|
||||||
|
scHHBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetSCLL(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(scLLBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return scLLBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopySCLL(
|
||||||
|
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,
|
||||||
|
scLLBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Medium ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetMCHH(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(mcHHBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return mcHHBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyMCHH(
|
||||||
|
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,
|
||||||
|
mcHHBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetMCLL(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(mcLLBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return mcLLBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyMCLL(
|
||||||
|
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,
|
||||||
|
mcLLBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLCHH(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(lcHHBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return lcHHBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyLCHH(
|
||||||
|
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,
|
||||||
|
lcHHBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLCLL(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(lcLLBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return lcLLBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyLCLL(
|
||||||
|
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,
|
||||||
|
lcLLBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetHotState(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(hotStateBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return hotStateBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyHotState(
|
||||||
|
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,
|
||||||
|
hotStateBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
|
|||||||
@@ -30,7 +30,20 @@
|
|||||||
//
|
//
|
||||||
enum ENUM_XCHMA_BUFFERS
|
enum ENUM_XCHMA_BUFFERS
|
||||||
{
|
{
|
||||||
XCHMA_MAIN_LINE = 0
|
//
|
||||||
|
// LC ...
|
||||||
|
XCHMA_LC_FAST_LINE = 0,
|
||||||
|
XCHMA_LC_SLOW_LINE = 1,
|
||||||
|
//
|
||||||
|
// MC ...
|
||||||
|
XCHMA_MC_FAST_LINE = 2,
|
||||||
|
XCHMA_MC_SLOW_LINE = 3,
|
||||||
|
//
|
||||||
|
// SC ...
|
||||||
|
XCHMA_SC_FAST_LINE = 4,
|
||||||
|
XCHMA_SC_SLOW_LINE = 5,
|
||||||
|
//
|
||||||
|
XCHMA_HOT_STATE_LINE = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -39,7 +52,67 @@ struct XXCHMAInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
//
|
||||||
|
// Hot Areas ...
|
||||||
|
bool drawHotAreas; // Draw Hot Areas Symbol
|
||||||
|
uchar hotBullishArrowCode; // Hot Bullish Arrow Code
|
||||||
|
color hotBullishArrowColor; // Hot Bullish Arrow Color
|
||||||
|
uchar hotBearishArrowCode; // Hot Bearish Arrow Code
|
||||||
|
color hotBearishArrowColor; // Hot Bearish Arrow Color
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Cycle ...
|
||||||
|
// LC Market ...
|
||||||
|
int lcFastLength; // Fast Length
|
||||||
|
int lcSlowLength; // Slow Length
|
||||||
|
ENUM_MA_METHOD lcMethod; // Calculation Method
|
||||||
|
ENUM_APPLIED_PRICE lcAppliedTo; // Applied To
|
||||||
|
// LC Style ...
|
||||||
|
int lcDrawWidth; // Draw Width
|
||||||
|
ENUM_DRAW_TYPE lcDrawType; // Draw Type
|
||||||
|
ENUM_LINE_STYLE lcDrawStyle; // Draw Style
|
||||||
|
color lcFastColor; // Fast Color
|
||||||
|
color lcSlowColor; // Slow Color
|
||||||
|
// LC Drawings ...
|
||||||
|
bool lcDrawFast; // Draw Fast
|
||||||
|
bool lcDrawSlow; // Draw Slow
|
||||||
|
bool lcDrawCrosses; // Draw Cross Lines
|
||||||
|
|
||||||
|
//
|
||||||
|
// Medium Cycle ...
|
||||||
|
// MC Market ...
|
||||||
|
int mcFastLength; // Fast Length
|
||||||
|
int mcSlowLength; // Slow Length
|
||||||
|
ENUM_MA_METHOD mcMethod; // Calculation Method
|
||||||
|
ENUM_APPLIED_PRICE mcAppliedTo; // Applied To
|
||||||
|
// MC Style ...
|
||||||
|
int mcDrawWidth; // Draw Width
|
||||||
|
ENUM_DRAW_TYPE mcDrawType; // Draw Type
|
||||||
|
ENUM_LINE_STYLE mcDrawStyle; // Draw Style
|
||||||
|
color mcFastColor; // Fast Color
|
||||||
|
color mcSlowColor; // Slow Color
|
||||||
|
// MC Drawings ...
|
||||||
|
bool mcDrawFast; // Draw Fast
|
||||||
|
bool mcDrawSlow; // Draw Slow
|
||||||
|
bool mcDrawCrosses; // Draw Cross Lines
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Cycle ...
|
||||||
|
// SC Market ...
|
||||||
|
int scFastLength; // Fast Length
|
||||||
|
int scSlowLength; // Slow Length
|
||||||
|
ENUM_MA_METHOD scMethod; // Calculation Method
|
||||||
|
ENUM_APPLIED_PRICE scAppliedTo; // Applied To
|
||||||
|
// SC Style ...
|
||||||
|
int scDrawWidth; // Draw Width
|
||||||
|
ENUM_DRAW_TYPE scDrawType; // Draw Type
|
||||||
|
ENUM_LINE_STYLE scDrawStyle; // Draw Style
|
||||||
|
color scFastColor; // Fast Color
|
||||||
|
color scSlowColor; // Slow Color
|
||||||
|
// SC Drawings ...
|
||||||
|
bool scDrawFast; // Draw Fast
|
||||||
|
bool scDrawSlow; // Draw Slow
|
||||||
|
bool scDrawCrosses; // Draw Cross Lines
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +130,66 @@ struct XXCHMAInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Hot Areas ...
|
||||||
|
drawHotAreas = false;
|
||||||
|
hotBullishArrowCode = 228;
|
||||||
|
hotBullishArrowColor = CLR_NONE;
|
||||||
|
hotBearishArrowCode = 230;
|
||||||
|
hotBearishArrowColor = CLR_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Cycle ...
|
||||||
|
// LC Market ...
|
||||||
|
lcFastLength = 20;
|
||||||
|
lcSlowLength = 50;
|
||||||
|
lcMethod = MODE_EMA;
|
||||||
|
lcAppliedTo = PRICE_CLOSE;
|
||||||
|
// LC Style ...
|
||||||
|
lcDrawWidth = 1;
|
||||||
|
lcDrawType = DRAW_NONE;
|
||||||
|
lcDrawStyle = STYLE_DOT;
|
||||||
|
lcFastColor = CLR_NONE;
|
||||||
|
lcSlowColor = CLR_NONE;
|
||||||
|
// LC Drawings ...
|
||||||
|
lcDrawFast = false;
|
||||||
|
lcDrawSlow = false;
|
||||||
|
lcDrawCrosses = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Medium Cycle ...
|
||||||
|
// MC Market ...
|
||||||
|
mcFastLength = 10;
|
||||||
|
mcSlowLength = 30;
|
||||||
|
mcMethod = MODE_EMA;
|
||||||
|
mcAppliedTo = PRICE_CLOSE;
|
||||||
|
// MC Style ...
|
||||||
|
mcDrawWidth = 1;
|
||||||
|
mcDrawType = DRAW_NONE;
|
||||||
|
mcDrawStyle = STYLE_DOT;
|
||||||
|
mcFastColor = CLR_NONE;
|
||||||
|
mcSlowColor = CLR_NONE;
|
||||||
|
// MC Drawings ...
|
||||||
|
mcDrawFast = false;
|
||||||
|
mcDrawSlow = false;
|
||||||
|
mcDrawCrosses = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Cycle ...
|
||||||
|
// SC Market ...
|
||||||
|
scFastLength = 7;
|
||||||
|
scSlowLength = 14;
|
||||||
|
scMethod = MODE_EMA;
|
||||||
|
scAppliedTo = PRICE_CLOSE;
|
||||||
|
// SC Style ...
|
||||||
|
scDrawWidth = 1;
|
||||||
|
scDrawType = DRAW_NONE;
|
||||||
|
scDrawStyle = STYLE_SOLID;
|
||||||
|
scFastColor = CLR_NONE;
|
||||||
|
scSlowColor = CLR_NONE;
|
||||||
|
// SC Drawings ...
|
||||||
|
scDrawFast = false;
|
||||||
|
scDrawSlow = false;
|
||||||
|
scDrawCrosses = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +197,66 @@ struct XXCHMAInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Hot Areas ...
|
||||||
|
drawHotAreas = false;
|
||||||
|
hotBullishArrowCode = 228;
|
||||||
|
hotBullishArrowColor = CLR_NONE;
|
||||||
|
hotBearishArrowCode = 230;
|
||||||
|
hotBearishArrowColor = CLR_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Cycle ...
|
||||||
|
// LC Market ...
|
||||||
|
lcFastLength = 20;
|
||||||
|
lcSlowLength = 50;
|
||||||
|
lcMethod = MODE_EMA;
|
||||||
|
lcAppliedTo = PRICE_CLOSE;
|
||||||
|
// LC Style ...
|
||||||
|
lcDrawWidth = 1;
|
||||||
|
lcDrawType = DRAW_LINE;
|
||||||
|
lcDrawStyle = STYLE_DOT;
|
||||||
|
lcFastColor = clrAqua;
|
||||||
|
lcSlowColor = clrFuchsia;
|
||||||
|
// LC Drawings ...
|
||||||
|
lcDrawFast = true;
|
||||||
|
lcDrawSlow = true;
|
||||||
|
lcDrawCrosses = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Medium Cycle ...
|
||||||
|
// MC Market ...
|
||||||
|
mcFastLength = 10;
|
||||||
|
mcSlowLength = 30;
|
||||||
|
mcMethod = MODE_EMA;
|
||||||
|
mcAppliedTo = PRICE_CLOSE;
|
||||||
|
// MC Style ...
|
||||||
|
mcDrawWidth = 1;
|
||||||
|
mcDrawType = DRAW_LINE;
|
||||||
|
mcDrawStyle = STYLE_DOT;
|
||||||
|
mcFastColor = clrLime;
|
||||||
|
mcSlowColor = clrRed;
|
||||||
|
// MC Drawings ...
|
||||||
|
mcDrawFast = true;
|
||||||
|
mcDrawSlow = true;
|
||||||
|
mcDrawCrosses = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Cycle ...
|
||||||
|
// SC Market ...
|
||||||
|
scFastLength = 7;
|
||||||
|
scSlowLength = 14;
|
||||||
|
scMethod = MODE_EMA;
|
||||||
|
scAppliedTo = PRICE_CLOSE;
|
||||||
|
// SC Style ...
|
||||||
|
scDrawWidth = 1;
|
||||||
|
scDrawType = DRAW_LINE;
|
||||||
|
scDrawStyle = STYLE_SOLID;
|
||||||
|
scFastColor = clrLightBlue;
|
||||||
|
scSlowColor = clrLightSalmon;
|
||||||
|
// SC Drawings ...
|
||||||
|
scDrawFast = true;
|
||||||
|
scDrawSlow = true;
|
||||||
|
scDrawCrosses = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +269,11 @@ struct XXCHMAInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
(lcFastLength >= 4 && lcSlowLength > lcFastLength) &&
|
||||||
|
(mcFastLength >= 4 && mcSlowLength > mcFastLength) &&
|
||||||
|
(scFastLength >= 4 && scSlowLength > scFastLength) &&
|
||||||
|
(lcFastLength > mcFastLength &&
|
||||||
|
mcFastLength > scFastLength)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +289,11 @@ struct XXCHMAInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(scFastLength, scSlowLength);
|
||||||
|
result = MathMax(result, lcFastLength);
|
||||||
|
result = MathMax(result, lcSlowLength);
|
||||||
|
result = MathMax(result, mcFastLength);
|
||||||
|
result = MathMax(result, mcSlowLength);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +325,7 @@ public:
|
|||||||
bool Init(
|
bool Init(
|
||||||
string symbol, // Trading Symbol
|
string symbol, // Trading Symbol
|
||||||
ENUM_TIMEFRAMES period, // Trading Period
|
ENUM_TIMEFRAMES period, // Trading Period
|
||||||
XXCHMAInputs &inputs // Inputs
|
XXCHMAInputs &inputs // Inputs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -144,21 +345,109 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(scFastBuffer, true);
|
||||||
// mHandler = iCustom(
|
ArraySetAsSeries(scSlowBuffer, true);
|
||||||
// mSymbol,
|
ArraySetAsSeries(mcFastBuffer, true);
|
||||||
// mPeriod,
|
ArraySetAsSeries(mcSlowBuffer, true);
|
||||||
// "x-saherelm.x",
|
ArraySetAsSeries(lcFastBuffer, true);
|
||||||
// //
|
ArraySetAsSeries(lcSlowBuffer, true);
|
||||||
// // Inputs ...
|
ArraySetAsSeries(hotStateBuffer, true);
|
||||||
// //
|
|
||||||
// );
|
//
|
||||||
// result = mHandler != INVALID_HANDLE;
|
mHandler = iCustom(
|
||||||
// if (!result)
|
mSymbol,
|
||||||
// {
|
mPeriod,
|
||||||
// return result;
|
"x-saherelm.xchma",
|
||||||
// }
|
//
|
||||||
|
// Inputs ...
|
||||||
|
//
|
||||||
|
// Hot Areas ...
|
||||||
|
"",
|
||||||
|
mInputs.drawHotAreas, // Draw Hot Areas Symbol
|
||||||
|
mInputs.hotBullishArrowCode, // Hot Bullish Arrow Code
|
||||||
|
mInputs.hotBullishArrowColor, // Hot Bullish Arrow Color
|
||||||
|
mInputs.hotBearishArrowCode, // Hot Bearish Arrow Code
|
||||||
|
mInputs.hotBearishArrowColor, // Hot Bearish Arrow Color
|
||||||
|
//
|
||||||
|
// Long Cycle ...
|
||||||
|
"",
|
||||||
|
//
|
||||||
|
// LC Market ...
|
||||||
|
"",
|
||||||
|
mInputs.lcFastLength, // Fast Length
|
||||||
|
mInputs.lcSlowLength, // Slow Length
|
||||||
|
mInputs.lcMethod, // Calculation Method
|
||||||
|
mInputs.lcAppliedTo, // Applied To
|
||||||
|
//
|
||||||
|
// LC Style ...
|
||||||
|
"",
|
||||||
|
mInputs.lcDrawWidth, // Draw Width
|
||||||
|
mInputs.lcDrawType, // Draw Type
|
||||||
|
mInputs.lcDrawStyle, // Draw Style
|
||||||
|
mInputs.lcFastColor, // Fast Color
|
||||||
|
mInputs.lcSlowColor, // Slow Color
|
||||||
|
//
|
||||||
|
// LC Drawings ...
|
||||||
|
"",
|
||||||
|
mInputs.lcDrawFast, // Draw Fast
|
||||||
|
mInputs.lcDrawSlow, // Draw Slow
|
||||||
|
mInputs.lcDrawCrosses, // Draw Cross Lines
|
||||||
|
//
|
||||||
|
// Medium Cycle ...
|
||||||
|
"",
|
||||||
|
//
|
||||||
|
// MC Market ...
|
||||||
|
"",
|
||||||
|
mInputs.mcFastLength, // Fast Length
|
||||||
|
mInputs.mcSlowLength, // Slow Length
|
||||||
|
mInputs.mcMethod, // Calculation Method
|
||||||
|
mInputs.mcAppliedTo, // Applied To
|
||||||
|
//
|
||||||
|
// MC Style ...
|
||||||
|
"",
|
||||||
|
mInputs.mcDrawWidth, // Draw Width
|
||||||
|
mInputs.mcDrawType, // Draw Type
|
||||||
|
mInputs.mcDrawStyle, // Draw Style
|
||||||
|
mInputs.mcFastColor, // Fast Color
|
||||||
|
mInputs.mcSlowColor, // Slow Color
|
||||||
|
//
|
||||||
|
// MC Drawings ...
|
||||||
|
"",
|
||||||
|
mInputs.mcDrawFast, // Draw Fast
|
||||||
|
mInputs.mcDrawSlow, // Draw Slow
|
||||||
|
mInputs.mcDrawCrosses, // Draw Cross Lines
|
||||||
|
//
|
||||||
|
// Short Cycle ...
|
||||||
|
"",
|
||||||
|
//
|
||||||
|
// SC Market ...
|
||||||
|
"",
|
||||||
|
mInputs.scFastLength, // Fast Length
|
||||||
|
mInputs.scSlowLength, // Slow Length
|
||||||
|
mInputs.scMethod, // Calculation Method
|
||||||
|
mInputs.scAppliedTo, // Applied To
|
||||||
|
//
|
||||||
|
// SC Style ...
|
||||||
|
"",
|
||||||
|
mInputs.scDrawWidth, // Draw Width
|
||||||
|
mInputs.scDrawType, // Draw Type
|
||||||
|
mInputs.scDrawStyle, // Draw Style
|
||||||
|
mInputs.scFastColor, // Fast Color
|
||||||
|
mInputs.scSlowColor, // Slow Color
|
||||||
|
//
|
||||||
|
// SC Drawings ...
|
||||||
|
"",
|
||||||
|
mInputs.scDrawFast, // Draw Fast
|
||||||
|
mInputs.scDrawSlow, // Draw Slow
|
||||||
|
mInputs.scDrawCrosses // Draw Cross Lines
|
||||||
|
//
|
||||||
|
);
|
||||||
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +479,364 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
// Short ...
|
||||||
// int barIndex // Bar Index
|
|
||||||
// )
|
|
||||||
// {
|
|
||||||
// //
|
|
||||||
// if (barIndex < 0)
|
|
||||||
// {
|
|
||||||
// barIndex = 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
double GetSCFast(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
Calculate();
|
||||||
// if (barIndex >= count)
|
|
||||||
// {
|
|
||||||
// barIndex = count - 1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
int count = ArraySize(scFastBuffer);
|
||||||
// }
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
return scFastBuffer[barIndex];
|
||||||
// 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 Items ...
|
// Copy Required Items ...
|
||||||
// return Copy(
|
int CopySCFast(
|
||||||
// start,
|
int start, // Start
|
||||||
// count,
|
int count, // Number of Items for read
|
||||||
// longExit2Buffer,
|
double &buffer[], // Dest Buffer
|
||||||
// buffer,
|
bool forceClean = true // Force To Clean buffer
|
||||||
// forceClean
|
)
|
||||||
// //
|
{
|
||||||
// );
|
//
|
||||||
// }
|
// Update Calculations ...
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Items ...
|
||||||
|
return Copy(
|
||||||
|
start,
|
||||||
|
count,
|
||||||
|
scFastBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetSCSlow(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(scSlowBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return scSlowBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopySCSlow(
|
||||||
|
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,
|
||||||
|
scSlowBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Medium ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetMCFast(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(mcFastBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return mcFastBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyMCFast(
|
||||||
|
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,
|
||||||
|
mcFastBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetMCSlow(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(mcSlowBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return mcSlowBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyMCSlow(
|
||||||
|
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,
|
||||||
|
mcSlowBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLCFast(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(lcFastBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return lcFastBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyLCFast(
|
||||||
|
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,
|
||||||
|
lcFastBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLCSlow(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(lcSlowBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return lcSlowBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyLCSlow(
|
||||||
|
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,
|
||||||
|
lcSlowBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetHotState(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(hotStateBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return hotStateBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyHotState(
|
||||||
|
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,
|
||||||
|
hotStateBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +850,13 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double scFastBuffer[];
|
||||||
|
double scSlowBuffer[];
|
||||||
|
double mcFastBuffer[];
|
||||||
|
double mcSlowBuffer[];
|
||||||
|
double lcFastBuffer[];
|
||||||
|
double lcSlowBuffer[];
|
||||||
|
double hotStateBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +868,91 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// Short Cycle ...
|
||||||
// CopyBuffer(
|
|
||||||
// mHandler,
|
//
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
// Fast ...
|
||||||
// 0,
|
CopyBuffer(
|
||||||
// totalBars,
|
mHandler,
|
||||||
// shortExit2Buffer
|
XCHMA_SC_FAST_LINE,
|
||||||
// //
|
0,
|
||||||
// );
|
totalBars,
|
||||||
|
scFastBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Slow ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XCHMA_SC_SLOW_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
scSlowBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Medium Cycle ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Fast ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XCHMA_MC_FAST_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
mcFastBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Slow ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XCHMA_MC_SLOW_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
mcSlowBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Cycle ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Fast ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XCHMA_LC_FAST_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
lcFastBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Slow ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XCHMA_LC_SLOW_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
lcSlowBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Hot State ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XCHMA_HOT_STATE_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
hotStateBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ struct XXFIInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
int length; // Length
|
||||||
|
ENUM_MA_METHOD method; // MA Method
|
||||||
|
ENUM_APPLIED_VOLUME appliedTo; // Applied To
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +59,9 @@ struct XXFIInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 0;
|
||||||
|
method = MODE_SMA;
|
||||||
|
appliedTo = VOLUME_TICK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +69,9 @@ struct XXFIInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 18;
|
||||||
|
method = MODE_SMA;
|
||||||
|
appliedTo = VOLUME_TICK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +84,7 @@ struct XXFIInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
length >= 2
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +100,7 @@ struct XXFIInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, length);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +132,7 @@ public:
|
|||||||
bool Init(
|
bool Init(
|
||||||
string symbol, // Trading Symbol
|
string symbol, // Trading Symbol
|
||||||
ENUM_TIMEFRAMES period, // Trading Period
|
ENUM_TIMEFRAMES period, // Trading Period
|
||||||
XXFIInputs &inputs // Inputs
|
XXFIInputs &inputs // Inputs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -144,21 +152,24 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(mainBuffer, true);
|
||||||
// mHandler = iCustom(
|
mHandler = iCustom(
|
||||||
// mSymbol,
|
mSymbol,
|
||||||
// mPeriod,
|
mPeriod,
|
||||||
// "x-saherelm.x",
|
"x-saherelm.xfi",
|
||||||
// //
|
//
|
||||||
// // Inputs ...
|
// Inputs ...
|
||||||
// //
|
mInputs.length, // Length
|
||||||
// );
|
mInputs.method, // MA Method
|
||||||
// result = mHandler != INVALID_HANDLE;
|
mInputs.appliedTo // Applied To
|
||||||
// if (!result)
|
//
|
||||||
// {
|
);
|
||||||
// return result;
|
result = mHandler != INVALID_HANDLE;
|
||||||
// }
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +201,55 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetMain(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(mainBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return mainBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Items ...
|
||||||
// int CopyLongExit2(
|
int CopyMain(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
mainBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +263,7 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double mainBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
|
|||||||
@@ -30,7 +30,9 @@
|
|||||||
//
|
//
|
||||||
enum ENUM_XLH_BUFFERS
|
enum ENUM_XLH_BUFFERS
|
||||||
{
|
{
|
||||||
XLH_MAIN_LINE = 0
|
XLH_HH_LINE = 0,
|
||||||
|
XLH_LL_LINE = 1,
|
||||||
|
XLH_SIGNAL_LINE = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -39,7 +41,9 @@ struct XXLHInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
int length; // Length
|
||||||
|
ENUM_SERIESMODE hhMode; // Highest High Calculation Method
|
||||||
|
ENUM_SERIESMODE llMode; // Lowest Low Calculation Method
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +61,9 @@ struct XXLHInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 0;
|
||||||
|
hhMode = MODE_HIGH;
|
||||||
|
llMode = MODE_LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +71,9 @@ struct XXLHInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 14;
|
||||||
|
hhMode = MODE_HIGH;
|
||||||
|
llMode = MODE_LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +86,7 @@ struct XXLHInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
length >= 2
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +102,7 @@ struct XXLHInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, length);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +134,7 @@ public:
|
|||||||
bool Init(
|
bool Init(
|
||||||
string symbol, // Trading Symbol
|
string symbol, // Trading Symbol
|
||||||
ENUM_TIMEFRAMES period, // Trading Period
|
ENUM_TIMEFRAMES period, // Trading Period
|
||||||
XXLHInputs &inputs // Inputs
|
XXLHInputs &inputs // Inputs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -144,21 +154,28 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(hhBuffer, true);
|
||||||
// mHandler = iCustom(
|
ArraySetAsSeries(llBuffer, true);
|
||||||
// mSymbol,
|
ArraySetAsSeries(signalBuffer, true);
|
||||||
// mPeriod,
|
|
||||||
// "x-saherelm.x",
|
//
|
||||||
// //
|
mHandler = iCustom(
|
||||||
// // Inputs ...
|
mSymbol,
|
||||||
// //
|
mPeriod,
|
||||||
// );
|
"x-saherelm.xlh",
|
||||||
// result = mHandler != INVALID_HANDLE;
|
//
|
||||||
// if (!result)
|
// Inputs ...
|
||||||
// {
|
mInputs.length, // Length
|
||||||
// return result;
|
mInputs.hhMode, // Highest High Calculation Method
|
||||||
// }
|
mInputs.llMode // Lowest Low Calculation Method
|
||||||
|
//
|
||||||
|
);
|
||||||
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +207,155 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetHH(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(hhBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return hhBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Items ...
|
||||||
// int CopyLongExit2(
|
int CopyHH(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
hhBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLL(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(llBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return llBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyLL(
|
||||||
|
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,
|
||||||
|
llBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetSignal(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(signalBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return signalBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopySignal(
|
||||||
|
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,
|
||||||
|
signalBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +369,9 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double hhBuffer[];
|
||||||
|
double llBuffer[];
|
||||||
|
double signalBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +383,38 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// HH ...
|
||||||
// CopyBuffer(
|
CopyBuffer(
|
||||||
// mHandler,
|
mHandler,
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
XLH_HH_LINE,
|
||||||
// 0,
|
0,
|
||||||
// totalBars,
|
totalBars,
|
||||||
// shortExit2Buffer
|
hhBuffer
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// LL ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XLH_LL_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
llBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Signal ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XLH_SIGNAL_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
signalBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,17 @@ struct XXOBDInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
|
||||||
|
//
|
||||||
|
int length; // Swing Length
|
||||||
|
|
||||||
|
//
|
||||||
|
uchar swingHighArrowCode; // Swing High Arrow Code
|
||||||
|
color swingHighArrowColor; // Swing High Arrow Color
|
||||||
|
|
||||||
|
//
|
||||||
|
uchar swingLowArrowCode; // Swing Low Arrow Code
|
||||||
|
color swingLowArrowColor; // Swing Low Arrow Color
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +67,11 @@ struct XXOBDInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 0;
|
||||||
|
swingHighArrowCode = 108;
|
||||||
|
swingHighArrowColor = CLR_NONE;
|
||||||
|
swingLowArrowCode = 108;
|
||||||
|
swingLowArrowColor = CLR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +79,11 @@ struct XXOBDInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 5;
|
||||||
|
swingHighArrowCode = 108;
|
||||||
|
swingHighArrowColor = CLR_NONE;
|
||||||
|
swingLowArrowCode = 108;
|
||||||
|
swingLowArrowColor = CLR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +96,7 @@ struct XXOBDInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
length >= 3
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +112,7 @@ struct XXOBDInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, length);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -144,21 +164,26 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(mainBuffer, true);
|
||||||
// mHandler = iCustom(
|
mHandler = iCustom(
|
||||||
// mSymbol,
|
mSymbol,
|
||||||
// mPeriod,
|
mPeriod,
|
||||||
// "x-saherelm.x",
|
"x-saherelm.xobd",
|
||||||
// //
|
//
|
||||||
// // Inputs ...
|
// Inputs ...
|
||||||
// //
|
mInputs.length, // Swing Length
|
||||||
// );
|
mInputs.swingHighArrowCode, // Swing High Arrow Code
|
||||||
// result = mHandler != INVALID_HANDLE;
|
mInputs.swingHighArrowColor, // Swing High Arrow Color
|
||||||
// if (!result)
|
mInputs.swingLowArrowCode, // Swing Low Arrow Code
|
||||||
// {
|
mInputs.swingLowArrowColor // Swing Low Arrow Color
|
||||||
// return result;
|
//
|
||||||
// }
|
);
|
||||||
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +215,55 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetMain(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(mainBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return mainBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Items ...
|
||||||
// int CopyLongExit2(
|
int CopyMain(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
mainBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +277,7 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double mainBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +289,16 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// Main ...
|
||||||
// CopyBuffer(
|
CopyBuffer(
|
||||||
// mHandler,
|
mHandler,
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
XOBD_MAIN_LINE,
|
||||||
// 0,
|
0,
|
||||||
// totalBars,
|
totalBars,
|
||||||
// shortExit2Buffer
|
mainBuffer
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,35 @@ struct XXRSIInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
|
||||||
|
//
|
||||||
|
// Market ...
|
||||||
|
int length; // Market Length
|
||||||
|
ENUM_APPLIED_PRICE appliedTo; // Applied To
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Entry ...
|
||||||
|
double shortEntryValue; // Short Entry Level
|
||||||
|
color shortEntryColor; // Short Entry Level Color
|
||||||
|
ENUM_LINE_STYLE shortEntryLineStyle; // Short Entry Style
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Exit ...
|
||||||
|
double shortExitValue; // Short Exit Level
|
||||||
|
color shortExitColor; // Short Exit Level Color
|
||||||
|
ENUM_LINE_STYLE shortExitLineStyle; // Short Exit Style
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Entry ...
|
||||||
|
double longEntryValue; // Long Entry Level
|
||||||
|
color longEntryColor; // Long Entry Level Color
|
||||||
|
ENUM_LINE_STYLE longEntryLineStyle; // Long Entry Style
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Exit ...
|
||||||
|
double longExitValue; // Long Exit Level
|
||||||
|
color longExitColor; // Long Exit Level Color
|
||||||
|
ENUM_LINE_STYLE longExitLineStyle; // Long Exit Style
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +85,33 @@ struct XXRSIInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Market ...
|
||||||
|
length = 0;
|
||||||
|
appliedTo = PRICE_CLOSE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Entry ...
|
||||||
|
shortEntryValue = 0;
|
||||||
|
shortEntryColor = CLR_NONE;
|
||||||
|
shortEntryLineStyle = STYLE_DOT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Exit ...
|
||||||
|
shortExitValue = 0;
|
||||||
|
shortExitColor = CLR_NONE;
|
||||||
|
shortExitLineStyle = STYLE_DOT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Entry ...
|
||||||
|
longEntryValue = 0;
|
||||||
|
longEntryColor = CLR_NONE;
|
||||||
|
longEntryLineStyle = STYLE_DOT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Exit ...
|
||||||
|
longExitValue = 0;
|
||||||
|
longExitColor = CLR_NONE;
|
||||||
|
longExitLineStyle = STYLE_DOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +119,33 @@ struct XXRSIInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Market ...
|
||||||
|
length = 14;
|
||||||
|
appliedTo = PRICE_CLOSE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Entry ...
|
||||||
|
shortEntryValue = 70;
|
||||||
|
shortEntryColor = CLR_NONE;
|
||||||
|
shortEntryLineStyle = STYLE_DOT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Short Exit ...
|
||||||
|
shortExitValue = 40;
|
||||||
|
shortExitColor = CLR_NONE;
|
||||||
|
shortExitLineStyle = STYLE_DOT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Entry ...
|
||||||
|
longEntryValue = 30;
|
||||||
|
longEntryColor = CLR_NONE;
|
||||||
|
longEntryLineStyle = STYLE_DOT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Long Exit ...
|
||||||
|
longExitValue = 60;
|
||||||
|
longExitColor = CLR_NONE;
|
||||||
|
longExitLineStyle = STYLE_DOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +158,7 @@ struct XXRSIInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
length >= 2
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +174,7 @@ struct XXRSIInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, length);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -144,21 +226,50 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(mainBuffer, true);
|
||||||
// mHandler = iCustom(
|
mHandler = iCustom(
|
||||||
// mSymbol,
|
mSymbol,
|
||||||
// mPeriod,
|
mPeriod,
|
||||||
// "x-saherelm.x",
|
"x-saherelm.xrsi",
|
||||||
// //
|
//
|
||||||
// // Inputs ...
|
// Inputs ...
|
||||||
// //
|
//
|
||||||
// );
|
// Market ...
|
||||||
// result = mHandler != INVALID_HANDLE;
|
"",
|
||||||
// if (!result)
|
mInputs.length, // Market Length
|
||||||
// {
|
mInputs.appliedTo, // Applied To
|
||||||
// return result;
|
//
|
||||||
// }
|
// Short Entry ...
|
||||||
|
"",
|
||||||
|
mInputs.shortEntryValue, // Short Entry Level
|
||||||
|
mInputs.shortEntryColor, // Short Entry Level Color
|
||||||
|
mInputs.shortEntryLineStyle, // Short Entry Style
|
||||||
|
//
|
||||||
|
// Short Exit ...
|
||||||
|
"",
|
||||||
|
mInputs.shortExitValue, // Short Exit Level
|
||||||
|
mInputs.shortExitColor, // Short Exit Level Color
|
||||||
|
mInputs.shortExitLineStyle, // Short Exit Style
|
||||||
|
//
|
||||||
|
// Long Entry ...
|
||||||
|
"",
|
||||||
|
mInputs.longEntryValue, // Long Entry Level
|
||||||
|
mInputs.longEntryColor, // Long Entry Level Color
|
||||||
|
mInputs.longEntryLineStyle, // Long Entry Style
|
||||||
|
//
|
||||||
|
// Long Exit ...
|
||||||
|
"",
|
||||||
|
mInputs.longExitValue, // Long Exit Level
|
||||||
|
mInputs.longExitColor, // Long Exit Level Color
|
||||||
|
mInputs.longExitLineStyle // Long Exit Style
|
||||||
|
//
|
||||||
|
);
|
||||||
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +301,55 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetMain(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(mainBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return mainBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Items ...
|
||||||
// int CopyLongExit2(
|
int CopyMain(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
mainBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +363,7 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double mainBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +375,16 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// Main ...
|
||||||
// CopyBuffer(
|
CopyBuffer(
|
||||||
// mHandler,
|
mHandler,
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
XRSI_MAIN_LINE,
|
||||||
// 0,
|
0,
|
||||||
// totalBars,
|
totalBars,
|
||||||
// shortExit2Buffer
|
mainBuffer
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,9 @@
|
|||||||
//
|
//
|
||||||
enum ENUM_XTD_BUFFERS
|
enum ENUM_XTD_BUFFERS
|
||||||
{
|
{
|
||||||
XTD_MAIN_LINE = 0
|
XTD_BULLISH_LINE = 0,
|
||||||
|
XTD_BEARISH_LINE = 1,
|
||||||
|
XTD_SIGNAL_LINE = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -39,7 +41,19 @@ struct XXTDInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
//
|
||||||
|
int length; // Market Length
|
||||||
|
bool drawCrosses; // Draw Cross Arrows
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
uchar bullishArrowCode; // Cross Over Arrow Code
|
||||||
|
color bullishArrowColor; // Cross Over Arrow Color
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
uchar bearishArrowCode; // Cross Under Arrow Code
|
||||||
|
color bearishArrowColor; // Cross Under Arrow Color
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +71,18 @@ struct XXTDInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 0;
|
||||||
|
drawCrosses = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
bullishArrowCode = 228;
|
||||||
|
bullishArrowColor = CLR_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
bearishArrowCode = 230;
|
||||||
|
bearishArrowColor = CLR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +90,18 @@ struct XXTDInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
length = 14;
|
||||||
|
drawCrosses = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
bullishArrowCode = 228;
|
||||||
|
bullishArrowColor = CLR_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
bearishArrowCode = 230;
|
||||||
|
bearishArrowColor = CLR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +114,7 @@ struct XXTDInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
length >= 2
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +130,7 @@ struct XXTDInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, length);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +162,7 @@ public:
|
|||||||
bool Init(
|
bool Init(
|
||||||
string symbol, // Trading Symbol
|
string symbol, // Trading Symbol
|
||||||
ENUM_TIMEFRAMES period, // Trading Period
|
ENUM_TIMEFRAMES period, // Trading Period
|
||||||
XXTDInputs &inputs // Inputs
|
XXTDInputs &inputs // Inputs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -144,21 +182,36 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(bullishBuffer, true);
|
||||||
// mHandler = iCustom(
|
ArraySetAsSeries(bearishBuffer, true);
|
||||||
// mSymbol,
|
ArraySetAsSeries(signalBuffer, true);
|
||||||
// mPeriod,
|
|
||||||
// "x-saherelm.x",
|
//
|
||||||
// //
|
mHandler = iCustom(
|
||||||
// // Inputs ...
|
mSymbol,
|
||||||
// //
|
mPeriod,
|
||||||
// );
|
"x-saherelm.xtd",
|
||||||
// result = mHandler != INVALID_HANDLE;
|
//
|
||||||
// if (!result)
|
// Inputs ...
|
||||||
// {
|
//
|
||||||
// return result;
|
mInputs.length, // Market Length
|
||||||
// }
|
mInputs.drawCrosses, // Draw Cross Arrows
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
mInputs.bullishArrowCode, // Cross Over Arrow Code
|
||||||
|
mInputs.bullishArrowColor, // Cross Over Arrow Color
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
mInputs.bearishArrowCode, // Cross Under Arrow Code
|
||||||
|
mInputs.bearishArrowColor // Cross Under Arrow Color
|
||||||
|
//
|
||||||
|
);
|
||||||
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +243,155 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetBullish(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(bullishBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return bullishBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Items ...
|
||||||
// int CopyLongExit2(
|
int CopyBullish(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
bullishBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetBearish(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(bearishBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return bearishBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyBearish(
|
||||||
|
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,
|
||||||
|
bearishBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetSignal(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(signalBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return signalBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopySignal(
|
||||||
|
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,
|
||||||
|
signalBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +405,9 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double bullishBuffer[];
|
||||||
|
double bearishBuffer[];
|
||||||
|
double signalBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +419,38 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// Bullish ...
|
||||||
// CopyBuffer(
|
CopyBuffer(
|
||||||
// mHandler,
|
mHandler,
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
XTD_BULLISH_LINE,
|
||||||
// 0,
|
0,
|
||||||
// totalBars,
|
totalBars,
|
||||||
// shortExit2Buffer
|
bullishBuffer
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XTD_BEARISH_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
bearishBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Signal ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XTD_SIGNAL_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
signalBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ struct XXTMInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
int maPeriod; // Period
|
||||||
|
int maShift; // Shift
|
||||||
|
ENUM_MA_METHOD maMethod; // Method
|
||||||
|
ENUM_APPLIED_PRICE maAppliedTo; // Applied To
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +60,10 @@ struct XXTMInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
maShift = 0;
|
||||||
|
maPeriod = 0;
|
||||||
|
maMethod = MODE_SMA;
|
||||||
|
maAppliedTo = PRICE_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +71,10 @@ struct XXTMInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
maShift = 0;
|
||||||
|
maPeriod = 14;
|
||||||
|
maMethod = MODE_SMA;
|
||||||
|
maAppliedTo = PRICE_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +87,7 @@ struct XXTMInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
maPeriod >= 2
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +103,7 @@ struct XXTMInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, maPeriod);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +135,7 @@ public:
|
|||||||
bool Init(
|
bool Init(
|
||||||
string symbol, // Trading Symbol
|
string symbol, // Trading Symbol
|
||||||
ENUM_TIMEFRAMES period, // Trading Period
|
ENUM_TIMEFRAMES period, // Trading Period
|
||||||
XXTMInputs &inputs // Inputs
|
XXTMInputs &inputs // Inputs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -144,21 +155,25 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(mainBuffer, true);
|
||||||
// mHandler = iCustom(
|
mHandler = iCustom(
|
||||||
// mSymbol,
|
mSymbol,
|
||||||
// mPeriod,
|
mPeriod,
|
||||||
// "x-saherelm.x",
|
"x-saherelm.xtm",
|
||||||
// //
|
//
|
||||||
// // Inputs ...
|
// Inputs ...
|
||||||
// //
|
mInputs.maPeriod, // Period
|
||||||
// );
|
mInputs.maShift, // Shift
|
||||||
// result = mHandler != INVALID_HANDLE;
|
mInputs.maMethod, // Method
|
||||||
// if (!result)
|
mInputs.maAppliedTo // Applied To
|
||||||
// {
|
//
|
||||||
// return result;
|
);
|
||||||
// }
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +205,55 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetMain(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(mainBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return mainBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Main Buffer ...
|
||||||
// int CopyLongExit2(
|
int CopyMainBuffer(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
mainBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +267,7 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double mainBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +279,16 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// Main Buffer ...
|
||||||
// CopyBuffer(
|
CopyBuffer(
|
||||||
// mHandler,
|
mHandler,
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
XTM_MAIN_LINE,
|
||||||
// 0,
|
0,
|
||||||
// totalBars,
|
totalBars,
|
||||||
// shortExit2Buffer
|
mainBuffer
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,10 @@
|
|||||||
//
|
//
|
||||||
enum ENUM_XTS_BUFFERS
|
enum ENUM_XTS_BUFFERS
|
||||||
{
|
{
|
||||||
XTS_MAIN_LINE = 0
|
XTS_CURRENT_LINE = 0,
|
||||||
|
XTS_NEAREST_LINE = 1,
|
||||||
|
XTS_MEDIEST_LINE = 2,
|
||||||
|
XTS_FAREST_LINE = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -39,7 +42,24 @@ struct XXTSInputs
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
string tmp;
|
//
|
||||||
|
// Current Period ...
|
||||||
|
ENUM_APPLIED_PRICE currentAppliedTo; // Current Applied To
|
||||||
|
//
|
||||||
|
// Nearest Period ...
|
||||||
|
ENUM_X_PERIOD_METHOD nearestMethod; // How to Find Nearest Period
|
||||||
|
ENUM_TIMEFRAMES nearestPeriod; // Nearest Time Frame
|
||||||
|
ENUM_APPLIED_PRICE nearestAppliedTo; // Nearest Applied To
|
||||||
|
//
|
||||||
|
// Mediest Period ...
|
||||||
|
ENUM_X_PERIOD_METHOD mediestMethod; // How to Find Mediest Period
|
||||||
|
ENUM_TIMEFRAMES mediestPeriod; // Mediest Time Frame
|
||||||
|
ENUM_APPLIED_PRICE mediestAppliedTo; // Mediest Applied To
|
||||||
|
//
|
||||||
|
// Farest Period ...
|
||||||
|
ENUM_X_PERIOD_METHOD farestMethod; // How to Find Farest Period
|
||||||
|
ENUM_TIMEFRAMES farestPeriod; // Farest Time Frame
|
||||||
|
ENUM_APPLIED_PRICE farestAppliedTo; // Farest Applied To
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor(s) ...
|
// Constructor(s) ...
|
||||||
@@ -57,6 +77,23 @@ struct XXTSInputs
|
|||||||
void Clean()
|
void Clean()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Current Period ...
|
||||||
|
currentAppliedTo = PRICE_CLOSE;
|
||||||
|
//
|
||||||
|
// Nearest Period ...
|
||||||
|
nearestMethod = X_PERIOD_NOTHING;
|
||||||
|
nearestPeriod = NULL;
|
||||||
|
nearestAppliedTo = PRICE_CLOSE;
|
||||||
|
//
|
||||||
|
// Mediest Period ...
|
||||||
|
mediestMethod = X_PERIOD_NOTHING;
|
||||||
|
mediestPeriod = NULL;
|
||||||
|
mediestAppliedTo = PRICE_CLOSE;
|
||||||
|
//
|
||||||
|
// Farest Period ...
|
||||||
|
farestMethod = X_PERIOD_NOTHING;
|
||||||
|
farestPeriod = NULL;
|
||||||
|
farestAppliedTo = PRICE_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -64,6 +101,23 @@ struct XXTSInputs
|
|||||||
void Default()
|
void Default()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
// Current Period ...
|
||||||
|
currentAppliedTo = PRICE_CLOSE;
|
||||||
|
//
|
||||||
|
// Nearest Period ...
|
||||||
|
nearestMethod = X_PERIOD_AUTO;
|
||||||
|
nearestPeriod = NULL;
|
||||||
|
nearestAppliedTo = PRICE_CLOSE;
|
||||||
|
//
|
||||||
|
// Mediest Period ...
|
||||||
|
mediestMethod = X_PERIOD_AUTO;
|
||||||
|
mediestPeriod = NULL;
|
||||||
|
mediestAppliedTo = PRICE_CLOSE;
|
||||||
|
//
|
||||||
|
// Farest Period ...
|
||||||
|
farestMethod = X_PERIOD_AUTO;
|
||||||
|
farestPeriod = NULL;
|
||||||
|
farestAppliedTo = PRICE_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -76,7 +130,9 @@ struct XXTSInputs
|
|||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
false
|
IsValid(nearestMethod, nearestPeriod) &&
|
||||||
|
IsValid(mediestMethod, mediestPeriod) &&
|
||||||
|
IsValid(farestMethod, farestPeriod)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -92,7 +148,7 @@ struct XXTSInputs
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = MathMax(0, 0);
|
result = MathMax(result, 0);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +180,7 @@ public:
|
|||||||
bool Init(
|
bool Init(
|
||||||
string symbol, // Trading Symbol
|
string symbol, // Trading Symbol
|
||||||
ENUM_TIMEFRAMES period, // Trading Period
|
ENUM_TIMEFRAMES period, // Trading Period
|
||||||
XXTSInputs &inputs // Inputs
|
XXTSInputs &inputs // Inputs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -144,21 +200,48 @@ public:
|
|||||||
//
|
//
|
||||||
mInputs = inputs;
|
mInputs = inputs;
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
ArraySetAsSeries(currentBuffer, true);
|
||||||
// mHandler = iCustom(
|
ArraySetAsSeries(nearestBuffer, true);
|
||||||
// mSymbol,
|
ArraySetAsSeries(mediestBuffer, true);
|
||||||
// mPeriod,
|
ArraySetAsSeries(farestBuffer, true);
|
||||||
// "x-saherelm.x",
|
|
||||||
// //
|
//
|
||||||
// // Inputs ...
|
mHandler = iCustom(
|
||||||
// //
|
mSymbol,
|
||||||
// );
|
mPeriod,
|
||||||
// result = mHandler != INVALID_HANDLE;
|
"x-saherelm.xts",
|
||||||
// if (!result)
|
//
|
||||||
// {
|
// Inputs ...
|
||||||
// return result;
|
//
|
||||||
// }
|
// Current Period ...
|
||||||
|
"",
|
||||||
|
mInputs.currentAppliedTo, // Current Applied To
|
||||||
|
//
|
||||||
|
// Nearest Period ...
|
||||||
|
"",
|
||||||
|
mInputs.nearestMethod, // How to Find Nearest Period
|
||||||
|
mInputs.nearestPeriod, // Nearest Time Frame
|
||||||
|
mInputs.nearestAppliedTo, // Nearest Applied To
|
||||||
|
//
|
||||||
|
// Mediest Period ...
|
||||||
|
"",
|
||||||
|
mInputs.mediestMethod, // How to Find Mediest Period
|
||||||
|
mInputs.mediestPeriod, // Mediest Time Frame
|
||||||
|
mInputs.mediestAppliedTo, // Mediest Applied To
|
||||||
|
//
|
||||||
|
// Farest Period ...
|
||||||
|
"",
|
||||||
|
mInputs.farestMethod, // How to Find Farest Period
|
||||||
|
mInputs.farestPeriod, // Farest Time Frame
|
||||||
|
mInputs.farestAppliedTo // Farest Applied To
|
||||||
|
//
|
||||||
|
);
|
||||||
|
result = mHandler != INVALID_HANDLE;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -190,55 +273,205 @@ public:
|
|||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
|
|
||||||
// //
|
//
|
||||||
// double GetMain(
|
double GetCurrent(
|
||||||
// int barIndex // Bar Index
|
int barIndex // Bar Index
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// if (barIndex < 0)
|
if (barIndex < 0)
|
||||||
// {
|
{
|
||||||
// barIndex = 0;
|
barIndex = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// int count = ArraySize(mainBuffer);
|
int count = ArraySize(currentBuffer);
|
||||||
// if (barIndex >= count)
|
if (barIndex >= count)
|
||||||
// {
|
{
|
||||||
// barIndex = count - 1;
|
barIndex = count - 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// return mainBuffer[barIndex];
|
return currentBuffer[barIndex];
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Required Long Exits 2 ...
|
// Copy Required Items ...
|
||||||
// int CopyLongExit2(
|
int CopyCurrent(
|
||||||
// int start, // Start
|
int start, // Start
|
||||||
// int count, // Number of Items for read
|
int count, // Number of Items for read
|
||||||
// double &buffer[], // Dest Buffer
|
double &buffer[], // Dest Buffer
|
||||||
// bool forceClean = true // Force To Clean buffer
|
bool forceClean = true // Force To Clean buffer
|
||||||
// )
|
)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Update Calculations ...
|
// Update Calculations ...
|
||||||
// Calculate();
|
Calculate();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Copy Items ...
|
// Copy Items ...
|
||||||
// return Copy(
|
return Copy(
|
||||||
// start,
|
start,
|
||||||
// count,
|
count,
|
||||||
// longExit2Buffer,
|
currentBuffer,
|
||||||
// buffer,
|
buffer,
|
||||||
// forceClean
|
forceClean
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetNearest(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(nearestBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return nearestBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyNearest(
|
||||||
|
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,
|
||||||
|
nearestBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetMediest(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(mediestBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return mediestBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyMediest(
|
||||||
|
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,
|
||||||
|
mediestBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetFarest(
|
||||||
|
int barIndex // Bar Index
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Calculate();
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(farestBuffer);
|
||||||
|
if (barIndex >= count)
|
||||||
|
{
|
||||||
|
barIndex = count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return farestBuffer[barIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy Required Items ...
|
||||||
|
int CopyFarest(
|
||||||
|
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,
|
||||||
|
farestBuffer,
|
||||||
|
buffer,
|
||||||
|
forceClean
|
||||||
|
//
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
@@ -252,7 +485,10 @@ private:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Buffers ...
|
// Buffers ...
|
||||||
// double longExit1Buffer[];
|
double currentBuffer[];
|
||||||
|
double nearestBuffer[];
|
||||||
|
double mediestBuffer[];
|
||||||
|
double farestBuffer[];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tools ...
|
// Tools ...
|
||||||
@@ -264,16 +500,49 @@ private:
|
|||||||
//
|
//
|
||||||
int totalBars = CountBars();
|
int totalBars = CountBars();
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Short Exit 2 ...
|
// Current ...
|
||||||
// CopyBuffer(
|
CopyBuffer(
|
||||||
// mHandler,
|
mHandler,
|
||||||
// X_CHE_SHORT_EXIT_2_LINE,
|
XTS_CURRENT_LINE,
|
||||||
// 0,
|
0,
|
||||||
// totalBars,
|
totalBars,
|
||||||
// shortExit2Buffer
|
currentBuffer
|
||||||
// //
|
//
|
||||||
// );
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Nearest ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XTS_NEAREST_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
nearestBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Mediest ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XTS_MEDIEST_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
mediestBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Farest ...
|
||||||
|
CopyBuffer(
|
||||||
|
mHandler,
|
||||||
|
XTS_FAREST_LINE,
|
||||||
|
0,
|
||||||
|
totalBars,
|
||||||
|
farestBuffer
|
||||||
|
//
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user