127 lines
2.7 KiB
Plaintext
127 lines
2.7 KiB
Plaintext
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 _INDICATOR_ Indicator Helper for Signal Providers
|
|
// --------------------------------------------------------------------------
|
|
//
|
|
//
|
|
// 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
|
|
|
|
//
|
|
// Includes ...
|
|
#include "..\Libraries\x-saherelm.log.lib.mq5"
|
|
#include "..\Libraries\x-saherelm.common.lib.mq5"
|
|
//
|
|
// TODO: Include Main Provider Inputs ...
|
|
// #include "x-saherelm.xmap.provider.inputs.lib.mq5"
|
|
|
|
//
|
|
// START Inputs ...
|
|
//
|
|
input group "_INDICATOR_ Indicator/Oscillator";
|
|
// TODO: Implement Named Indicator/Oscillator Specific Inputs here ...
|
|
//
|
|
// END Inputs ...
|
|
//
|
|
|
|
//
|
|
// START Definitions ...
|
|
int _iNDICATOR_Handler = INVALID_HANDLE;
|
|
//
|
|
// TODO: Define Specific Buffers here ...
|
|
// double _iNDICATOR_Buffer[];
|
|
//
|
|
// END Definitions ...
|
|
//
|
|
|
|
//
|
|
// START Handler Functions ...
|
|
//
|
|
//
|
|
// Init Indicators ...
|
|
bool _INDICATOR_InitHandlers()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Initialize Indicator/Oscillator Handlers ...
|
|
ResetLastError();
|
|
|
|
//
|
|
// _INDICATOR_ Handler ...
|
|
// TODO: Set As Buffer Series ...
|
|
// ArraySetAsSeries(_iNDICATOR_Buffer, true);
|
|
_iNDICATOR_Handler = iCustom(
|
|
_Symbol,
|
|
_Period,
|
|
// TODO: Set Indicator Name ...
|
|
""
|
|
//
|
|
// Inputs ...
|
|
// TODO: Attach Inputs here ...
|
|
//
|
|
);
|
|
if (_iNDICATOR_Handler == INVALID_HANDLE)
|
|
{
|
|
//
|
|
// TODO: Edit Error Message ...
|
|
LogMessage("failed to Initialize _INDICATOR_ Indicator: " + (string)GetLastError());
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = true;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Release Indicators ...
|
|
void _INDICATOR_ReleaseHandlers()
|
|
{
|
|
IndicatorRelease(_iNDICATOR_Handler);
|
|
}
|
|
|
|
//
|
|
// Handle Reading Buffers ...
|
|
void _INDICATOR_ReadBuffers()
|
|
{
|
|
//
|
|
// TODO: Fix Copy Buffer ...
|
|
// CopyBuffer(
|
|
// _iNDICATOR_Handler,
|
|
// 0,
|
|
// 0,
|
|
// //
|
|
// // TODO: Use Global Number Of Items Per Tick ...
|
|
// 0
|
|
// //
|
|
// // TODO Define Which buffer to save results ...
|
|
// // _iNDICATOR_Buffer
|
|
// //
|
|
// );
|
|
}
|
|
//
|
|
// END Handler Funcions ...
|
|
//
|
|
|
|
//
|
|
// START _INDICATOR_ Custom Functions ...
|
|
//
|
|
// TODO: Attach all Aditional Helper Functions for Specific Indicator/Oscillator here ...
|
|
//
|
|
// END _INDICATOR_ Custom Functions ...
|
|
//
|