163 lines
3.3 KiB
Plaintext
163 lines
3.3 KiB
Plaintext
///////////////////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 XCHMA Signal Provider Indicators Library
|
|
// ----------------------------------------------------------------
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
// Include Provider Inputs ...
|
|
#include "x-saherelm.xchma.provider.inputs.lib.mq5";
|
|
|
|
//
|
|
// Imports all Indicators Helper here ...
|
|
input group "XCHMA Provider Indicators";
|
|
#include "x-saherelm.xchma.oscillator.helper.lib.mq5";
|
|
|
|
//
|
|
int xCHMAMaxLengthOfInputs = 0;
|
|
int xCHMACalculatedBars = 0;
|
|
|
|
//
|
|
// Init Indicators ...
|
|
bool XCHMAInitIndicators()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Check and Calculate Max Length in Inputs ...
|
|
xCHMAMaxLengthOfInputs = MathMax(
|
|
xCHMAScFastLength,
|
|
xCHMAScSlowLength);
|
|
xCHMAMaxLengthOfInputs = MathMax(
|
|
xCHMAMcFastLength,
|
|
xCHMAMaxLengthOfInputs);
|
|
xCHMAMaxLengthOfInputs = MathMax(
|
|
xCHMAMcSlowLength,
|
|
xCHMAMaxLengthOfInputs);
|
|
xCHMAMaxLengthOfInputs = MathMax(
|
|
xCHMALcFastLength,
|
|
xCHMAMaxLengthOfInputs);
|
|
xCHMAMaxLengthOfInputs = MathMax(
|
|
xCHMALcSlowLength,
|
|
xCHMAMaxLengthOfInputs);
|
|
|
|
//
|
|
// Initialize Indicator/Oscillator Handlers ...
|
|
ResetLastError();
|
|
|
|
//
|
|
// XCHMA Init ...
|
|
result = XCHMAInitHandlers();
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = true;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Release Indicators ...
|
|
void XCHMAReleaseIndicators()
|
|
{
|
|
//
|
|
// Release Handlers ...
|
|
XCHMAReleaseHandlers();
|
|
}
|
|
|
|
//
|
|
// Handle Reading Buffers ...
|
|
void XCHMAHandleReadingBuffers()
|
|
{
|
|
//
|
|
// Reading Calculated Bars for a Simple Handler ...
|
|
xCHMACalculatedBars = BarsCalculated(xCHMAHandler);
|
|
|
|
//
|
|
// Read Indicators Buffers ...
|
|
XCHMAReadBuffers(xCHMANumberOfItemsPerTick);
|
|
}
|
|
|
|
//
|
|
//
|
|
// START Combination Functions ...
|
|
//
|
|
//
|
|
|
|
//
|
|
// Can Open Long Trade ...
|
|
// this is a Function will Check all market Conditions and get all
|
|
// Strategy requirement Verifications for Long Signals ...
|
|
bool XCHMACanOpenLongTrade() {
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = XCHMAHasLongConditions(xCHMANumberOfItemsPerTick);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Can Close Long Trade ...
|
|
// this is a Function will Check all market Conditions and get all
|
|
// Strategy requirement Verifications for Long Signals ...
|
|
bool XCHMACanCloseLongTrade() {
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Can Open Short Trade ...
|
|
// this is a Function will Check all market Conditions and get all
|
|
// Strategy requirement Verifications for Short Signals ...
|
|
bool XCHMACanOpenShortTrade() {
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result = XCHMAHasShortConditions(xCHMANumberOfItemsPerTick);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Can Close Short Trade ...
|
|
// this is a Function will Check all market Conditions and get all
|
|
// Strategy requirement Verifications for Short Signals ...
|
|
bool XCHMACanCloseShortTrade() {
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
//
|
|
// END Combination Functions ...
|
|
//
|
|
//
|