Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


ArrayVirtualOrders - library for MetaTrader 4

Андрей | English 日本語 Русский Español Deutsch Português

votes: 9
2009.12.03 14:43
2016.11.22 07:32
ArrayVO.mq4 (40.36 KB)view
Random.mq4 (4.11 KB)view (1.71 KB)


Library for virtual trading.

It can be used for careful checking of the multicurrency strategies and for the expert parameters self-optimization.

The standard order processing functions Order*() has been replaced by v.Order*() functions.

The orders loading/unloading to/from the arrays is supported. So, it's possible to save results of the virtual trade between some sessions. It also allows you to perform the virtual deals analysis with Excel.

The library uses the modified version of Igor Kim (aka KimIV) functions for orders processing. Also it uses an array of prefiltered orders, I don't know exactly the author of this idea, I would like to thank him.

It calculates maximal drawdown and maximal profit during all period of the deal (unfortunelly, in points). Swaps is not supported.

As example of the library use, the simple script is included. It emulates some "random" trade with "random" instruments. The code is commented.


ArrayVO.mq4 -> experts\include\

Random.mq4 -> experts\scripts\

See results in experts\files folder.


07.12.09 added and modified

+ ArrayVO: Now OrderProfit calculates in the currency of the deposit.

- ArrayVO: not established Expiration date for the order.

- Random: at a chosen period of more than 5 days script thrown into an infinite loop.

+ Random: in the window displays the progress of the script - the "current" date, number of transactions.

+ Random: options stop loss and take-profit can now be defined as a percentage of the
instrument's price


12.12.09 added and fixed (v1.03)

- ArrayVO: The algorithm of v.OrderSelect ()
function - if had been used ticket's number, the pool parameter had been used too. Fixed related code sections.

+ ArrayVO:
added functions v.AccountBalance() and v.AccountEquity(). Calculation of values turn on by invoke CalcBalance (true), by default is off. To store these values was changed composition of the columns of arrays - using LoadArrays() for arrays, unloaded the previous version of the library, will lead to incorrect data. It is advisable to turn on the calculation of the test of an integrated strategy, and vice versa - for test patterns and the presence of multiple parallel open account orders better off (meaning in this calculation does not, and the rate of increase).


Editor's remark:

Note that it's a mirror translation of the original Russian version.

If you have any questions to the author, suggestions or comments, it's better to post them there.

If you have found this code useful for trading or educational purposes, don't forget to thank author.

Translated from Russian by MetaQuotes Software Corp.
Original code:

Object Delete Object Delete

The script deletes objects from the chart.


It's based on the simple CCI, it plots arrows for sell and buy signals on the chart.

Elliott Waves Indicator Elliott Waves Indicator

The indicator helps to use the Elliott waves, as described in the book "Trade Chaos" by Bill Williams.

Jay Digital Parabolic Spy Indicator Jay Digital Parabolic Spy Indicator

Displays info about the SAR in relation to the selected candles on four different timeframes.