Skip to content

Commit

Permalink
version 1.04
Browse files Browse the repository at this point in the history
  • Loading branch information
9nix6 committed Apr 28, 2021
1 parent e8189bc commit 4b61a71
Show file tree
Hide file tree
Showing 128 changed files with 5,828 additions and 89 deletions.
Binary file added Experts/2MA_Cross.ex5
Binary file not shown.
416 changes: 416 additions & 0 deletions Experts/2MA_Cross.mq5

Large diffs are not rendered by default.

Binary file added Experts/PriceMA_Cross.ex5
Binary file not shown.
437 changes: 437 additions & 0 deletions Experts/PriceMA_Cross.mq5

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions Include/AZ-INVEST/CustomBarConfig.mqh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//#define DEVELOPER_VERSION
//#define DISPLAY_DEBUG_MSG
#define MQL5_MARKET_VERSION

//#define P_RENKO_BR_PRO
//#define ULTIMATE_RENKO_LICENSE
//#define RANGEBAR_LICENSE
#define SECONDSCHART_LICENSE
//#define TICKCHART_LICENSE (obsolete)
//#define VOLUMECHART_LICENSE
//#define LINEBREAKCHART_LICENSE

#ifdef P_RENKO_BR_PRO
#include <AZ-INVEST/SDK/MedianRenkoIndicator.mqh>
#define AZINVEST_CCI MedianRenkoIndicator
#endif

#ifdef TICKCHART_LICENSE
#include <AZ-INVEST/SDK/TickChartIndicator.mqh>
#define AZINVEST_CCI TickChartIndicator
#endif

#ifdef RANGEBAR_LICENSE
#include <AZ-INVEST/SDK/RangeBarIndicator.mqh>
#define AZINVEST_CCI RangeBarIndicator
#endif

#ifdef ULTIMATE_RENKO_LICENSE
#include <AZ-INVEST/SDK/MedianRenkoIndicator.mqh>
#define AZINVEST_CCI MedianRenkoIndicator
#endif

#ifdef SECONDSCHART_LICENSE
#include <AZ-INVEST/SDK/SecondsChartIndicator.mqh>
#define AZINVEST_CCI SecondsChartIndicator
#endif

#ifdef VOLUMECHART_LICENSE
#include <AZ-INVEST/SDK/VolumeChartIndicator.mqh>
#define AZINVEST_CCI VolumeChartIndicator
#endif

#ifdef LINEBREAKCHART_LICENSE
#include <AZ-INVEST/SDK/LineBreakChartIndicator.mqh>
#define AZINVEST_CCI LineBreakChartIndicator
#endif


#ifdef AZINVEST_CCI
AZINVEST_CCI customChartIndicator;
#endif

Binary file modified Include/AZ-INVEST/SDK/CommonSettings.mqh
Binary file not shown.
Binary file added Include/AZ-INVEST/SDK/CustomChartInputs.mqh
Binary file not shown.
Binary file added Include/AZ-INVEST/SDK/CustomChartInputsBR.mqh
Binary file not shown.
Binary file modified Include/AZ-INVEST/SDK/CustomChartSettingsBase.mqh
Binary file not shown.
53 changes: 53 additions & 0 deletions Include/AZ-INVEST/SDK/Normailze.mqh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// Copyright 2017-2018, Artur Zas
// https://www.az-invest.eu
// https://www.mql5.com/en/users/arturz
//
// Normalizing functions
//

double NormalizeLots(string symbol, double InputLots)
{
double lotsMin = SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN);
double lotsMax = SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX);
// int lotsDigits = (int) - MathLog10(SymbolInfoDouble(symbol, SYMBOL_VOLUME_STEP));
int lotsDigits = (int)MathAbs(MathLog10(SymbolInfoDouble(symbol, SYMBOL_VOLUME_STEP)));

if(InputLots < lotsMin)
InputLots = lotsMin;
if(InputLots > lotsMax)
InputLots = lotsMax;

return NormalizeDouble(InputLots, lotsDigits);
}

double VtcNormalizeLots(string symbol, double lotsToNormalize)
{
double lotsMin = SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN);
double lotsMax = SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX);
double lotsStep = SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP);

if (lotsToNormalize == 0)
return lotsMin;

int a = (int)(lotsToNormalize / lotsStep);
double normalizedLots = a * lotsStep;

if(normalizedLots < lotsMin)
normalizedLots = lotsMin;
if(normalizedLots > lotsMax)
normalizedLots = lotsMax;

return normalizedLots;
}

double NormalizePrice(string symbol, double price, double tick = 0)
{
double _tick = tick ? tick : SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_SIZE);
int _digits = (int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);

if (tick)
return NormalizeDouble(MathRound(price/_tick)*_tick,_digits);
else
return NormalizeDouble(price,_digits);
}
36 changes: 19 additions & 17 deletions Include/AZ-INVEST/SDK/SecondsChart.mqh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#property copyright "Copyright 2018-2020, Level Up Software"
#property link "http://www.az-invest.eu"
#property copyright "Copyright 2018-2021, Level Up Software"
#property link "https://www.az-invest.eu"

#ifdef DEVELOPER_VERSION
#define SECONDS_INDICATOR_NAME "TimeIntervalChart\\SecondsChart101"
#else
#define SECONDS_INDICATOR_NAME "Market\\Seconds timeframe chart"
#ifdef SECONDSCHART_LICENSE
#ifdef MQL5_MARKET_VERSION
#define SECONDS_INDICATOR_NAME "Market\\Seconds timeframe chart"
#else
#define SECONDS_INDICATOR_NAME "SecondsTfChart"
#endif
#else
#define SECONDS_INDICATOR_NAME "Market\\Seconds timeframe chart"
#endif
#endif

//
Expand Down Expand Up @@ -209,49 +217,42 @@ int SecondsChart::Init()
TIMEINTERVALCHART_SETTINGS s = secondsChartSettings.GetTimeIntervalChartSettings();
CHART_INDICATOR_SETTINGS cis = secondsChartSettings.GetChartIndicatorSettings();

secondsChartHandle = iCustom(this.secondsChartSymbol, _Period, SECONDS_INDICATOR_NAME,

secondsChartHandle = iCustom(this.secondsChartSymbol, _Period, SECONDS_INDICATOR_NAME,
s.intervalMultiple,
s.showNumberOfDays, s.resetOpenOnNewTradingDay,
"",
s.showNumberOfDays,
s.resetOpenOnNewTradingDay,
"-",
showPivots,
pivotPointCalculationType,
RColor,
PColor,
SColor,
PDHColor,
PDLColor,
PDCColor,
"-",
AlertMeWhen,
AlertNotificationType,
cis.MA1on,
"-",
cis.MA1lineType,
cis.MA1period,
cis.MA1method,
cis.MA1applyTo,
cis.MA1shift,
cis.MA1priceLabel,
cis.MA2on,
cis.MA2lineType,
cis.MA2period,
cis.MA2method,
cis.MA2applyTo,
cis.MA2shift,
cis.MA2priceLabel,
cis.MA3on,
cis.MA3lineType,
cis.MA3period,
cis.MA3method,
cis.MA3applyTo,
cis.MA3shift,
cis.MA3priceLabel,
cis.MA4on,
cis.MA4lineType,
cis.MA4period,
cis.MA4method,
cis.MA4applyTo,
cis.MA4shift,
cis.MA4priceLabel,
"-",
cis.ShowChannel,
cis.ChannelPeriod,
cis.ChannelAtrPeriod,
Expand All @@ -260,6 +261,7 @@ int SecondsChart::Init()
cis.ChannelBandsDeviations,
cis.ChannelPriceLabel,
cis.ChannelMidPriceLabel,
"-",
true); // used in EA
// --- all remaining settings are left at defaults since they have no impact on the EA ---
// TopBottomPaddingPercentage,
Expand Down
76 changes: 76 additions & 0 deletions Include/AZ-INVEST/SDK/TimeControl.mqh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
//
// Copyright 2018-19, Artur Zas
// https://www.az-invest.eu
// https://www.mql5.com/en/users/arturz
//

class CTimeControl
{
private:

int startHH;
int startMM;
string start;

int endHH;
int endMM;
string end;

bool scheduleEnabled;

public:

void SetValidTraingHours(string _from = "0:00", string _to = "0:00");
bool IsTradingTimeValid();
bool IsScheduleEnabled() { return scheduleEnabled; };
void StringToHHMM(string value, int &HH, int &MM);
};

void CTimeControl::SetValidTraingHours(string _from,string _to)
{
this.start = _from;
this.end = _to;

StringToHHMM(this.start, this.startHH, this.startMM);
StringToHHMM(this.end, this.endHH, this.endMM);

if(this.startHH == 0 && this.startMM == 0 && this.endHH == 0 && this.endMM == 0)
{
scheduleEnabled = false;
}
else
{
scheduleEnabled = true;
}
}

bool CTimeControl::IsTradingTimeValid()
{
if(scheduleEnabled == false)
return true;

datetime now = TimeCurrent();

MqlDateTime temp;
TimeToStruct(now,temp);

datetime _start = StringToTime((string)temp.year+"."+(string)temp.mon+"."+(string)temp.day+" "+this.start);
datetime _end = StringToTime((string)temp.year+"."+(string)temp.mon+"."+(string)temp.day+" "+this.end);

if((now >= _start) && (now <= _end))
return true;
else
return false;
}

void CTimeControl::StringToHHMM(string value, int &HH, int &MM)
{
MqlDateTime temp;
TimeToStruct(TimeCurrent(),temp);

datetime fullDateTime = StringToTime((string)temp.year+"."+(string)temp.mon+"."+(string)temp.day+" "+value);
TimeToStruct(fullDateTime,temp);

HH = temp.hour;
MM = temp.min;
}
Loading

0 comments on commit 4b61a71

Please sign in to comment.