Skip to content

Commit

Permalink
MT5 code invocation from MT4 for all available indicators.
Browse files Browse the repository at this point in the history
  • Loading branch information
nseam committed May 20, 2024
1 parent bc02e03 commit 572f0c8
Show file tree
Hide file tree
Showing 83 changed files with 707 additions and 18 deletions.
11 changes: 11 additions & 0 deletions Oscillators/ADX.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER6(ExtADXBuffer, ExtPDIBuffer, ExtNDIBuffer, ExtPDBuffer, \
ExtNDBuffer, ExtTmpBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER6(ExtADXBuffer, ExtPDIBuffer, ExtNDIBuffer, ExtPDBuffer, \
ExtNDBuffer, ExtTmpBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "ADX.mq5"

Expand Down
11 changes: 11 additions & 0 deletions Oscillators/ADX.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,16 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER6(ExtADXBuffer, ExtPDIBuffer, ExtNDIBuffer, ExtPDBuffer, \
ExtNDBuffer, ExtTmpBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER6(ExtADXBuffer, ExtPDIBuffer, ExtNDIBuffer, ExtPDBuffer, \
ExtNDBuffer, ExtTmpBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\ADX.mq5>
19 changes: 19 additions & 0 deletions Oscillators/ADXW.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER5_NO_ENSURE(InpExtADXWBuffer, InpExtPDIBuffer, \
InpExtNDIBuffer, InpExtPDSBuffer, \
InpExtNDSBuffer); \
ACQUIRE_BUFFER5_NO_ENSURE(InpExtPDBuffer, InpExtNDBuffer, InpExtTRBuffer, \
InpExtATRBuffer, InpExtDXBuffer); \
SET_BUFFER_AS_SERIES_RELEASE_ENSURER_BEGIN(10);
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER5_NO_ENSURE(InpExtADXWBuffer, InpExtPDIBuffer, \
InpExtNDIBuffer, InpExtPDSBuffer, \
InpExtNDSBuffer); \
RELEASE_BUFFER5_NO_ENSURE(InpExtPDBuffer, InpExtNDBuffer, InpExtTRBuffer, \
InpExtATRBuffer, InpExtDXBuffer); \
SET_BUFFER_AS_SERIES_RELEASE_ENSURER_END(10);
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "ADXW.mq5"

Expand Down
17 changes: 17 additions & 0 deletions Oscillators/ADXW.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,22 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER5_NO_ENSURE(ExtADXWBuffer, ExtPDIBuffer, ExtNDIBuffer, \
ExtPDSBuffer, ExtNDSBuffer); \
ACQUIRE_BUFFER5_NO_ENSURE(ExtPDBuffer, ExtNDBuffer, ExtTRBuffer, \
ExtATRBuffer, ExtDXBuffer); \
SET_BUFFER_AS_SERIES_RELEASE_ENSURER_BEGIN(10);
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER5_NO_ENSURE(ExtADXWBuffer, ExtPDIBuffer, ExtNDIBuffer, \
ExtPDSBuffer, ExtNDSBuffer); \
RELEASE_BUFFER5_NO_ENSURE(ExtPDBuffer, ExtNDBuffer, ExtTRBuffer, \
ExtATRBuffer, ExtDXBuffer); \
SET_BUFFER_AS_SERIES_RELEASE_ENSURER_END(10);
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\ADXW.mq5>
9 changes: 9 additions & 0 deletions Oscillators/ASI.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER3(InpExtASIBuffer, InpExtSIBuffer, InpExtTRBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER3(InpExtASIBuffer, InpExtSIBuffer, InpExtTRBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "ASI.mq5"

Expand Down
9 changes: 9 additions & 0 deletions Oscillators/ASI.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,14 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER3(ExtASIBuffer, ExtSIBuffer, ExtTRBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER3(ExtASIBuffer, ExtSIBuffer, ExtTRBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\ASI.mq5>
7 changes: 7 additions & 0 deletions Oscillators/ATR.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtATRBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtATRBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "ATR.mq5"

Expand Down
7 changes: 7 additions & 0 deletions Oscillators/ATR.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,12 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtATRBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtATRBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\ATR.mq5>
7 changes: 7 additions & 0 deletions Oscillators/Bulls.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtBullsBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtBullsBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "Bulls.mq5"

Expand Down
7 changes: 7 additions & 0 deletions Oscillators/Bulls.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,12 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtBullsBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtBullsBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\Bulls.mq5>
7 changes: 7 additions & 0 deletions Oscillators/CCI.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtCCIBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtCCIBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "CCI.mq5"

Expand Down
7 changes: 7 additions & 0 deletions Oscillators/CCI.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,12 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_SHORT // Non-OHLC OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtCCIBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtCCIBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\CCI.mq5>
9 changes: 9 additions & 0 deletions Oscillators/CHV.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER3(InpExtCHVBuffer, InpExtHLBuffer, InpExtSHLBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER3(InpExtCHVBuffer, InpExtHLBuffer, InpExtSHLBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "CHV.mq5"

Expand Down
9 changes: 9 additions & 0 deletions Oscillators/CHV.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,14 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER3(ExtCHVBuffer, ExtHLBuffer, ExtSHLBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER3(ExtCHVBuffer, ExtHLBuffer, ExtSHLBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\CHV.mq5>
7 changes: 7 additions & 0 deletions Oscillators/DPO.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "DPO.mq5"

Expand Down
9 changes: 9 additions & 0 deletions Oscillators/DPO.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,14 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_SHORT // Non-OHLC OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER2(ExtDPOBuffer, ExtMABuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER2(ExtDPOBuffer, ExtMABuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\DPO.mq5>
9 changes: 9 additions & 0 deletions Oscillators/DeMarker.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER1(ExtDeMarkerBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER1(ExtDeMarkerBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "DeMarker.mq5"

Expand Down
9 changes: 9 additions & 0 deletions Oscillators/DeMarker.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER1(ExtDeMarkerBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER1(ExtDeMarkerBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\DeMarker.mq5>
9 changes: 9 additions & 0 deletions Oscillators/MACD.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER2(ExtMACDBuffer, ExtSignalBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER2(ExtMACDBuffer, ExtSignalBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "MACD.mq5"

Expand Down
11 changes: 11 additions & 0 deletions Oscillators/MACD.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,16 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER4(ExtMacdBuffer, ExtSignalBuffer, ExtFastMaBuffer, \
ExtSlowMaBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER4(ExtMacdBuffer, ExtSignalBuffer, ExtFastMaBuffer, \
ExtSlowMaBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Resource files.
#include <../Indicators\Examples\MACD.mq5>
7 changes: 7 additions & 0 deletions Oscillators/MI.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(InpExtMIBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(InpExtMIBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "MI.mq5"

Expand Down
9 changes: 9 additions & 0 deletions Oscillators/MI.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER4(ExtHLBuffer, ExtEHLBuffer, ExtEEHLBuffer, ExtMIBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER4(ExtHLBuffer, ExtEHLBuffer, ExtEEHLBuffer, ExtMIBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\MI.mq5>
9 changes: 9 additions & 0 deletions Oscillators/MOM.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER1(ExtMomentumBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER1(ExtMomentumBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "MOM.mq5"

Expand Down
9 changes: 9 additions & 0 deletions Oscillators/MOM.mt5.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,14 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_SHORT // Non-OHLC OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER \
ACQUIRE_BUFFER1(ExtMomentumBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER \
RELEASE_BUFFER1(ExtMomentumBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes MQL5 version of indicator.
#include <../Indicators\Examples\Momentum.mq5>
7 changes: 7 additions & 0 deletions Oscillators/ROC.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
#property version "1.000"
#endif

// This will allow calling MT5 functions in MT4.
#define INDICATOR_LEGACY_VERSION_MT5
#define INDICATOR_LEGACY_VERSION_LONG // OHLC-based OnCalculate().
#define INDICATOR_LEGACY_VERSION_ACQUIRE_BUFFER ACQUIRE_BUFFER1(ExtROCBuffer)
#define INDICATOR_LEGACY_VERSION_RELEASE_BUFFER RELEASE_BUFFER1(ExtROCBuffer)
#include <EA31337-classes/IndicatorLegacy.h>

// Includes the main code.
#include "ROC.mq5"

Expand Down
Loading

0 comments on commit 572f0c8

Please sign in to comment.