Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a73e2c0713 | |||
| 3175f594f1 | |||
| 5327473eaf | |||
| 8035947476 | |||
| acba19e38f | |||
| 0d51499dcf |
@@ -26,13 +26,18 @@ input int InpRSIPeriod = 14; // RSI period
|
||||
// Example shown below
|
||||
//
|
||||
|
||||
RangeBars rangeBars(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
|
||||
RangeBars *rangeBars = NULL;
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Expert initialization function |
|
||||
//+------------------------------------------------------------------+
|
||||
int OnInit()
|
||||
{
|
||||
if(rangeBars == NULL)
|
||||
{
|
||||
rangeBars = new RangeBars(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
|
||||
}
|
||||
|
||||
rangeBars.Init();
|
||||
if(rangeBars.GetHandle() == INVALID_HANDLE)
|
||||
return(INIT_FAILED);
|
||||
@@ -48,7 +53,12 @@ int OnInit()
|
||||
//+------------------------------------------------------------------+
|
||||
void OnDeinit(const int reason)
|
||||
{
|
||||
rangeBars.Deinit();
|
||||
if(rangeBars != NULL)
|
||||
{
|
||||
rangeBars.Deinit();
|
||||
delete rangeBars;
|
||||
rangeBars = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// your custom code goes here...
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
// Helper functions for placing market orders.
|
||||
//
|
||||
|
||||
#define DEVELOPER_VERSION
|
||||
#include <AZ-INVEST/SDK/TradeFunctions.mqh>
|
||||
|
||||
//
|
||||
@@ -52,14 +53,19 @@ ulong currentTicket;
|
||||
// Example shown below
|
||||
//
|
||||
|
||||
RangeBars rangeBars(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
|
||||
CMarketOrder * marketOrder;
|
||||
RangeBars *rangeBars = NULL;
|
||||
CMarketOrder *marketOrder = NULL;
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Expert initialization function |
|
||||
//+------------------------------------------------------------------+
|
||||
int OnInit()
|
||||
{
|
||||
if(rangeBars == NULL)
|
||||
{
|
||||
rangeBars = new RangeBars(MQLInfoInteger((int)MQL5_TESTING) ? false : true);
|
||||
}
|
||||
|
||||
rangeBars.Init();
|
||||
if(rangeBars.GetHandle() == INVALID_HANDLE)
|
||||
return(INIT_FAILED);
|
||||
@@ -79,8 +85,12 @@ int OnInit()
|
||||
params.busyTimeout_ms = InpBusyTimeout_ms;
|
||||
params.requoteTimeout_ms = InpRequoteTimeout_ms;
|
||||
}
|
||||
marketOrder = new CMarketOrder(params);
|
||||
|
||||
|
||||
if(marketOrder == NULL)
|
||||
{
|
||||
marketOrder = new CMarketOrder(params);
|
||||
}
|
||||
|
||||
return(INIT_SUCCEEDED);
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -88,7 +98,16 @@ int OnInit()
|
||||
//+------------------------------------------------------------------+
|
||||
void OnDeinit(const int reason)
|
||||
{
|
||||
rangeBars.Deinit();
|
||||
//
|
||||
// delete RanegBars class
|
||||
//
|
||||
|
||||
if(rangeBars != NULL)
|
||||
{
|
||||
rangeBars.Deinit();
|
||||
delete rangeBars;
|
||||
rangeBars = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// delete MarketOrder class
|
||||
@@ -97,6 +116,7 @@ void OnDeinit(const int reason)
|
||||
if(marketOrder != NULL)
|
||||
{
|
||||
delete marketOrder;
|
||||
marketOrder = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,8 @@ 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) - MathLog10(SymbolInfoDouble(symbol, SYMBOL_VOLUME_STEP));
|
||||
int lotsDigits = (int)MathAbs(MathLog10(SymbolInfoDouble(symbol, SYMBOL_VOLUME_STEP)));
|
||||
|
||||
if(InputLots < lotsMin)
|
||||
InputLots = lotsMin;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifdef SHOW_INDICATOR_INPUTS
|
||||
#ifdef MQL5_MARKET_DEMO // hardcoded values
|
||||
|
||||
int barSizeInTicks = 180; // Range bar size (in points)
|
||||
int barSizeInTicks = 180; // Range bar size (in ticks)
|
||||
ENUM_BOOL atrEnabled = false; // Enable ATR based bar size calculation
|
||||
ENUM_TIMEFRAMES atrTimeFrame = PERIOD_D1; // Use ATR period
|
||||
int atrPeriod = 14; // ATR period
|
||||
@@ -23,7 +23,7 @@
|
||||
#else // user defined settings
|
||||
|
||||
|
||||
input int barSizeInTicks = 100; // Range bar size (in points)
|
||||
input int barSizeInTicks = 100; // Range bar size (in ticks)
|
||||
input ENUM_BOOL atrEnabled = false; // Enable ATR based bar size calculation
|
||||
ENUM_TIMEFRAMES atrTimeFrame = PERIOD_D1; // Use ATR period
|
||||
input int atrPeriod = 14; // ATR period
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#endif
|
||||
#else // don't SHOW_INDICATOR_INPUTS
|
||||
int barSizeInTicks = 180; // Range bar size (in points)
|
||||
int barSizeInTicks = 180; // Range bar size (in ticks)
|
||||
ENUM_BOOL atrEnabled = false; // Enable ATR based bar size calculation
|
||||
ENUM_TIMEFRAMES atrTimeFrame = PERIOD_D1; // Use ATR period
|
||||
int atrPeriod = 14; // ATR period
|
||||
|
||||
@@ -194,7 +194,6 @@ int RangeBars::Init()
|
||||
s.atrPercentage,
|
||||
s.showNumberOfDays, s.resetOpenOnNewTradingDay,
|
||||
TradingSessionTime,
|
||||
TopBottomPaddingPercentage,
|
||||
showPivots,
|
||||
pivotPointCalculationType,
|
||||
RColor,
|
||||
@@ -203,11 +202,8 @@ int RangeBars::Init()
|
||||
PDHColor,
|
||||
PDLColor,
|
||||
PDCColor,
|
||||
showCurrentBarOpenTime,
|
||||
AlertMeWhen,
|
||||
AlertNotificationType,
|
||||
SoundFileBull,
|
||||
SoundFileBear,
|
||||
cis.MA1on,
|
||||
cis.MA1lineType,
|
||||
cis.MA1period,
|
||||
@@ -245,7 +241,12 @@ int RangeBars::Init()
|
||||
cis.ChannelPriceLabel,
|
||||
cis.ChannelMidPriceLabel,
|
||||
true); // used in EA
|
||||
// DisplayAsBarChart & ShiftObj let at defaults
|
||||
// TopBottomPaddingPercentage,
|
||||
// showCurrentBarOpenTime,
|
||||
// SoundFileBull,
|
||||
// SoundFileBear,
|
||||
// DisplayAsBarChart
|
||||
// ShiftObj; all letft at defaults
|
||||
|
||||
if(rangeBarsHandle == INVALID_HANDLE)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#property copyright "2009-2017, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property description "Average True Range"
|
||||
#property description "Adapted for use with TickChart by Artur Zas."
|
||||
//--- indicator settings
|
||||
#property indicator_separate_window
|
||||
#property indicator_buffers 2
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#property copyright "2009, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property description "Commodity Channel Index"
|
||||
#property description "Adapted for use with TickChart by Artur Zas."
|
||||
#include <MovingAverages.mqh>
|
||||
//---
|
||||
#property indicator_separate_window
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#property copyright "2009-2017, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property description "Ichimoku Kinko Hyo"
|
||||
#property description "Adapted for use with TickChart by Artur Zas."
|
||||
//--- indicator settings
|
||||
#property indicator_chart_window
|
||||
#property indicator_buffers 5
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "2009-2017, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property description "Adapted for use with TickChart by Artur Zas."
|
||||
//--- indicator settings
|
||||
#property indicator_chart_window
|
||||
#property indicator_buffers 3
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "2009, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property description "Adapted for use with TickChart by Artur Zas."
|
||||
//--- indicator settings
|
||||
#property indicator_separate_window
|
||||
#property indicator_buffers 4
|
||||
|
||||
@@ -19,7 +19,7 @@ enum ENUM_DISPLAY_FORMAT
|
||||
DisplayFormat2, // 25.01 10:55
|
||||
};
|
||||
|
||||
input color InpTextColor = clrWhiteSmoke; // Font color
|
||||
input color InpTextColor = clrBlack; // Font color
|
||||
input int InpFontSize = 9; // Font size
|
||||
input int InpSpacing = 3; // Date/Time spacing factor
|
||||
input ENUM_DISPLAY_FORMAT InpDispFormat = DisplayFormat1; // Display format
|
||||
@@ -161,6 +161,9 @@ string NormalizeTime(datetime _dt)
|
||||
string minute = (dt.min<10) ? ("0"+(string)dt.min) : (string)dt.min;
|
||||
string hour = (dt.hour<10) ? ("0"+(string)dt.hour) : (string)dt.hour;
|
||||
|
||||
if((dt.mon-1) < 0 || (dt.mon-1) > 11)
|
||||
return "*";
|
||||
|
||||
if(InpDispFormat == DisplayFormat1)
|
||||
return ( "'"+(string)dt.day+" "+__months[dt.mon-1]+" "+hour+":"+minute );
|
||||
else
|
||||
|
||||
@@ -22,3 +22,8 @@ All folders (Experts, Include & Indicators) & sub-folders should be placed in th
|
||||
The RangeBars indicator for MT5 can be downloaded from https://www.mql5.com/en/market/product/16762
|
||||
|
||||
A version for MT4 is available from https://www.az-invest.eu/rangebars-plug-in-for-metatrader4
|
||||
|
||||
## Disclaimer:
|
||||
|
||||
All of the EAs and indicators presented in this repository are solely for educational and informational purposes and should not be regarded as advice or an invitation to trade.
|
||||
Application of the techniques, ideas, and suggestions presented in the videos and files of this repository is done at the user’s sole discretion and risk.
|
||||
|
||||
Reference in New Issue
Block a user