Discussing the article: "Advanced Order Execution Algorithms in MQL5: TWAP, VWAP, and Iceberg Orders"

 

Check out the new article: Advanced Order Execution Algorithms in MQL5: TWAP, VWAP, and Iceberg Orders.

An MQL5 framework that brings institutional-grade execution algorithms (TWAP, VWAP, Iceberg) to retail traders through a unified execution manager and performance analyzer for smoother, more precise order slicing and analytics.

“Sure,” you might shrug, “but I’m not moving institutional sums.” Here’s the kicker: you don’t have to. Whether you’re deploying a half-lot or a handful of mini-lots, volatility can still twist your execution. These tools help you:

  • Tame Slippage: Even modest orders can wander in choppy markets.
  • Sharpen Your Edge: Layered executions often land you a more favorable average price than a one-shot gamble.
  • Stay Zen: Automated workflows strip away the temptation to panic-buy or panic-sell.
  • Scale Seamlessly: As your account grows, your execution stays crisp—no matter how hefty your orders become.
  • Fly Under the Radar: Iceberg Orders, in particular, cloak your true order size, keeping prying algos guessing.

Today’s democratized landscape means the same execution tech that once demanded multi-million-dollar budgets can now run on your personal trading station. By dropping polished MQL5 code for TWAP, VWAP, and Iceberg strategies into your platform, you’ll arm yourself with institutional firepower—without ever leaving the retail domain.

Get ready to flip the script on your execution process. The game is changing, and with these algorithms in your toolkit, you’ll be playing to win.

Author: N Soumik

 

Great article!

Which pairs do you recommend for this Algo?

Which time frames? M5, M30 etc.

Which session?

Thanks and kind regards

 
Great Article
Testing your algo.
IN file, ExecutionAlgorithm.mqh, added this line    request.type_filling = ORDER_FILLING_IOC; in placing order to fix order placing issue.
Back tested it at M5, it opened only 1 trade for 2 months period, no partial order opened.
Tested it at H1, it never applied the SL, or TP and all trades closed in loss.

also while compiling it generates warnings
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 271 41
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 272 22
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 449 17
possible loss of data due to type conversion from 'long' to 'double' PerformanceAnalyzer.mqh 222 17
possible loss of data due to type conversion from 'long' to 'double' ExecutionManager.mqh 418 17


suggest how tyo test the algo, 
Time frame. and any other recommendations.
 
to fix the warnins
also while compiling it generates warnings
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 271 41
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 272 22
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 449 17
possible loss of data due to type conversion from 'long' to 'double' PerformanceAnalyzer.mqh 222 17
possible loss of data due to type conversion from 'long' to 'double' ExecutionManager.mqh 418 17


i changed the code line
m_volumeProfile[intervalIndex] += rates[i].tick_volu

to 
m_volumeProfile[intervalIndex] += (double)rates[i].tick_volume;

It fixed the warnings
Now need you guidence regarding my other queries, as 
Time frame
And also 
why all trades during backtest result in Loss
how to test this great work from you..
 
i_vergo #:
Great Article
Testing your algo.
IN file, ExecutionAlgorithm.mqh, added this line    request.type_filling = ORDER_FILLING_IOC; in placing order to fix order placing issue.
Back tested it at M5, it opened only 1 trade for 2 months period, no partial order opened.
Tested it at H1, it never applied the SL, or TP and all trades closed in loss.

also while compiling it generates warnings
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 271 41
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 272 22
possible loss of data due to type conversion from 'long' to 'double' VWAP.mqh 449 17
possible loss of data due to type conversion from 'long' to 'double' PerformanceAnalyzer.mqh 222 17
possible loss of data due to type conversion from 'long' to 'double' ExecutionManager.mqh 418 17


suggest how tyo test the algo, 
Time frame. and any other recommendations.

The warnings aren't the problem but could get fixed quickly. But yes it would be great if the author could show step-by-step which settings and inputs he used for the backtest.