Orders , positions and deals . Part I

[Versiunea romaneasca] [MQLmagazine.com in romana] [English edition]

This article is dedicated to working with orders, positions and deals.
In this article we will discuss the general principles and passing to the new system. In a new article we will detail the MQL5 programming side on orders, positions and deals.

MetaQuotes changed both the functions but also the principles in working with orders.

A term known in markets is the one of position. The position is the net effect of the trades on a certain asset.

MT4 didn’t knew the concept of position per se. To get the position on an asset, a trader had to write a function, go thru all orders and cummulate the ones on that asset. However, MT4 traders don’t use the position concept, but only the one of trade. Each order placed in the market is a trade itself, with its own result, independent of the others.

MT4 Work example:

1. buy @ 1.3000
2. buy @ 1.3100
3. sell @ 1.3200
4. sell @ 1.3300
5. sell @ 1.3400
6. close [3,4,5] @ 1.3500 : take profit = -300-200-100 = -600
7. close [1,2,3] @ 1.3600 : take profit = +600+500 = 1100

Total profit = 1100 – 600 = 500

MT5 turns somehow to normality, a normality existant in the futures markets, but far away from MT4 trader’s mindset. Forcibly imposed to american brokers by NFA, it became standard for MT5, for who orders don’t matter anymore, but the position. The position is important now, because it tells whether you’re long or short on an asset, and up to which degree. Orders become simple means to alter position.
In other words, a Buy and a Sell don’t have anymore separate destinies, depending on the moments they were launched and closed, but become “position modifiers”. First is opening the position, in this case, and the second, depending on size, shrinks, flattens, or reverses the position.

Same work, MT5 style:
1. buy @ 1.3000 ; position = 1 lot long
2. buy @ 1.3100 ; position = 2 lots long
3. sell @ 1.3200 ; position = 1 lot long, take profit = 1×200 [deal 1] = 200, current open profit = 100 [deal 2]
4. sell @ 1.3300 ; position = flat, take profit = 1×200 [deal 2] = 200
5. sell @ 1.3400 ; pozitie = 1 lot short

6a. Close sell [5] @ 1.3500 ; position = flat, take profit = 1x(-100) = -100

Here’s the difficult part: to emulate MT4’s working style , the trader has to reopen previous orders, which would have been already open in MT4 ; so it has to reconstruct buys:

6b. Relaunch buy 1,buy 2 @ 1.3500 ; position = 2 lots long

7. Close reopened buys @ 1.3600, take profit = 2×100 = 200

Overall profits : 200+200-100+200 = 500

What’s an order in current conditions?

In MT5, the order exists until it’s filled. If we launch a market order, it’s lifetime is a few seconds, until filled. If we launch a pending order, it’s lifetime is undetermined, until it’s fill time. Once filled, the order is depersonalized. Ceases its existence, and alters the position. From that moment, it is called deal . And the word says it all : “it’s a deal” , a closed deal, something of the past – we find it as a historical reference in Account History.

The first conclusion, the one bothering MT4 traders, it’s that hedging vanishes. That form of hedging undestood by them, being long and short on the same instrument. It’s a form of hedging so developed by the MT4 communities that almost elliminated the normal hedging, the one done with other assets – and that thanks to the shortcomings of the MT4’s Strategy Tester that contributed to the misrepresentation, in trading communities, of the elements of financial theory and practice from the institutional area, because these could not have been tested and/or used effectively. From this comes also the resistance to MT5, which tries to bring trading back to normal, by the positional system, but also by events and new asset classes. That trading that’s not indicator betting, but a profit bringing activity – for this is why you are in trading, otherwise you’d hit for the casino. This is the purpose of MQLmagazine, to reeducate traders, to bring back to surface what has been lost from financial education in past years, all the good things and lost in time by retail communities, but which are being used at the institutional level. Of course not all what’s done at the institutional level is necessarily useful or applicable, but a normal trading, that includes quotation, arbitrage and options, can be activated in the retail zone.

The non-simultaneity of the operations – this is what bothers the traders now.
As you can see in my example, the total profit is the same. But in MT4 traders could have closed the orders, being simultaneously present , at different prices. This is the missing link, the opportunity loss accused at MT5. Because for MT5 orders are simple position modifications. Resulting is that position is like a permanent order, adjusted permanently – so the moments, the manner and the degree of adjustments matter now.

In a way traders feel a more sharply the indicators pressure, the need to be right more offen and make lesser mistakes. And this is truly the case, at least from the point of view of monoasset trading. It seems that retail trading will be multiasset or won’t be anymore at all. The multiasset signals are far more fruitful than the monoasset signals – you can use Bollinger bands to see more correctly the breaks in correlations, or you can trade the volatility of the underlying asset using options without knowing the direction.

I’m convinced that after the definitive launch of MT5 this will be adopted by many traders for its advantages offered in multiasst trading are outbalancing the disadvantages that it has in monoasset trading. After all, it’s an educational matter: as the traders have been educated to work with MT4 indicators and have a certain vision over markets, the same way they can expand their vision to cover MT5. And I’m certain that barely now there will appear stable elements helpful for building automated trading systems.

2 Responses to “ Orders , positions and deals . Part I ”

  1. Bill on January 1, 2010 at 5:29 pm

    You have documented exactly why MT5 is a TOTAL FLOP….it will no longer be useful for profitably trading Forex.

  2. Bogdan Caramalac, MQLmagazine sr.editor on January 1, 2010 at 8:47 pm

    Well, I guess you’re a bit right… It will no longer be useful to trade Forex as before. Surely the improvements of the Strategy Tester will make it able for trading Forex differently. But perhaps it’s no longer about Forex only. This is the reason I had in mind for starting up this site, because I think that MT5 will be no longer a “forex trading platform”, rather a “retail trading platform”, able to trade forex, stocks, futures and options as well, all integrated in the same automated product and with extended backtest capabilities. I truly believe it’s time to quit the Forex-only approach and move on to new markets, and more important, new trading styles ; which are mainly multiasset and not affected by the no-hedge issue. Why not quoting fx versus? Why not trading volatility? Why not applying strategies that are only found in books and could fit well automated trading? Is MT4 really that worth to give away so much trading power just for the no-hedge limitation?