Skip to content

Commit

Permalink
Updated Renko EA and added Didi Index indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
9nix6 committed Feb 16, 2021
1 parent 9e91bac commit b7efeff
Show file tree
Hide file tree
Showing 67 changed files with 402 additions and 130 deletions.
Binary file modified Experts/2MA_Cross.ex5
Binary file not shown.
18 changes: 16 additions & 2 deletions Experts/2MA_Cross.mq5
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#property copyright "Copyright 2017-2021, Artur Zas"
// GNU General Public License v3.0 -> https://github.com/9nix6/Median-and-Turbo-Renko-indicator-bundle/blob/master/LICENSE
#property link "https://www.az-invest.eu"
#property version "1.13"
#property version "1.14"

//#define ULTIMATE_RENKO_LICENSE // uncomment when used on Ultimate Renko chart from https://www.az-invest.eu/ultimate-renko-indicator-generator-for-metatrader-5
//#define TICKCHART_LICENSE // uncomment when used on a Tick chart from https://www.az-invest.eu/Tick-chart-and-volume-chart-for-mt5
//#define VOLUMECHART_LICENSE // uncomment when used on a Tick & Volume bar chart from https://www.az-invest.eu/Tick-chart-and-volume-chart-for-mt5

//
// Uncomment only ONE of the 3 directives listed below and recompile
Expand All @@ -12,6 +14,7 @@
//#define EA_ON_RANGE_BARS // Use EA on RangeBar chart
#define EA_ON_RENKO // Use EA on Renko charts
//#define EA_ON_XTICK_CHART // Use EA on XTick Chart
//#define EA_ON_TICK_VOLUME_CHART // Use EA on Tick & Volume Bar Chart

// Uncomment the directive below and recompile if EA is used with P-Renko BR Ultimate
// ----------------------------------------------------------------------------------
Expand All @@ -38,6 +41,10 @@
#include <AZ-INVEST/SDK/TickChart.mqh>
TickChart *customBars = NULL;
#endif
#ifdef EA_ON_TICK_VOLUME_CHART
#include <AZ-INVEST/SDK/VolumeBarChart.mqh>
TickChart *customBars = NULL;
#endif

#include <AZ-INVEST/SDK/TimeControl.mqh>
#include <AZ-INVEST/SDK/TradeFunctions.mqh>
Expand Down Expand Up @@ -99,6 +106,10 @@ ENUM_POSITION_TYPE validation;
static int _MA1 = TICKCHART_MA1;
static int _MA2 = TICKCHART_MA2;
#endif
#ifdef EA_ON_TICK_VOLUME_CHART
static int _MA1 = VOLUMECHART_MA1;
static int _MA2 = VOLUMECHART_MA2;
#endif

//+------------------------------------------------------------------+
//| Expert initialization function |
Expand All @@ -116,6 +127,9 @@ int OnInit()
#ifdef EA_ON_XTICK_CHART
customBars = new TickChart(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
#endif
#ifdef EA_ON_TICK_VOLUME_CHART
customBars = new TickChart(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
#endif
}

customBars.Init();
Expand Down
Binary file modified Experts/PriceMA_Cross.ex5
Binary file not shown.
18 changes: 16 additions & 2 deletions Experts/PriceMA_Cross.mq5
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#property copyright "Copyright 2017-2021, Artur Zas"
// GNU General Public License v3.0 -> https://github.com/9nix6/Median-and-Turbo-Renko-indicator-bundle/blob/master/LICENSE
#property link "https://www.az-invest.eu"
#property version "1.05"
#property version "1.06"

//#define ULTIMATE_RENKO_LICENSE // uncomment when used on Ultimate Renko chart from https://www.az-invest.eu/ultimate-renko-indicator-generator-for-metatrader-5
//#define TICKCHART_LICENSE // uncomment when used on a Tick chart from https://www.az-invest.eu/Tick-chart-and-volume-chart-for-mt5
//#define VOLUMECHART_LICENSE // uncomment when used on a Tick & Volume bar chart from https://www.az-invest.eu/Tick-chart-and-volume-chart-for-mt5

//
// Uncomment only ONE of the 3 directives listed below and recompile
Expand All @@ -12,6 +14,7 @@
//#define EA_ON_RANGE_BARS // Use EA on RangeBar chart
#define EA_ON_RENKO // Use EA on Renko charts
//#define EA_ON_XTICK_CHART // Use EA on XTick Chart
//#define EA_ON_TICK_VOLUME_CHART // Use EA on Tick & Volume Bar Chart

// Uncomment the directive below and recompile if EA is used with P-Renko BR Ultimate
// ----------------------------------------------------------------------------------
Expand All @@ -38,6 +41,10 @@
#include <AZ-INVEST/SDK/TickChart.mqh>
TickChart *customBars = NULL;
#endif
#ifdef EA_ON_TICK_VOLUME_CHART
#include <AZ-INVEST/SDK/VolumeBarChart.mqh>
TickChart *customBars = NULL;
#endif

#include <AZ-INVEST/SDK/TimeControl.mqh>
#include <AZ-INVEST/SDK/TradeFunctions.mqh>
Expand Down Expand Up @@ -103,6 +110,10 @@ ENUM_POSITION_TYPE validation;
static int _MA1 = TICKCHART_MA1;
static int _MA2 = TICKCHART_MA2;
#endif
#ifdef EA_ON_TICK_VOLUME_CHART
static int _MA1 = VOLUMECHART_MA1;
static int _MA2 = VOLUMECHART_MA2;
#endif

//+------------------------------------------------------------------+
//| Expert initialization function |
Expand All @@ -120,6 +131,9 @@ int OnInit()
#ifdef EA_ON_XTICK_CHART
customBars = new TickChart(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
#endif
#ifdef EA_ON_TICK_VOLUME_CHART
customBars = new TickChart(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
#endif
}

customBars.Init();
Expand Down
Binary file modified Experts/Renko_EA.ex5
Binary file not shown.
83 changes: 54 additions & 29 deletions Experts/Renko_EA.mq5
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
//
// Copyright 2018-2020, Artur Zas
// Copyright 2018-2021, Artur Zas
// GNU General Public License v3.0 -> https://github.com/9nix6/Median-and-Turbo-Renko-indicator-bundle/blob/master/LICENSE
// https://www.az-invest.eu
// https://www.mql5.com/en/users/arturz
//
// Renko_EA uses "Median and Turbo renko indicator bundle" for the renko chart.
// You can get this indicator from MQL5 market:
// https://www.mql5.com/en/market/product/16347
// or
// https://www.az-invest.eu
// https://www.az-invest.eu/ultimate-renko-indicator-generator-for-metatrader-5
//
#define VERSION "2.01"
#property version VERSION
//#define DEVELOPER_VERSION // used when I develop ;) should always be commented out

//#define ULTIMATE_RENKO_LICENSE // uncomment when used on Ultimate Renko chart from https://www.az-invest.eu/ultimate-renko-indicator-generator-for-metatrader-5

// Uncomment the directive below and recompile if EA is used with P-Renko BR Ultimate
Expand Down Expand Up @@ -56,10 +61,18 @@ input string InpEnd = "16:00"; // End trading
input string InpComment2 = "Always trade"; // *** If Start = "0" & End = "0" =>
input bool InpCloseTradesEOD = false; // Close trades at "End trading" time

input ENUM_FILTER_MODE InpMA1Filter = FILTER_MODE_OFF; // Use MA1 filter
input ENUM_FILTER_MODE InpMA2Filter = FILTER_MODE_OFF; // Use MA2 filter
input ENUM_FILTER_MODE InpMA3Filter = FILTER_MODE_OFF; // Use MA3 filter
input ENUM_FILTER_MODE InpSuperTrendFilter = FILTER_MODE_OFF; // Use SuprTrend filter
input ENUM_FILTER_MODE InpMA1Filter = FILTER_MODE_OFF; // Use MA1 filter
input ENUM_FITER_CONDITION InpMA1FilterCond = FILTER_CONDITION_OPEN_OR_CLOSE; // MA1 filter condition
input int InpMA1FilterCheckBars = 1; // MA1 filter on last completed bars
input ENUM_FILTER_MODE InpMA2Filter = FILTER_MODE_OFF; // Use MA2 filter
input ENUM_FITER_CONDITION InpMA2FilterCond = FILTER_CONDITION_OPEN_OR_CLOSE; // MA2 filter condition
input int InpMA2FilterCheckBars = 1; // MA2 filter on last completed bars
input ENUM_FILTER_MODE InpMA3Filter = FILTER_MODE_OFF; // Use MA3 filter
input ENUM_FITER_CONDITION InpMA3FilterCond = FILTER_CONDITION_OPEN_OR_CLOSE; // MA3 filter condition
input int InpMA3FilterCheckBars = 1; // MA3 filter on last completed bars
input ENUM_FILTER_MODE InpSuperTrendFilter = FILTER_MODE_OFF; // Use SuprTrend filter
input ENUM_FITER_CONDITION InpSuperTrendFilterCond = 1; // SuprTrend filter on last completed bars
input int InpSuperTrendFilterCheckBars = FILTER_CONDITION_OPEN_OR_CLOSE; // SuprTrend filter condition

input ulong InpMagicNumber = 82; // EA magic number (Trade ID)
input ulong InpDeviationPoints = 0; // Maximum deviation points
Expand All @@ -75,7 +88,11 @@ CEaLogic eaLogic;
//+------------------------------------------------------------------+
int OnInit()
{
#ifdef DEVELOPER_VERSION
medianRenko = new MedianRenko();
#else
medianRenko = new MedianRenko(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
#endif
if(medianRenko == NULL)
return(INIT_FAILED);

Expand All @@ -85,29 +102,37 @@ int OnInit()

CEaLogicPartameters params;
{
params.TradingMode = InpMode;
params.OpenXSignal = InpOpenXSignal;
params.CloseXSignal = InpCloseXSignal;
params.LotSize = InpLotSize;
params.SLPoints = InpSLPoints;
params.TPPoints = InpTPPoints;
params.BEPoints = InpBEPoints;
params.TrailByPoints = InpTrailByPoints;
params.TrailStartPoints = InpTrailStartPoints;
params.StopAndReverse = InpStopAndReverse;
params.CloseOnRevesal = InpCloseOnRevesal;
params.StartTrading = InpStart;
params.EndTrading = InpEnd;
params.CloseEOD = InpCloseTradesEOD;
params.MA1Filter = InpMA1Filter;
params.MA2Filter = InpMA2Filter;
params.MA3Filter = InpMA3Filter;
params.SuperTrendFilter = InpSuperTrendFilter;
params.MagicNumber = InpMagicNumber;
params.DeviationPoints = InpDeviationPoints;
params.NumberOfRetries = InpNumberOfRetries;
params.BusyTimeout_ms = InpBusyTimeout_ms;
params.RequoteTimeout_ms = InpRequoteTimeout_ms;
params.TradingMode = InpMode;
params.OpenXSignal = InpOpenXSignal;
params.CloseXSignal = InpCloseXSignal;
params.LotSize = InpLotSize;
params.SLPoints = InpSLPoints;
params.TPPoints = InpTPPoints;
params.BEPoints = InpBEPoints;
params.TrailByPoints = InpTrailByPoints;
params.TrailStartPoints = InpTrailStartPoints;
params.StopAndReverse = InpStopAndReverse;
params.CloseOnRevesal = InpCloseOnRevesal;
params.StartTrading = InpStart;
params.EndTrading = InpEnd;
params.CloseEOD = InpCloseTradesEOD;
params.MA1Filter = InpMA1Filter;
params.MA1FilterCond = InpMA1FilterCond;
params.MA1FilterCheckBars = InpMA1FilterCheckBars;
params.MA2Filter = InpMA2Filter;
params.MA2FilterCond = InpMA2FilterCond;
params.MA2FilterCheckBars = InpMA2FilterCheckBars;
params.MA3Filter = InpMA3Filter;
params.MA3FilterCond = InpMA3FilterCond;
params.MA3FilterCheckBars = InpMA3FilterCheckBars;
params.SuperTrendFilter = InpSuperTrendFilter;
params.SuperTrendFilterCond = InpMA3FilterCond;
params.SuperTrendFilterCheckBars = InpMA3FilterCheckBars;
params.MagicNumber = InpMagicNumber;
params.DeviationPoints = InpDeviationPoints;
params.NumberOfRetries = InpNumberOfRetries;
params.BusyTimeout_ms = InpBusyTimeout_ms;
params.RequoteTimeout_ms = InpRequoteTimeout_ms;
}

if(!eaLogic.Initialize(params, medianRenko))
Expand Down
Loading

0 comments on commit b7efeff

Please sign in to comment.