• Overview
  • Reviews
  • Comments (18)
  • What's new

WalkForwardOptimizer

WalkForwardOptimizer library allows you to perform rolling and cluster walk-forward optimization of expert advisers (EA) in MetaTrader 4.

To use the library include its header file WalkForwardOptimizer.mqh into your EA source code, add call provided functions as appropriate.

Once the library is embedded into EA, you may start optimization according to the procedure described in the User guide. When it's finished, intermediate results are saved into a csv-file and some special global variables. Then you can view and analyse the results by means of accompanying script WalkForwardReporter, which generates comprehensible reports as html-pages. The script is free.


Header file WalkForwardOptimizer.mqh

#define DAYS_PER_WEEK    7
#define DAYS_PER_MONTH   30
#define DAYS_PER_QUARTER (DAYS_PER_MONTH*3)
#define DAYS_PER_HALF    (DAYS_PER_MONTH*6)
#define DAYS_PER_YEAR    (DAYS_PER_MONTH*12)

#define SEC_PER_DAY     (60*60*24)
#define SEC_PER_WEEK    (SEC_PER_DAY*DAYS_PER_WEEK)
#define SEC_PER_MONTH   (SEC_PER_DAY*DAYS_PER_MONTH)
#define SEC_PER_QUARTER (SEC_PER_MONTH*3)
#define SEC_PER_HALF    (SEC_PER_MONTH*6)
#define SEC_PER_YEAR    (SEC_PER_MONTH*12)

#define CUSTOM_DAYS     -1

enum WFO_TIME_PERIOD {none = 0, year = DAYS_PER_YEAR, halfyear = DAYS_PER_HALF, quarter = DAYS_PER_QUARTER, month = DAYS_PER_MONTH, week = DAYS_PER_WEEK, day = 1, custom = CUSTOM_DAYS};

enum WFO_ESTIMATION_METHOD {wfo_built_in_loose, wfo_built_in_strict, wfo_profit, wfo_sharpe, wfo_pf, wfo_drawdown, wfo_profit_by_drawdown, wfo_profit_trades_by_drawdown, wfo_average, wfo_expression};

extern WFO_TIME_PERIOD wfo_windowSize = year;
extern int wfo_customWindowSizeDays = 0;
extern WFO_TIME_PERIOD wfo_stepSize = quarter;
extern int wfo_customStepSizePercent = 0;
extern int wfo_stepOffset = 0;
extern string wfo_outputFile = "";
extern WFO_ESTIMATION_METHOD wfo_estimation = wfo_built_in_loose;
extern string wfo_formula = "";

#import "WalkForwardOptimizer.ex4"
void wfo_setEstimationMethod(WFO_ESTIMATION_METHOD estimation, string formula);
void wfo_setHeader(string s);
void wfo_setPFmax(double max);
void wfo_setGVAutomaticCleanup(bool b);
void wfo_setCleanUpTimeout(int seconds);
int wfo_OnInit(WFO_TIME_PERIOD optimizeOn, WFO_TIME_PERIOD optimizeStep, int optimizeStepOffset, int optimizeCustomW, int optimizeCustomS, string optimizeLog);
int wfo_OnTick();
double wfo_OnTester(string payload = "");
void wfo_setCloseTradesOnSeparationLine(bool b);
#import


Example of usage in your source code

#include <WalkForwardOptimizer.mqh>

...

int OnInit()
{
  ...

  wfo_setEstimationMethod(wfo_estimation,wfo_formula); // wfo_built_in_loose by default
  wfo_setHeader("EnvelopeRange,EnvelopeLength"); // "Payload" by default
  wfo_setPFmax(100); // DBL_MAX by default
  
  // can be set to true, only if genetics not used
  // wfo_setGVAutomaticCleanup(true); // false by default
  
  // wfo_setCloseTradesOnSeparationLine(true); // false by default

  // this is the only required call in OnInit, all parameters come from the header
  int r = wfo_OnInit(wfo_windowSize, wfo_stepSize, wfo_stepOffset, wfo_customWindowSizeDays, wfo_customStepSizePercent, wfo_outputFile);
  
  return(r);
}

double OnTester()
{
  // the passed string with optimizable work parameters of EA should match specified header in wfo_setHeader
  // the parameter is optional, you may have EA without parameters
  // the call to wfo_OnTester is required
  return wfo_OnTester(DoubleToStr(EnvelopeRange, 1) + "," + IntegerToString(EnvelopeLength));
}

void OnTick()
{
  int wfo = wfo_OnTick(); // required in OnTick
  if(wfo == -1) // this tick is before optimization window
  {
    return;
  }
  else if(wfo == +1) // this tick is after optimization window and forward test
  {
    return;
  }
  
  ...
  // your actual code goes here
}



Recommended products
Automatic Equity Manager
Automatic Equity Manager
Jaroslav Rajcher
Description: Automatic Equity Manager EA manages the whole account equity. You need to set it up on its own chart. Parameters: EquityGainPercent = 3 (This automatically closes all trades when your equity shows a gain of X percent.) Author: Happy Forex (Expert Advisor - your algorithm-driven profit, without stress or work)
FREE
Formula Calculation
Formula Calculation
Dmitry Fedoseev
Библиотека для расчета формул. Формула задается строкой. Можно задавать формулу в строковой переменой в окне свойств. Формула может включать арифметические действия "+-/*" и все функции кроме MathRand(): abs(), arccos(), arcsin(), arctan(), sin(), cos(), tan(), exp(), log(), mod(), max(), min(), pow(), ceil(), sqrt(), log10(), floor(), round(). Кроме этого в формулу могут входить числа (если число дробные, то разделитель точка) и аргументы. Аргумент начинается с буквы "а" (латинская) и номера, н
FREE
OHLC LINE
OHLC LINE
Aida Chavez
This indicator displays Open, High, Low and Close prices of the chosen period (day, month, week, year) on the chart. The lines are accompanied by the time periods they belong to. The lines are drawn on all the candles since the initial date (INITIAL DATE). You can use this indicator to draw support and resistance levels. PERIOD - the time of the candle you want to analyze INITIAL DATE - the date you want to plot the lines from OPEN - set to TRUE if you want to plot the Open price of the selec
FREE
Key Values
Key Values
Cuong Truong
The indicator displays the high and low of a channel for a possible price action breakout. Also, it displays the distance in points inside a channel's range. If the price is above the blue channel line, there is a possible breakout to the upside. Price might continue to trend up. If the price is below the pink channel line, there is a possible breakdown to the downside. Price might continue to trend down. Settings #0: Default setting for the upper channel line is PowerBlue color #1: Default se
FREE
Candle Trap EA
Candle Trap EA
David Binka Kumatse
This EA is built to work using a combination of some indicators together with price action. It makes use of some special candle sequence to enter trades. The strategy exhibits  scalping  tendency and  hedging  characteristics for recovery. If a signal is generated the expert places buy/sell orders with its corresponding hedge order at some calculated distance(pips) away. If signal works as expected, the EA takes profit intelligently by closing these orders at some minimum Profit(automatic). If h
FREE
Projected Volatility Distribution Free
Projected Volatility Distribution Free
Tsvetan Tsvetanov
This indicator is using the Central Limit Theorem in combination with historical volatility and Fibonacci ratios in order to create unique type of chart tool called Projected Volatility Distribution. This tool allows you to perform highly accurate intraday technical analysis where in a split second you can detect overbought and oversold conditions as well as strong trends. In addition you have at your disposal multi-functional panel which shows signals in real time and gives you the ability to o
FREE
Find and fill Gaps
Find and fill Gaps
Leandro Oliveira
This indicator shows the gaps on the current chart with a rectangle shape and indicates when the gap is filled by closing the shape. Gaps are considered over the shadows. Allows sending alerts by e-mail or push notifications when a gap is found. Parameters SizeGAP - Size of the gap that you want to indicate; HGcolor1 - Color of the gap in an upward movement; HGcolor2 - Color of the gap in a downward movement; HGstyle - The style of rectangle to be drawn; StartCalculationFromBar - How many cand
120 USD
North East Way EA
North East Way EA
PAVEL UDOVICHENKO
ONLY 7 COPIES OUT OF 10 LEFT AT $4274 ! After that, the price will be raised to $5342. My channel:   https://t.me/new_signals My contact:  https://t.me/ PAVELUDO North East Way EA  it is a fully automated “pullback” trading system, which is especially effective in trading on popular “ pullback ” currency pairs: AUDCAD, AUDNZD, NZDCAD. The system uses the main patterns of the Forex market in trading - the return of the price after a sharp movement in any direction. Timeframe: M15 Base currenc
4 273 USD
MT4 Telegram Signal
MT4 Telegram Signal
Ugur Oezcan
!!! New faeture sending Signals as VIP SMS with ASPSMS.COM !!! New faeture sending Signals as VIP EMAILS MT4 Telegram Signal is tool, which sends selected trades via magic number to telegram channel, sms and email to user. Tool sends trades when open and close with chart to telegram chanel. It also sends every modification from trades to telegram. Tool can send multiple charts and magic numbers and pairs from a single chart. For this you have to fill in on the chart corresponding magic number
FREE
Volume Volatility Dashboard Multi Analyzer
Volume Volatility Dashboard Multi Analyzer
Dominik Mandok
Volume Volatility Dashboard is a great tool for quickest possible analysis of multiple currency pairs in terms of extremely high and extremely low accumulation to distribution ratio in comparison to values from past. The number of displayed symbols is 30 and the name of each symbol can be edited in the parameters, so we are able to analyze not only predetermined currency pairs, but also other ones, commodities, equities, indices, currency pairs with prefixes and suffixes etc... This analyzer is
19 USD
Wsslib MT4
Wsslib MT4
Soewono Effendi
You can now easily provide WEBSOCKET connection to javascript to your MT terminal. An   easy to use   websocket   server   library for MQL4. It supports: ws:// and wss:// (secure websocket) text and binary data automatic ping-pong handling on protocol level (keep-alive protocol hand shake) automatic fragmented message handling on protocol level (large data transfer enabled) ================================================== ATTENTION:  PLEASE CONTACT SELLER BEFORE PURCHASE. Due to the nat
50 USD
Real Trader
Real Trader
Taofeek Bello
It is an Expert Advisor that contains six different trend following strategies. Every Strategy always sets stop loss and Profit target for every trades . It also employs profit trailing for every trades. Recommendation Pair - EURUSD . Timeframe - 1 hour . Features It does not use: Grid Martingale Hedging Arbitrage Requirement VPS that is available 24/7 Four (4) and Five (5) digit brokers Minimum initial Balance - $50 Settings UseStrategyA .. I - if   set true , signal of strategy A...I i
1 800 USD
Line Break Indicator
Line Break Indicator
Oliver Gideon Amofa Appiah
LINE BREAK INDICATOR This is a semi-automatic indicator that shows buy and sell arrows when your trendline (or horizontal line) is broken. You must first draw your lines, it will alert you of breaks through email, pop-ups, etc. It is important that you use just two main lines to avoid confusion, because the indicator signals BUY when the upper trendline or upper horizontal line is broken, and it signals SELL when the lower trendline or lower horizontal line is broken. It can be used for any curr
30 USD
KT Renko Live Chart MT4
KT Renko Live Chart MT4
KEENBASE SOFTWARE SOLUTIONS
KT Renko Live Chart utility creates the Renko charts on MT4 that can be further used for speculation or live trading. The Renko chart created by this utility supports most of the custom indicators and automated Expert Advisors. Fully compatible with our Renko Patterns indicator and Renko Patterns EA . To use an Expert Advisor on the generated Renko chart, make sure to untick the "Offline Chart" in the chart properties.  Features A simple and straightforward Renko utility that provides the Ren
FREE
Dashboard Bollinger Bands Mt4
Dashboard Bollinger Bands Mt4
Mikhail Mitin
Great dashboard for market analytics. The panel helps to analyze the values of the   Bollinger Bands   indicator and prices. Using this panel you can: watch the current signal from Bollinger Bands for all time frames; watch the current signal from Bollinger Bands by different symbols; look at how far Bollinger Bands is from the price; look at how much the value of Bollinger Bands has changed; several types of signals for analytics. Values in the table cell (switched by the button on the gra
10 USD
PH Chikou Filter Vs Kumo Histo
PH Chikou Filter Vs Kumo Histo
Philippe Houy
This Histo indicator compares the Chikou Span to Ichimoku Kumo. When Histogram is Green the Chikou Span is above the Kumo. When Histogram is Red the Chikou Span is below the Kumo. When Histogram is Blue the Chikou Span is Inside the Kumo. We can,also Filter the excess of Chikou Span (Price)with: Chikou Applied Chikou Period Chikou Mode Defaults: ChikouApplied = 0 (Close) Chikouperiod = 1 ChikoouMode =0
35 USD
MA Momentum Arrows
MA Momentum Arrows
Martin Eshleman
Summary This indicator is based on the MA applied to the Momentum indicator. It draws arrows at the confirmed crosses of the MA over the Momentum line. When the MA crosses upwards, then a buy arrow is displayed and vice versa. The arrows do not repaint since the indicator only uses confirmed values and waits for the candle to close before painting an arrow. The indicator is also able to alert when arrows appear. There are 3 types of alerts - Popup, Email and Mobile Push Notifications. Inputs A
FREE
PZ Pyramid EA
PZ Pyramid EA
PZ TRADING SLU
Pyramiding is a method of increasing a position size by using unrealized profits from successful trades as margin for new ones. This Expert Advisor will pyramid your trades without your intervention. [ Installation Guide | Update Guide | Troubleshooting | FAQ | All Products ] Pyramid your successful trades easily Make the most out of your winning trades Fully configurable pyramiding behavior Pyramiding is timeframe independent Works for ECN/Non-ECN brokers and 2-3-4-5 digits Takes random trades
FREE
Multi Positions Analyzer and Closer MT4
Multi Positions Analyzer and Closer MT4
Evgeny Dyuka
Analysis and management of a large number of open positions . Cumulative take, stop, trailing stop and many other closing scenarios. The Expert Advisor runs on any pair and sees all open positions on all pairs. Analyzing profit and other parameters can close all positions or selective ones following the settings. It can work with all open positions as well as take into account Magic, a trading pair or a direction - LONG or SHORT. DOES NOT OPEN POSITION himself, only in the strategy tes
270 USD
FutureVisionByWPR
FutureVisionByWPR
Stanislav Korotky
This is a future predictor based on so called backward WPR . The indicator calculates conditional probability of conversions between WPR and backward WPR values on available quotes history. Then it estimates future price movement using these probabilities and latest WPR readings. The backward WPR is nothing special except that it's counted from right to left, i.e. from the future to the past. The main advantage of the backward WPR is that it knows the future and its values are always optimal for
75 USD
Account QuickReport 4
Account QuickReport 4
Andrej Nikitin
A library for creating a brief trading report in a separate window. Three report generation modes are supported: For all trades. For trades of the current instrument. For trades on all instruments except the current one. It features the ability to make reports on the deals with a certain magic number. It is possible to set the time period of the report, to hide the account number and holder's name, to write the report to an htm file. The library is useful for fast assessment of the trading effec
19 USD
Expert Advisor
Expert Advisor
Steve Zoeger
Fully automated Ichimoku EA. Perfect EA for Longterm Investments not short term profits. These days with zero interest or negative interest at Banks there is a better way to invest. This EA generates more then leaving Money sitting on the Banks. works on all Time Frames but i would recommend the Higher Frames.  On the lower Frames there are too many small trades but its up to yourself.  I would recommend to test it on a Cent Account if you are not sure. You can click on the link below for a Cent
13 USD
Custom HLOC pro
Custom HLOC pro
Yurij Kozhevnikov
The library has been designed for background generation of non-standard timeframes' history files and their application on the entire depth of the available history via the functions similar to standard MQL4 ones used to access the time series. Standard timeframes' data can also be used. Unlike Custom HLOC containing only some of the functions, the current product contains all function equivalents for accessing the time series. Also, this product allows you to generate history files for any time
30 USD
Visual Trader
Visual Trader
Robert Rutherford
Want to see your trading system visually on a chart? Visual Trader allows you to see your historic and live trades entry and exit points. See all your trades Analyse your system It is a very useful forex tool as it shows the trades in the same way as they are shown on a back-test. It is great for analysis of your trading system as you get to see how the entry and exit points match your indicators and chart shifts. You will see a red arrow and corresponding line for your sell trades and a blue ar
FREE
IPC Free
IPC Free
Tanvir Ahmed
Indicator Profitability Check   Introduction: IPC means "Indicator Profitability Check". Some features will be locked in free version. Also you cannot check result more than 1 month. For paid version, please visit:  https://www.mql5.com/en/market/product/45247 Here Indicator Profitability Check is a custom script which will check the profitability of a buy-sell arrow based custom indicator’s signal profitability. So traders who are very confusing for a buy-sell arrow based custom signal indicato
FREE
ST Trades2Chart MT4
ST Trades2Chart MT4
Irek Gilmutdinov
The utility displays information about performed trades on the current chart. The account history as well as a separate file can be used as a data source. The file format is set manually or selected from available templates. Settings: Source - where to take data from, from_History - account history, from_File - csv file. File Name - file name. The file has to be located at ..\MQL4\Files\ directory of the terminal. Important not: if the file is opened in excel, close it before launching the scr
15 USD
Horus Treasure
Horus Treasure
Samir Arman
How the Expert Works Initially a line is drawn on the chart As the price moves a number of points the trades are opened With each move a number of points works to open deals The expert does not work complications Parameters: Lot1: Manual Lot Size Auto_Lot: Set true to automatically calculate optimal Lot Size based on risk preferences, Set False if you want use manual lot size. Max_Risk: Max Risk as percentage of Equity* the greater this percentage is the greater the lot size if auto lot is used.
100 USD
Gunn Crosses
Gunn Crosses
Iurii Tokman
Индикатор уровней поддержки и сопротивления. Уровни рассчитаны согласно диагонального и кардинального креста квадрата Ганна. Расчет происходит относительно текущей цены или относительно цены заданной пользователем в настройке Price. Так же, в расчете можно использовать часть ценообразующей при помощи настроек Digit и minus_znak. Например: текущая цена имеет вид - 1.23456, и настройка  Digit установлена _5____ , значит в расчете будет участвовать число 23456, для _6____ будет число 123456
69 USD
Horus Treasure 2
Horus Treasure 2
Samir Arman
How the Expert Works Initially a line is drawn on the chart As the price moves a number of points the trades are opened With each move a number of points works to open deals The expert does not work complications Parameters: Lot1: Manual Lot Size Auto_Lot: Set true to automatically calculate optimal Lot Size based on risk preferences, Set False if you want use manual lot size. Max_Risk: Max Risk as percentage of Equity* the greater this percentage is the greater the lot size if auto lot is used.
200 USD
Buyers of this product also purchase
Trades Manager
Trades Manager
Omar Alkassar
The library is dedicated to help manage your trades, calculate lot, trailing, partial close and other functions Orders CloseallSell CloseallBuy CloseallOpen DeletePending DeleteAll: Close All Market Orders and delete all pending orders. CheckOpenBuyOrders: return the count of buy orders. CheckOpenSellOrders: return the count of sell orders. CheckOpenOrders: return the count of market orders. ModifyOrder DeleteOrder CloseOrder OpenOrder Lot Calculation Mode 0: Fixed Lot. Mode 1: Martingale Lo
249 USD
MetaCOT 2 CFTC ToolBox MT4
MetaCOT 2 CFTC ToolBox MT4
Vasiliy Sokolov
MetaCOT 2 CFTC ToolBox is a special library that provides access to CFTC (U.S. Commodity Futures Trading Commission) reports straight from the MetaTrader terminal. The library includes all indicators that are based on these reports. With this library you do not need to purchase each MetaCOT indicator separately. Instead, you can obtain a single set of all 34 indicators including additional indicators that are not available as separate versions. The library supports all types of reports, and prov
95 USD
NewsFilterForEA
NewsFilterForEA
M YUSUF EFFENDY
Library for an Expert Advisor. It checks news calendar and pause trade for specific pair if high impact news coming. News Filter for an Exert Advisor. Easily apply to your EA, just needs simple scripts to call it from your EA. Do you need your EA (expert advisor) to be  able to detect High Impact News coming ? Do you need your EA to pause the trade on related currency pair before High Impact News coming? This News Filter library is the solution for you. This library requires indicator  NewsCal
200 USD
Gold brushes
Gold brushes
Chunwei Guan
EA introduction:    Gold long short hedging is a full-automatic trading strategy of long short trading, automatic change of hands and dynamic stop loss and stop profit. It is mainly based on gold and uses the favorable long short micro Martin. At the same time, combined with the hedging mechanism, long short hedging will be carried out in the oscillatory market, and in the trend market, the wrong order of loss will be stopped directly to comply with the unilateral trend, so the strategy can be
30 000 USD
Golden 30 minutes exclusive to EA
Golden 30 minutes exclusive to EA
Fu Cun Dai
实盘交易盈利,回测年化125%,回撤25%,交易量少,不是经常下单,挂起后要有耐心。没有多牛的技术,只是一套简单的交易策略,贵在长期坚持,长期执行。我们有时候就是把自己高复杂,想想我们交易的历程,你就会发现,小白好赚钱,当你懂得越多的时候也是亏损的开始,总是今天用这个技术,明天用那个指标,到头来发现,没有一个指标适合你。其实每个技术指标都是概率性的,没有100%的胜率。很多技术指标你要融合一套交易策略,资金仓位控制,止损止盈比例,一套策略下来下一步你做的就是执行力了,必须要坚决执行你的交易策略,如果不能坚持的话最终还是在亏损。说实话不是每个人都有好的心态和执行力,所以我们做出来这款ea自己来用,发现时间久了扭亏为盈了,那现在就拿出来给大家分享,让更多的人来达到自己的盈利目标。购买后留下邮箱或添加软件里的qq,我们会根据你的资金来调整软件参数。 经测试过的柱数 14794 用于复盘的即时价数量 51321985 复盘模型的质量 n/a 输入图表错误 213935 起始资金 10000.00 点差 当前 (54) 总净盈利 12583.42 总获利 37630.02 总亏损 -25046.
1 999 USD
MT4QuantLIb
MT4QuantLIb
Chao Chen Li
软件使用之前,请采用以下方式导入函数。 #ifdef __MQL4__ #import "vx_mtquant.ex4" #endif #ifdef __MQL5__ #import "vx_mtquant.ex5" #endif ulong BuyScaleRatioStep( double ratio, int step_pips, double volume, int sl_pips, int tp_pips, ulong magic, string symbol, string comment); ulong SellScaleRatioStep( double ratio, int step_pips, double volume, int sl_pips, int tp_pips, ulong magic, string symbol, string comment); ulong BuyScaleStep( int step_pips, double volume, int sl_pips, int tp_pips, ulong magic, string symb
299 USD
Custom HLOC
Custom HLOC
Yurij Kozhevnikov
The library has been designed for background generation of non-standard timeframes' history files and their application on the entire depth of the available history via the functions similar to standard MQL4 ones used to access the time series. Standard timeframes' data can also be used. Unlike Custom HLOC Free using only available M1 chart data as the data source, the current product uses the entire minute history file of the appropriate symbol to generate non-standard timeframes' history file.
10 USD
MT4 Logger
MT4 Logger
Zoltan Meszaros
Description The CLogger class provides a simple but sophisticated logging utility that you can use to output messages. The messages have associated levels, such as INFO or ERROR that indicate their importance. You can then give the CLogger a level, and only messages at this level or higher will be saved. The levels are: DEBUG : Low-level information for developers. INFO : Generic (useful) information about system operation. WARNING : A warning. ERROR : A handleable error condition. Public method
10 USD
Log4MQL logger
Log4MQL logger
Karel Jelinek
For full product description go to Comments tab. MetaTrader and its MQL4/5 language is great for developing of automated trading systems. But I was missing some support for logging of custom messages and information during run of some trading system, custom scripts or indicators. One of the possibilities is to use Print function and then read messages in Journal window. Disadvantages of this Journal window are: it is slowly refreshed when you print out many messages it cannot be searched it is d
10 USD
Display Text Information On Your Chart
Display Text Information On Your Chart
Nicolas Zoogones
Display all text information you need on your live charts. First, import the library: #import "osd.ex4" void display( string osdText, ENUM_BASE_CORNER osdCorner, int osdFontSize, color osdFontColor, int osdAbs, int osdOrd); // function to display void undisplay( string osdText); // function to undisplay int splitText( string osdText, string &linesText[]); // function called from display() and undisplay() void delObsoleteLines( int nbLines); // function called from display string setLineName( int
10 USD
Trades Manager
Trades Manager
Omar Alkassar
The library is dedicated to help manage your trades, calculate lot, trailing, partial close and other functions Orders CloseallSell CloseallBuy CloseallOpen DeletePending DeleteAll: Close All Market Orders and delete all pending orders. CheckOpenBuyOrders: return the count of buy orders. CheckOpenSellOrders: return the count of sell orders. CheckOpenOrders: return the count of market orders. ModifyOrder DeleteOrder CloseOrder OpenOrder Lot Calculation Mode 0: Fixed Lot. Mode 1: Martingale Lo
249 USD
WalkForwardOptimizer
WalkForwardOptimizer
Stanislav Korotky
WalkForwardOptimizer library allows you to perform rolling and cluster walk-forward optimization of expert advisers (EA) in MetaTrader 4. To use the library include its header file WalkForwardOptimizer.mqh into your EA source code, add call provided functions as appropriate. Once the library is embedded into EA, you may start optimization according to the procedure described in the User guide . When it's finished, intermediate results are saved into a csv-file and some special global variabl
85 USD
MetaCOT 2 CFTC ToolBox MT4
MetaCOT 2 CFTC ToolBox MT4
Vasiliy Sokolov
MetaCOT 2 CFTC ToolBox is a special library that provides access to CFTC (U.S. Commodity Futures Trading Commission) reports straight from the MetaTrader terminal. The library includes all indicators that are based on these reports. With this library you do not need to purchase each MetaCOT indicator separately. Instead, you can obtain a single set of all 34 indicators including additional indicators that are not available as separate versions. The library supports all types of reports, and prov
95 USD
WalkForwardLight
WalkForwardLight
Stanislav Korotky
This is a simplified and effective version of the library for walk forward analysis of trading experts. It collects data about the expert's trade during the optimization process in the MetaTrader tester and stores them in intermediate files in the "tester/Files" directory. Then these files can be used by the special WalkForwardBuilder script to build a cluster walk forward report and rolling walk forward reports for refining it. The intermediate files should be manually placed to the "MQL4/Files
85 USD
NewsFilterForEA
NewsFilterForEA
M YUSUF EFFENDY
Library for an Expert Advisor. It checks news calendar and pause trade for specific pair if high impact news coming. News Filter for an Exert Advisor. Easily apply to your EA, just needs simple scripts to call it from your EA. Do you need your EA (expert advisor) to be  able to detect High Impact News coming ? Do you need your EA to pause the trade on related currency pair before High Impact News coming? This News Filter library is the solution for you. This library requires indicator  NewsCal
200 USD
Easy websocket library for mql4
Easy websocket library for mql4
Soewono Effendi
An easy to use websocket library for MQL4. It supports: ws:// and wss:// (secure websocket) text and binary data automatic ping-pong handling on protocol level (keep-alive protocol hand shake) automatic fragmented message handling on protocol level (large data transfer enabled) ================================================== ATTENTION:  PLEASE CONTACT SELLER BEFORE PURCHASE. Due to the nature of this kind of library,  FULL FEATURE DEMO VERSION CAN BE PROVIDED ON REQUEST ==============
30 USD
Gold brushes
Gold brushes
Chunwei Guan
EA introduction:    Gold long short hedging is a full-automatic trading strategy of long short trading, automatic change of hands and dynamic stop loss and stop profit. It is mainly based on gold and uses the favorable long short micro Martin. At the same time, combined with the hedging mechanism, long short hedging will be carried out in the oscillatory market, and in the trend market, the wrong order of loss will be stopped directly to comply with the unilateral trend, so the strategy can be
30 000 USD
RFX Load History
RFX Load History
Rasoul Mojtahedzadeh
This is a library that enables an easy way of downloading M1 history data from brokers. The interface has been written to be as easy and intuitive as possible. There is only one function that the user needs to call in order to fetch all available M1 data from brokers servers. The function has three arguments, the symbol and time frame of interest and the number of look back candles for which the M1 data need to be fetched. It should be noted that as the number of look back candles increases, the
50 USD
VolumeReduction
VolumeReduction
Vasyl Temchenko
Function of the correct decrease in the volume of the deals Everybody checks the availability of a sufficient amount of margin - this is a mandatory requirement of the Market. But the trader does not benefit from this. The deal will not open if at least 1 cent of the margin is not enough. It doesn't matter who refuses, terminal or robot. This is dangerous. If the trader is not able to constantly be near the computer, then any such refusal can lead to the loss of the deposit. The lock-deal
30 USD
CheckOrder
CheckOrder
Vasyl Temchenko
If you are having insurmountable problems with the validation of an EA, then you definitely need this function.    I authorize its use in commercial EA. I give the source code to those who pay for unlimited use. You will be able to insert the function into your code, which will allow you to avoid importing library files (it prohibited by the Market conditions).      The function performs all the order checks required by the Market (minimum and maximum deal-volume, volume step, sufficient free
60 USD
Golden 30 minutes exclusive to EA
Golden 30 minutes exclusive to EA
Fu Cun Dai
实盘交易盈利,回测年化125%,回撤25%,交易量少,不是经常下单,挂起后要有耐心。没有多牛的技术,只是一套简单的交易策略,贵在长期坚持,长期执行。我们有时候就是把自己高复杂,想想我们交易的历程,你就会发现,小白好赚钱,当你懂得越多的时候也是亏损的开始,总是今天用这个技术,明天用那个指标,到头来发现,没有一个指标适合你。其实每个技术指标都是概率性的,没有100%的胜率。很多技术指标你要融合一套交易策略,资金仓位控制,止损止盈比例,一套策略下来下一步你做的就是执行力了,必须要坚决执行你的交易策略,如果不能坚持的话最终还是在亏损。说实话不是每个人都有好的心态和执行力,所以我们做出来这款ea自己来用,发现时间久了扭亏为盈了,那现在就拿出来给大家分享,让更多的人来达到自己的盈利目标。购买后留下邮箱或添加软件里的qq,我们会根据你的资金来调整软件参数。 经测试过的柱数 14794 用于复盘的即时价数量 51321985 复盘模型的质量 n/a 输入图表错误 213935 起始资金 10000.00 点差 当前 (54) 总净盈利 12583.42 总获利 37630.02 总亏损 -25046.
1 999 USD
MT4QuantLIb
MT4QuantLIb
Chao Chen Li
软件使用之前,请采用以下方式导入函数。 #ifdef __MQL4__ #import "vx_mtquant.ex4" #endif #ifdef __MQL5__ #import "vx_mtquant.ex5" #endif ulong BuyScaleRatioStep( double ratio, int step_pips, double volume, int sl_pips, int tp_pips, ulong magic, string symbol, string comment); ulong SellScaleRatioStep( double ratio, int step_pips, double volume, int sl_pips, int tp_pips, ulong magic, string symbol, string comment); ulong BuyScaleStep( int step_pips, double volume, int sl_pips, int tp_pips, ulong magic, string symb
299 USD
News Scraping FTMO
News Scraping FTMO
Roberto La Bella
In this library there is embedded a function called newsAlertFTMO; this function returns a datetime value of the next news date (FTMO Restricted Event) for the specific currency selected (or 0 if there is no Restricted Event news found). With this library and the following integration code you can disable the EA during that news(with a buffer of 2 minutes before and after the news release). Here an example of how to import from the library: #import “News Scraping FTMO.ex4" datetime newsAlertFTM
39 USD
More from author
FreqoMeterForecast
FreqoMeterForecast
Stanislav Korotky
The main idea of this indicator is rates analysis and prediction by Fourier transform. Indicator decomposes exchange rates into main harmonics and calculates their product in future. You may use the indicator as a standalone product, but for better prediction accuracy there is another related indicator - FreqoMaster - which uses FreqoMeterForecast as a backend engine and combines several instances of FreqoMeterForecast for different frequency bands. Parameters: iPeriod - number of bars in the ma
12.50 USD
VolumeDeltaMT5
VolumeDeltaMT5
Stanislav Korotky
This indicator provides the analysis of tick volume deltas. It calculates tick volumes for buys and sells separately, and their delta on every bar, and displays volumes by price clusters (cells) within a specified bar (usually the latest one). This is a limited substitution of market delta analysis based on real volumes, which are not available on Forex. The indicator displays the following data in its sub-window: light-blue histogram - buy (long) volumes; orange histogram - sell (short) volumes
25 USD
VolumeDeltaBars
VolumeDeltaBars
Stanislav Korotky
This indicator is a conventional analytical tool for tick volumes changes. It calculates tick volumes for buys and sells separately, and their delta on every bar, and displays volumes by price clusters (cells) within a specified bar (usually the latest one). The algorithm used internally is the same as in the indicator VolumeDeltaMT5 , but results are shown as cumulative volume delta bars (candlesticks). Analogous indicator for MetaTrader 4 exists - CumulativeDeltaBars . This is a limited substi
25 USD
OrderBook Cumulative Indicator
OrderBook Cumulative Indicator
Stanislav Korotky
Order Book, known also as Market Book, market depth, Level 2, - is a dynamically updated table with current volumes of orders to buy and to sell specific financial instument at price levels near Bid and Ask. MetaTrader 5 provides the means for receiving market book from your broker, but in real time only, without access to its history. The indicator OrderBook Cumulative Indicator accumulates market book data online and visualizes them on the chart. In addition, the indicator can show the market
49 USD
VolumeDeltaWaves
VolumeDeltaWaves
Stanislav Korotky
This indicator is an extended implementation of Weis waves. It builds Weis waves on absolute volumes (which is the classical approach) or delta of volumes (unique feature) using different methods of wave formation and visualization. It works with real volumes, if available, or with tick volumes otherwise, but also provides an option to use so called "true volume surrogates", as an artificial substitution for missing real volumes (for example, for Forex symbols), which was introduced in correspo
49 USD
AutomaticZigZag
AutomaticZigZag
Stanislav Korotky
This is a non-parametric ZigZag providing 4 different methods of calculation. Upward edge continues on new bars while their `highs` are above highest `low` among previous bars, downward edge continues on next bars while their `lows` are below lowest `high` among previous; Gann swing: upward edge continues while `highs` and `lows` are higher than on the left adjacent bar, downward edge continues while `highs` and `lows` are lower than on the left adjacent bar. Inside bars (with lower `high` and
FREE
CustomVolumeDelta
CustomVolumeDelta
Stanislav Korotky
This indicator displays volume delta (of either tick volume or real volume) encoded in a custom symbol, generated by special expert advisers, such as RenkoFromRealTicks . MetaTrader does not allow negative values in the volumes, this is why we need to encode deltas in a special way, and then use CustomVolumeDelta indicator to decode and display the deltas. This indicator is applicable only for custom instruments generated in appropriate way (with signed volumes encoded). It makes no sense to ap
FREE
RenkoChartsDemo
RenkoChartsDemo
Stanislav Korotky
This is a demo version of a non-trading expert , which utilizes so called the custom symbols feature ( available in MQL as well ) to build renko charts based on historical quotes of selected standard symbol and to refresh renko in real-time according to new ticks. Also it translates real ticks to the renko charts, which allows other EAs and indicators to trade and analyze renko. Place the EA on a chart of a working instrument. The lesser timeframe of the source chart is, the more precise resulti
FREE
HZZM
HZZM
Stanislav Korotky
This is an adaptive ZigZag based on modification of  HZZ indicator (original source code is available in this article ). Most important changes in this version: two additional indicator buffers added for zigzag evolution monitoring - they show cross signs at points where zigzag direction first changes; zigzag range (H) autodetection on day by day basis; time-dependent adjustment of zigzag range. Parameters: H - zigzag range in points; this parameter is similar to original HZZ, but it can take 0
FREE
WalkForwardDemo MT5
WalkForwardDemo MT5
Stanislav Korotky
WalkForwardDemo is an expert adviser (EA) demonstrating how the built-in library WalkForwardOptimizer (WFO) for walk-forward optimization works. It allows you to easily optimize, view and analyze your EA performance and robustness in unknown trading conditions of future. You may find more details about walk-forward optimization in Wikipedia . Once you have performed optimization using WFO, the library generates special global variables (saved in an "archived" file with GVF-extension) and a CSV-f
FREE
OrderBook History Playback
OrderBook History Playback
Stanislav Korotky
Order Book, known also as Market Book, market depth, Level 2, - is a dynamically updated table with current volumes of orders to buy and to sell specific financial instument at price levels near Bid and Ask. MetaTrader 5 provides the means for receiving market book from your broker, but in real time only, without access to its history. This expert adviser OrderBook History Playback allows you to playback the market book events on the history using files, created by OrderBook Recorder . The exper
FREE
WalkForwardBuilder MT5
WalkForwardBuilder MT5
Stanislav Korotky
This script allows performing a walk-forward analysis of trading experts based on the data collected by the WalkForwardLight MT5 library. The script builds a cluster walk forward report and rolling walk forward reports that refine it, in the form of a single HTML page. This script is optional, as the library automatically generates the report immediate after the optimization in the tester is complete. However, the script is convenient because it allows using the same collected data to rebuild th
FREE
OrderBook Recorder
OrderBook Recorder
Stanislav Korotky
Order Book, known also as Market Book, market depth, Level 2, - is a dynamically updated table with current volumes of orders to buy and to sell specific financial instument at price levels near Bid and Ask. MetaTrader 5 provides the means for receiving market book from your broker in real time. The expert OrderBook Recorder records market book changes and stores them in local files for further usage in indicators and expert adviser, including testing in the tester. The expert stores market book
FREE
OrderBook Utilities
OrderBook Utilities
Stanislav Korotky
OrderBook Utilities is a script, which performs several service operations on order book hob-files, created by OrderBook Recorder . The script processes a file for work symbol of the current chart. The file date is selected by means of the input parameter CustomDate (if it's filled in) or by the point where the script is dropped on the chart. Depending from the operation, useful information is written into the log, and optionally new file is created. The operation is selected by the input parame
FREE
PriceProbabilityDemo
PriceProbabilityDemo
Stanislav Korotky
This is a demo version of PriceProbability indicator. It works on EURCHF only. This is an easy to use signal indicator which shows and alerts probability measures for buys and sells in near future. It is based on statistical data gathered on existing history and takes into account all observed price changes versus corresponding bar intervals in the past. The statistical calculations use the same matrix as another related indicator - PointsVsBars. Once the indicator is placed on a chart, it shows
FREE
CCFpExtraDemo
CCFpExtraDemo
Stanislav Korotky
CCFpExtra is an extended version of the classic cluster indicator CCFp for multicurrency market analysis. The main features are: Arbitrary groups of tickers or currencies are supported: Forex, CFDs, futures, spot, indices; Time alignment of bars for different symbols with proper handling of possibly missing bars, including cases when tickers have different trading schedule; Using up to 30 instruments for market calculation (only the first 8 ones are displayed). This is a demo-version. Limitation
FREE
Mirror
Mirror
Stanislav Korotky
This indicator predicts rate changes based on the chart display principle. It uses the idea that the price fluctuations consist of "action" and "reaction" phases, and the "reaction" is comparable and similar to the "action", so mirroring can be used to predict it. The indicator has three parameters: predict - the number of bars for prediction (24 by default); depth - the number of past bars that will be used as mirror points; for all depth mirroring points an MA is calculated and drawn on the ch
12.50 USD
ExtraMajorLevelExtremums
ExtraMajorLevelExtremums
Stanislav Korotky
If you like trading crosses (such as AUDJPY, CADJPY, EURCHF, and similar), you should take into account what happens with major currencies (especially, USD and EUR) against the work pair: for example, while trading AUDJPY, important levels from AUDUSD and USDJPY may have an implicit effect. This indicator allows you to view hidden levels, calculated from the major rates. It finds nearest extremums in major quotes for specified history depth, which most likely form resistence or support levels, a
10 USD
EvoLevels
EvoLevels
Stanislav Korotky
The indicator displays most prominent price levels and their changes in history. It dynamically detects regions where price movements form attractors and shows up to 8 of them. The attractors can serve as resistance or support levels and outer bounds for rates. Parameters: WindowSize - number of bars in the sliding window which is used for detection of attractors; default is 100; MaxBar - number of bars to process (for performance optimization); default is 1000; when the indicator is called from
20 USD
ExtraMovingPivots
ExtraMovingPivots
Stanislav Korotky
This is an intraday indicator that uses conventional formulae for daily and weekly levels of pivot, resistance and support, but updates them dynamically bar by bar. It answers the question how pivot levels would behave if every bar were considered as the last bar of a day. At every point in time, it takes N latest bars into consideration, where N is either the number of bars in a day (round the clock, i.e. in 24h) or the number of bars in a week - for daily and weekly levels correspondingly. So,
10 USD
ResistanceAndSupportDensityFunction
ResistanceAndSupportDensityFunction
Stanislav Korotky
Most of traders use resistance and support levels for trading, and many people draw these levels as lines that go through extremums on a chart. When someone does this manually, he normally does this his own way, and every trader finds different lines as important. How can one be sure that his vision is correct? This indicator helps to solve this problem. It builds a complete set of virtual lines of resistance and support around current price and calculates density function for spatial distributi
15 USD
ExtraMajorMultiChannels
ExtraMajorMultiChannels
Stanislav Korotky
The indicator draws a histogram of important levels for several major currencies attached to the current cross rates. It is intended for using on charts of crosses. It displays a histogram calculated from levels of nearest extremums of related major currencies. For example, hidden levels for AUDJPY can be detected by analyzing extremums of AUD and JPY rates against USD, EUR, GBP, and CHF. All instruments built from these currencies must be available on the client. This is an extended version of
12.50 USD
StatBars
StatBars
Stanislav Korotky
The indicator provides a statistic histogram of estimated price movements for intraday bars. It builds a histogram of average price movements for every intraday bar in history, separately for each day of week. Bars with movements above standard deviation or with higher percentage of buys than sells, or vice versa, can be used as direct trading signals. The indicator looks up current symbol history and sums up returns on every single intraday bar on a specific day of week. For example, if current
15 USD
PointsVsBars
PointsVsBars
Stanislav Korotky
This indicator provides a statistical analysis of price changes (in points) versus time delta (in bars). It calculates a matrix of full statistics about price changes during different time periods, and displays either distribution of returns in points for requested bar delta, or distribution of time deltas in bars for requested return. Please, note, that the indicator values are always a number of times corresponding price change vs bar delta occurred in history. Parameters: HistoryDepth - numbe
10 USD
PriceProbability
PriceProbability
Stanislav Korotky
This is an easy to use signal indicator which shows and alerts probability measures for buys and sells in near future. It is based on statistical data gathered on existing history and takes into account all observed price changes versus corresponding bar intervals in the past. The statistical calculations use the same matrix as another related indicator - PointsVsBars. Once the indicator is placed on a chart, it shows 2 labels with current estimation of signal probability and alerts when signal
75 USD
CCFpExtra
CCFpExtra
Stanislav Korotky
CCFpExtra is an extended version of the classic cluster indicator - CCFp. This is the MT4 version of indicator  CCFpExt available for MT5. Despite the fact that MT5 version was published first, it is MT4 version which was initially developed and tested, long before MT4 market was launched. Main Features Arbitrary groups of tickers or currencies are supported: can be Forex, CFDs, futures, spot, indices; Time alignment of bars for different symbols with proper handling of possibly missing bars, in
49 USD
Year2Year
Year2Year
Stanislav Korotky
This indicator shows price changes for the same days in past years. D1 timeframe is required. This is a predictor indicator that finds D1 bars for the same days in past 8 years and shows their relative price changes on the current chart. Parameters: LookForward - number of days (bars) to show "future" price changes; default is 5; Offset - number of days (bars) to shift back in history; default is 0; ShowAverage - mode switch; true - show mean value for all 8 years and deviation bounds; false - s
12.50 USD
PriceProbabilities
PriceProbabilities
Stanislav Korotky
This is a signal indicator for automatic trading which shows probability measures for buys and sells for each bar. It is based on statistical data gathered on existing history and takes into account all observed price changes versus corresponding bar intervals in the past. The core of the indicator is the same as in PriceProbablility indicator intended for manual trading. Unlike PriceProbability this indicator should be called from MQL4 Expert Advisors or used for history visual analysis. The in
75 USD
FreqoMaster
FreqoMaster
Stanislav Korotky
The main idea of this indicator is rates analysis and prediction by Fourier transform. The indicator decomposes exchange rates into main harmonics and calculates their product in future. The indicator shows 2 price marks in history, depicting price range in the past, and 2 price marks in future with price movement forecast. Buy or sell decision and take profit size are displayed in a text label in the indicator window. The indicator uses another indicator as an engine for calculations - FreqoMet
75 USD
InstantTrueRange
InstantTrueRange
Stanislav Korotky
This is an impulse detector that uses a measure of instant changes in rates of all major currencies. It calculates change in value (point value multiplied by point delta) on every bar for several crosses with major currencies. This forms a kind of "complete circle" of the Forex market. Then this general change is compared to a change of current instrument or a list of selected instruments, and alarm is fired if their difference is over a threshold. The indicator is somewhat similar to AverageTru
11.95 USD
Filter:
No reviews
Reply to review
Version 1.6 2020.10.19
Numerous fixes and improvements.
- The ending date of forward period is excluded now - the same as in the tester.
- Expression evaluation engine for custom formulae is replaced with completely new one. In addition to previously supported operations, it handles now unary minus and logical negation, as well as ternary conditional statements w?t:f.
- New function wfo_setCustomPerformanceMeter(FUNCPTR_WFO_CUSTOM funcptr) is added. It allows you to pass a reference to your special custom callback into the library. This callback function will be called by the library to get your custom trade efficiency mark (OnTester analogue). This can be handy if the existing approach with formula assigned via wfo_setEstimationMethod(WFO_ESTIMATION_METHOD estimation, string formula) is not sufficient for you. In the expert code one should implement a function of type FUNCPTR_WFO_CUSTOM with the following prototype: typedef double (*FUNCPTR_WFO_CUSTOM)(const datetime startDate, const datetime splitDate, const double &map[/*size of enum WFO_STATS_MAP*/]); (consult with the documentation and the header file for details).
- New predefined variables is added to the formula engine: AR - average return, i.e. average % of return on a deal (profit/loss amount divided by current balance, averaged on all trades) - this is a measure of balance curve slope, used in sharpe; STDEV - standard deviation of balance curve.
- Forward step size can now be equal to window size (in previous versions forward step should have been less than window).

For any market product, it's recommended to backup exising version before upgrading to the new one.
Version 1.5 2019.08.22
Fixed a bug with datetime increments overflow, which could lead to multiple empty forward passes with zero dates 1970.01.01.
Version 1.4 2017.06.13
Fixed an overflow error in calculation of forward steps for window sizes larger than approximately 2 years.
Version 1.3 2017.05.23
Performance is improved by means of early drop off of those optimization passes, for which in-sample data overlaps with ending date of the tester. Such passes will fail in OnInit with INIT_PARAMETERS_INCORRECT errors. This is an intended behavior.
Version 1.2 2016.08.29
New function void wfo_setCleanUpTimeout(int seconds) added, allowing you to simplify automatic deletion of old csv-files in Tester/Files and WF_-global variables, the presence of which could lead to incorrect data state after next optimization run. For details - see documentation and Comments section.

Processing of optimization windows which runs out of ending date of test period is fixed.