prepare all indicators for working by new structures of libraries and models and compile them successfully ...
This commit is contained in:
@@ -44,10 +44,6 @@ input color swingLowArrowColor = clrAqua; // Swing Low Arrow Color
|
||||
// END Inputs ...
|
||||
//
|
||||
|
||||
//
|
||||
// Includes Logging Library ...
|
||||
#include "../Libraries/x-saherelm.log.lib.mq5"
|
||||
|
||||
//
|
||||
// Include Common and Models Library ...
|
||||
#include "../Libraries/x-saherelm.common.lib.mq5"
|
||||
@@ -94,7 +90,6 @@ int OnInit()
|
||||
}
|
||||
|
||||
//
|
||||
logTag = ShortName;
|
||||
drawPrefix = ShortName;
|
||||
|
||||
//
|
||||
@@ -125,10 +120,6 @@ void OnDeinit(const int reason)
|
||||
// REASON_TEMPLATE 7 Another chart template applied
|
||||
// REASON_INITFAILED 8 The OnInit() handler returned a non-zero value
|
||||
// REASON_CLOSE 9 Terminal closed
|
||||
|
||||
//
|
||||
// Here we can handle De Initialization Reasons ...
|
||||
OnDeinitDrawLibrary();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -264,32 +255,30 @@ void CalculateBuffers(int bar_index)
|
||||
|
||||
//
|
||||
// Reading Candles Data ...
|
||||
XOHCL candles[];
|
||||
for (int i = bar_index; i < bar_index + ((length * 2) + 2); i++)
|
||||
{
|
||||
int start = bar_index;
|
||||
int count = (length * 2) + 2;
|
||||
int end = start + count;
|
||||
XOHCL bars[];
|
||||
GetBars(
|
||||
bars,
|
||||
_Symbol,
|
||||
_Period,
|
||||
start,
|
||||
count
|
||||
//
|
||||
XOHCL iCandle = GetCandle(
|
||||
_Symbol,
|
||||
_Period,
|
||||
i);
|
||||
|
||||
//
|
||||
Add(
|
||||
iCandle,
|
||||
candles);
|
||||
}
|
||||
);
|
||||
|
||||
//
|
||||
// Swing Low ...
|
||||
isSwingLow =
|
||||
//
|
||||
candles[1].close > candles[2].close &&
|
||||
candles[2].close > candles[3].close &&
|
||||
bars[1].close > bars[2].close &&
|
||||
bars[2].close > bars[3].close &&
|
||||
//
|
||||
candles[3].close < candles[4].close &&
|
||||
bars[3].close < bars[4].close &&
|
||||
//
|
||||
candles[5].close > candles[4].close &&
|
||||
candles[6].close > candles[5].close
|
||||
bars[5].close > bars[4].close &&
|
||||
bars[6].close > bars[5].close
|
||||
//
|
||||
;
|
||||
|
||||
@@ -306,13 +295,13 @@ void CalculateBuffers(int bar_index)
|
||||
// Swing High ...
|
||||
isSwingHigh =
|
||||
//
|
||||
candles[1].close < candles[2].close &&
|
||||
candles[2].close < candles[3].close &&
|
||||
bars[1].close < bars[2].close &&
|
||||
bars[2].close < bars[3].close &&
|
||||
//
|
||||
candles[3].close > candles[4].close &&
|
||||
bars[3].close > bars[4].close &&
|
||||
//
|
||||
candles[5].close < candles[4].close &&
|
||||
candles[6].close < candles[5].close
|
||||
bars[5].close < bars[4].close &&
|
||||
bars[6].close < bars[5].close
|
||||
//
|
||||
;
|
||||
|
||||
@@ -355,12 +344,17 @@ void CalculateBuffers(int bar_index)
|
||||
//
|
||||
// Draw a Swing Arrow Shape ...
|
||||
void DrawSwingArrow(
|
||||
int type, // Swing Type: 0 - Low / 1 - High ...
|
||||
int bar_index)
|
||||
int type, // Swing Type: 0 - Low / 1 - High ...
|
||||
int bar_index //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool isSwingHigh = type == 1;
|
||||
XOHCL candle = GetCandle(bar_index + 3);
|
||||
XOHCL candle;
|
||||
candle.Init(
|
||||
_Symbol,
|
||||
_Period,
|
||||
bar_index + 3);
|
||||
double arrowDistanceInPoint = 0;
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user