Sunday, March 7, 2010

DDE in MetaTrader 4

I really like the DDE feature on MetaTrader 4. It means that I can stream data into an Excel spreadsheet in real-time. This is important for me because Excel helps simplify the calculation for my position sizing in any one trade, and helps me decide whether I should take the trade or not. For example, if a set-up has a reward to risk ratio of less than 1:1, then I would not trade it.

You can enable DDE in MetaTrader 4 by going to:
Tools > Options > ‘Server’ tab > select ‘Enable DDE Server’

You can then get an example DDE spreadsheet by going to:
[your local disk]\Program Files\MetaTrader

In there you will find the DDE-Sample.xls file which you can experiment with.

The spreadsheet I use has some of the following variables in it:

• the percentage of capital I wish to risk (typically between 1% and 5%)
• the currency pair I am trading and its bid price (streamed in real-time)
• the GBPUSD exchange rate
• long or short in the market
• entry price
• stop loss
• profit target

The output which is of use to me from this is:
• the R-value (or Risk Value, which is essentially the reward to risk but as a single number e.g. 2:1 reward to risk is the same as 2R… more on that in another blog though). If this is less than 1R, I leave it.
• required lot size
• approximate stoploss (accounting for spread)
• approximate limit order (accounting for spread)


You can see from the example screen shot that this is a trade that falls short of my entry criteria because the R value is less than 1. In reality, I normally only go for set-ups which have a R value of >1.10 (which gives a bit of wiggle room for the spread and slippage) and with good enough reason I might take a trade that is between 1R and 1.10R; but generally never less than 1R.

It’s a shame because looking at the releases of MetaTrader 5 it appears as though MetaQuotes have decided to remove the DDE functionality. Nevertheless, I have no intention of using MT5 just yet.

No comments:

Post a Comment