Complete Settings List of BelkaMiner EA (v1.19x May 2020)

The settings contain many links to read


  • SystemModeoperating modes: ‘Machine Learning’ is used for data mining and machine learning, ‘BackTesting & Trading’ is used for backtesting, researching and live trading.

Money Management

  • LotSize – fixed lot size for trading if UseMargin% and Balance are set to 0.
  • Balance – proportional lot size calculated by the formula: LotSize * AccountBalance/Balance. It works together with LotSize. This MM proportionally increases (decreases) lot sizes when the account balance increases (decreases), respectively. The smaller the value, the higher the risk. In case of non-zero value, the EA calculates lot sizes based on the account balance, e.g., 0.05 lots for every $1000. If ‘Balance‘ set to a negative value, then the EA calculates lot sizes based on the account equity.
  • MaxRiskPerTrade% – maximum risk (as a percentage of the account balance) per trade based on the initial StopLoss value. If MaxRiskPerTrade%=0, the EA will use LotSize or UseMargin%.
  • MaxLot_Overall – maximum lot size that the EA can use for trading.


  • AutoGMT_Detection – if true, the EA will automatically detect your broker’s time zone in live trading. To use this feature, you must allow requests to: (backup URL to determine GMT offset)

    BelkaMiner EA
    BelkaMiner EA

    GMT[m] – GMT has been calculated manually, GMT[a] – GMT has been detected automatically.
    +3 – current GMT offset (DST is taken into account), [NY] – NY Close Broker.

  • NYCloseBroker – set this parameter to false if your broker’s server time is not set to New York Сlose. If you use a NY close broker (who closes daily candles at 5 pm New York time, that corresponds to GMT+2 in winter and GMT+3 in summer), then no need to change the default settings.
  • GMT_offset – GMT offset of your broker in winter. This parameter should be configured only if NYCloseBroker=false.
  • Daylight_Saving_Time – set this parameter to US/Europe if your broker changes the GMT offset in the summer period. This parameter should be configured only if NYCloseBroker=false.


  • EventHandling – how often to handle events: Once a minute (default, recommended) or Every tick (this may use too much CPU resources).
  • MaxSpreadPip – if the spread exceeds this value, then the EA will not allow opening a new trade.  It only works with market orders, pending orders will not be affected.
  • MaxSpreadToExitPip – if the spread is above this value, then the EA will not allow closing an open trade.
  • MaxSlippagePip – parameter allows you to specify the maximum slippage (as a max. deviation from the quoted price) for a market order. It works only with Instant Execution (for example, standard, classic, micro, and nano accounts). This parameter has no effect on an ECN account. If MaxSlippagePip > 0, the EA will control slippage using the maximum deviation from the ask/bid price. If a broker is unable to fill an order within a specified deviation, then the order will be rejected.

News Filter

  • UseTailFilter – allows you to automatically switch trading off together with me before/during rare and irregular high impact news (such as Brexit, elections, etc.) to protect portfolios at the times of tail risk events. The tail risk events may bring tail risk and damage or ruin portfolios. You should allow requests to
  • UseNewsFilter – enable/disable the News filter. To use it in live trading, you should allow requests to:
    (backup URL to determine GMT offset)

    Tools -> Options -> Expert Advisors -> Allow WebRequests for listed URL.
    Allow WebRequests Belkaglazer EA Metatrader
    To use it on backtest, you should download News events database and extract ‘BelkaEventsData‘ to ‘\Common\Files‘ folder (File -> Open Data Folder -> Up to ‘Terminal’ -> Common -> Files).

    Belkaglazer MT4
  • DataProvider – select the provider whose data you want to use.
  • Symbols – symbols to download news events (separated by a commafor example. EUR,USD,GBP). If this parameter is empty, the EA will use the current symbols. If ‘Symbols‘ is set to ALL, then all possible symbols will be used.
  • FilterEvents – allows you to select news events based on their impact level: HIGH, MOD, LOW, SPEECH. If set to ‘Custom‘, then the EA will use FilterCustomEvents parameter.
  • FilterCustomEvents – news events or keywords separated by a comma, the letter case (lower, higher) does not matter. For example: FOMC,rate,job,HIGH,MOD. If empty, the EA will use all news events. For example, if FilterCustomEvents=rate, the EA will use news events whose titles contain ‘rate.
  • FilteringActionaction to be performed: Ignore new & close exist. trades, Ignore new signals, Close existing trades, No action.
  • BeforeEventMin – number of minutes before a news release when trading will be disabled.
  • AfterEventMin – number of minutes after a news release when trading will be enabled.
  • DisplayEvents – show news events on the chart.
  • CBOE_VIX_Filter – allows you to use the ‘CBOE Volatility Index‘ as a crash filter. The CBOE Volatility Index, known by its ticker symbol VIX, is a popular measure of the stock market’s expectation of volatility implied by S&P 500 index options. This filter can help switch trading off during the global financial crisis, such as the crash of 2008 or 1987. If the VIX Close exceeds the specified value, then the EA will not allow opening a new trade all day. I recommend using a value of 30 or higher for MR strategies. It is better not to use it with M strategies because they work well in a volatile market.
    Belkaglazer CBOE VIX Filter Chart
    An example of using VIX as a crash filter (clickable)

    To use it on backtest, you should download News events database and extract ‘BelkaEventsData‘ to ‘\Common\Files‘ folder (File -> Open Data Folder -> Up to ‘Terminal’ -> Common -> Files). To use the CBOE_VIX_Filter in live trading, you should allow requests to: (backup URL) (backup URL)


  • OrderHourStart/Stop – hour when the EA should start/stop looking for trading signals.
  • OrderDayOfWeek – day(s) of the week when the EA is allowed to open a new trade.
  • DaysOffBeforeAfterNY – a trading pause which is activated before/after the New Year for a specified number of days. For example, if DaysOffBeforeAfterNY=3, then the EA will not open new trades from December 29 to January 3.

Basic Entry Rules

  • StrategyType – a type of ‘White-box’ algorithm. The algorithm is based on boolean logic, open and clear rules. It is used to generate entry points and gives many trades with a low average trade. It must have a ‘trading edge’ that may be too small to cover trading costs. The edge can only be seen after the spread/commission is turned off or set to a minimum value.
    Reversal (PCh) is a mean reversion strategy that uses reversals between support and resistance levels.
    Breakout (PCh) is a breakout strategy that enters the market when the price moves outside a defined price range (support and resistance levels).
    Momentum (PA) is a momentum strategy that uses significant price movements in one direction.
  • AllowExtraTrades – maximum number of additional trades that can be opened if the EA gets a new trading signal, and there are open positions.
  • ExtraTradesPause – minimum pause in bars between the additional trades.
  • DailyATR_Period – period of DailyATR. It is used to normalize the volatility.
  • PCh_Type –  methods used for calculating the Price Channel:
    Donchian Channel is formed by taking the highest high and the lowest low of the last n periods. The area between the high and the low is the channel for the period chosen.
    Bollinger Bands – is based on two standard deviations away from a simple moving average.
  • PCh_Period – a period of the Price Channel.
  • PCh_OffsetPip – offset of the Price Channel levels.
  • PA_Bars – number of bars to analyze price movement (for Momentum strategy).
  • PA_Size%ATR – minimal size (in %ATR) of price movement (for Momentum strategy).

Basic Exit Rules

  • StopLoss, TakeProfit – stop loss and take profit. They can be expressed in pips (in case of value > 3) or %ATR (in case of 0 < value <3). If value = 0, the EA places SL(TP) in the middle of the price range (HL/2 level).
  • StopBar – time-based stop loss that automatically closes trades after a certain number of bars, regardless of other conditions (0 = off).
  • StopHour – time-based stop loss that automatically closes trades at a specified hour, regardless of other conditions (disabled if >23). It allows you to limit the maximum position holding time.
  • FridayStopHour – hour to close trades on Friday (-1 = off).
  • TrailingStopPip – in case of value > 0: trailing stop in pips when a position is in profit, in case of value < 0: minimum profit level in pips when SL should be moved to breakeven (0 = off).
  • TrailingActivationPip – determines the number of pips to activate ‘TrailingStopPip‘.

Machine Learning

  • Use_Machine_Learning – enable/disable ML in backtesting and live trading. If disabled, the EA will only use rules of the basic strategy.
  • Machine_Learning_Technique – ML techniques:
    Clustering (Unsupervised) – the EA groups a set of entry points (dataset) in such a way that points in the same group (called a cluster) are more similar to each other than to those in other groups (clusters). Then we test each cluster and try to find profitable ones with good performance. We assume the points in the profitable clusters have certain properties that make them profitable. Clustering is a main task of exploratory data mining, and a common technique for statistical data analysis, used in many fields.
    Unsupervised learning is a type of self-organized Hebbian learning that helps find previously unknown patterns in data set without pre-existing labels. Read more about Unsupervised Learning->
    Belkaglazer EA
    Belkaglazer EA
    Neural Network (Supervised) – the EA trains perceptron using raw data without clustering. Supervised learning is the machine learning task of learning a function that maps an input to an output based on example input-output pairs. Read more about Supervised Learning->
    This method is less robust and brings extreme risk of over-fitting!

BelkaMiner EA

  • ConfigFile – configuration file containing the results of clustering and machine learning. It is located in the ‘Common\Files‘ directory. The default config file (for the default strategy) is created after the first launch of the EA. Read more ->
  • WhatToSave – data to be saved in the Config file:
    DoNotSavePoints – the EA will only save mean, stdev and coordinates of centroids. Fast, but NN (Neural Network) training (to classify the cluster number) is not possible in the future.
    SavePointsOnly – the EA will save mean, stdev, coordinates of centroids and points with cluster numbers. Fast, NN can be trained later.
    SavePoints & TrainPerceptron – the EA will save everything and train NN. This may take a long time (hours or even days, it depends on the settings, MT5 works much faster).
  • DatasetMaxSizemaximum dataset size.

Input Variables / Metrics

  • UseTradingHours_Measure – use trading hour as an attribute. It can be used for Intraday seasonality detection.
  • UseEMA_Measure – daily EMA-based metric normalized by ATR and calculated by the formula: (Close-EMA(n)) / ATR(m). It can be used for trend detection.
  • EMA_Period – perion of the daily EMA.
  • UseMomentum_Measureprice movement before the entry point normalized by ATR. It may help figure out how the market reacts to certain price movements.
  • Momentum_Bars – number of bars to calculate the price movement.
  • UseDailyVolatility_Measurevolatility-based metric calculated by the formula: ATR / ATR(30). It may help in Daily volatility filtering.
  • UseIntradayVolatility_Measure volatility-based metric normalized by ATR and calculated by the formula: (Upper PCh level – Lower PCh level ) / ATR. It may help in Intraday volatility filtering.
  • UseHurst_Measurehurst-based metric. It is used as a measure of memory (M/MR regime).
  • Hurst_Bars – number of bars to calculate Hurst exponent.

Clustering settings

  • ClusteringMethod – method used for clustering:
    K-means++ is one of the simplest and popular unsupervised machine learning algorithms with choosing the initial values.
  • NumberOfClusters – desired number of clusters for k-means clustering. 30….50 is recommended. The optimal number depends on the dataset size (number of points/vectors).
  • NumberOfRestarts – max. number of restarts to find a good / the global optimum. Try to reduce it if clustering takes too long.
  • OutlierDataPercentile – parameter for calculating 2 percentiles (min & max) to filter outliers before normalization. Min percentile = OutlierDataPercentile, Max percentile = 100-OutlierDataPercentile.
  • NormalizationMethod – adjusting values measured on different scales to a notionally common scale:
    Z-Score uses mean and standard deviation. It is calculated as: z = (x-mean) / stdev.

Perceptron Settings

BelkaMiner EA
Multilayer perceptron
  • NeuronInHiddenLayer – number of neurons in the hidden layer. If zero, then no hidden layer will be used. Do not use hidden layers unless required. They may reduce the learning speed and lead to over-training (misclassification error).
  • TrainingAlgorithm – training algorithm:
    Levenberg–Marquardt algorithm (LMA or just LM), also known as the Damped least-squares (DLS) method, is used to solve non-linear least squares problems.
    L-BFGS is an optimization algorithm in the family of quasi-Newton methods that approximates the Broyden–Fletcher–Goldfarb–Shanno algorithm (BFGS) using a limited amount of computer memory. It is a popular algorithm for parameter estimation in machine learning.
  • NumberOfRestarts – max. number of restarts to find a good optimum. Try to reduce it if learning takes too long.

Common Setup

  • Classifier – method used to classify the cluster number in backtesting and live trading:
    Euclidean Distanceauthor’s method that uses the shortest distance to the centroids calculated by the Pythagorean formula. Fast but less accurate method, no NN is used. This method is very useful with small datasets where NN cannot achieve high accuracy.

    Neural Network – train NN to classify the cluster number and save results to the Config file (existing NNs will be overwritten!). This may take a long time (hours or even days, it depends on the settings, MT5 works much faster).
    Saved Neural Network uses NN saved in the Config file. Fast if NN is saved, if not – the EA will train NN and save results to the Config file.

Cluster Trading Setup

  • MeanInsteadOfValue – metric number to replace its values with the mean (mean is ‘zero’ after normalization). It helps to find out if a profitable cluster uses the metric.
  • ClusterNumberForOptToBuy(Sell) – parameters to find stable and profitable clusters.
  • ClusterNumber(s)ToBuy(Sell) – cluster numbers to trade, separated by a comma.

Neural Network Trading Setup

  • ProbabilityOfProfit% – minimal predicted probability that a trade will result in profit (chance of making at least $0.01 on a trade). If perceptron predicts a value lower than specified, the trading signal will be ignored and the trade will not be opened.
  • MinimumProfit% – minimum profit level, calculated as % of the average profitable trade, to mark a trade as profitable in the output data for training the perceptron.

Order setting

  • UserComment – user comment used to label orders opened by the EA.
  • MagicNumber – a unique basic identifier of EA’s orders. This number should be less than 99999.
  • Graphics – this option allows you to enable/disable graphic objects of the EA on a chart.