This commit is contained in:
2024-02-02 01:32:20 +03:30
parent 87f09d72f6
commit ebb772b42f
40 changed files with 46510 additions and 16 deletions
+52 -4
View File
@@ -27,10 +27,16 @@
input group "Commons";
//
// END Inputs ...
// XCTIMER inputs ...
input bool xAU5ShowCandleTimer = true; // Show Condle Remaining Time
input color xAU5CandleTimerColot = clrYellow; // Candle Timer Color
input ENUM_BASE_CORNER xAU5CandleTimerCorner = CORNER_RIGHT_LOWER; // Where to Show Candle Timer
//
// END Inputs ...
//
//
//
// START Including Providers ...
//
@@ -65,6 +71,9 @@ bool isXAU5NewHour;
bool isXAU5NewDay;
bool isXAU5NewWeek;
bool isXAU5NewMonth;
//
int xAU5CTimerHandler = INVALID_HANDLE;
//
// END Global Definitions: Variables, Properties and etc ...
//
@@ -104,6 +113,16 @@ int OnInit()
return INIT_PARAMETERS_INCORRECT;
}
//
// Init XCTimer ...
if (xAU5ShowCandleTimer)
{
if (!XAU5CTimerInit())
{
return INIT_FAILED;
}
}
//
// Init Succeed ...
return INIT_SUCCEEDED;
@@ -135,6 +154,9 @@ void OnDeinit(const int reason)
//
// De Init XDraw Library ...
// OnDeinitDrawLibrary();
//
IndicatorRelease(xAU5CTimerHandler);
}
//
@@ -266,7 +288,6 @@ void OnTick()
SendAlert(message);
}
//
// Prevent Going Forward if user Disable it ...
if (xAU5EnableProvider)
@@ -277,11 +298,14 @@ void OnTick()
}
//
if (!IsNewCandle())
if (!IsNewCandle() && xAU5WaitUntilNextCandle)
{
return;
}
//
xAU5WaitUntilNextCandle = false;
//
// Prevent Going Forward if user Disable it ...
if (xAU5EnableProvider)
@@ -342,6 +366,30 @@ bool ValidateInputs()
return result;
}
bool XAU5CTimerInit()
{
//
bool result = true;
//
xAU5CTimerHandler = iCustom(
_Symbol,
_Period,
"x-saherelm.xctimer.indicator",
//
// Inputs ...
xAU5CandleTimerColot,
xAU5CandleTimerCorner
);
//
if (xAU5CTimerHandler == INVALID_HANDLE) {
result = false;
}
//
return result;
}
//
// END Functions ...
//