BelkaMiner EA settings

BelkaMiner EA settings

14 February 2020, 18:55
Dmitriy Shal

Complete Settings List of BelkaMiner EA (v1.15 February 2020)

BelkaMiner is a fully automated breakout/momentum/reversal trading system based on Neural Networks and the most well-known clustering algorithm that is used for unsupervised Machine Learning and statistical data analysis (Data Mining).

Live monitoring with Default settings

Set-files MT4/MT5:

What data is stored in the Config file?:

The system can learn how to trade breakout, momentum and reversal strategies by recognizing patterns in historical data

It's highly recommended  to use  a VPS and  low-spread 5-digit broker who closes daily candles at 5 pm New York time.

Such a broker gives five 24-hour daily candles every week.

The default settings of the EA contains a mean reversion strategy that was created using clustering on the EURUSD pair and the M5 timeframe. The Default_EURUSD_M5 settings file will be created automatically after the first run.

Presets for customizing (GMT offset: +2, DST: US/Europe) can be downloaded from the Download page.

MT5 version does not currently support netting mode. I'm working on a virtual position manager for MT5 so that the netting mode will be available soon.

The settings contain many links to be readed

Correct GMT settings for testing my set-files:

It is essential to have the correct GMT settings.


  • SystemMode – operating 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)

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.


  • MaxSpreadPip – if the spread exceeds this value, then the EA will not allow opening a new trade. It works only with a market order, pending orders will not be closed.
  • 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.


  • 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.
  • 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).
  • 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->

      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!

  • 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 ->

Input Data / Metrics

  • UseTradingHours_Measure – use trading hour as a measure. It can be used for Intraday seasonality detection.
  • UseEMA_Measure – daily EMA-based metrics 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_Measure – price 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_Measure – volatility-based metrics calculated by the formula: ATR / ATR(30). It may help in Daily volatility filtering.
  • UseIntradayVolatility_Measure  volatility-based metrics normalized by ATR and calculated by the formula: (Upper PCh level – Lower PCh level ) / ATR. It may help in Intraday volatility filtering.
  • UseHurst_Measure  hurst-based metrics. 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 normalizationMin 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.
  • 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).

Perceptron Settings

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 (classification errors of the unknown data).
  • 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.

Clustering Trading Setup

  • Classifier – method used to classify the cluster number in backtesting and live trading:
     Euclidean Distance - author's method uses the shortest distance to the centroids calculated by the Pythagorean formula. Fast but less accurate method, no NN is used.

    –  Neural Network – train NN to classify the cluster number and save results to the Config file (Existing NN 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.
  • ClusterNumberForOptToBuy(Sell) – parameters to find stable and profitable clusters.
  • ClusterNumber(s)ToBuy(Sell) – cluster numbers to trade, separated by a comma.

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.

Share it with friends: