-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
128 changed files
with
5,828 additions
and
89 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.