Wednesday, December 14, 2011

Time based orders in MetaTrader 4

The short summary is that time based orders in MT4 are possible. You just need to keep in mind some of the technical limitations. MetaTrader 4 EAs work based off of incoming ticks. Whenever the bid/ask changes by a micro pip or more, that event triggers the EA to do something.

When the markets hum along at a rapid pace, this effect is not noticeable. When the quote flow slows down, however, it can cause the EA to sleep entirely through your trading window.

Many news traders want to bracket buy and sell stops around the price at 08:29 on NFP Friday. Everyone knows that a major news event is about to release. Trading slows down, as does the flow of quotes. The pending orders may not set in time if an incoming tick does not arrive in the 60 seconds between 08:29 and 08:30. This seems unlikely to many novice traders, but it happens frequently enough that we inevitably receive these types of questions whenever we program a time-based order placement EA.

The workaround typically satisfies most traders. EAs place an order at the first available tick within a certain time window. Using NFP as the example, the EA might seek to place bracket orders around the first tick between 08:29-08:32. The chances of making it 2 minutes past 08:30 without a single tick are low. And given that you are taking the first tick, the orders will succesfully bracket around the price the vast majority of the time. It is important to keep in mind how the backend works for those one-off events where the orders do not function as desired.

MetaTrader 5 addresses MT4′s time weakness by offering event driven programming. It is possible to rewrite MQL4 EAs into MQL5 and to demand an action at a precise moment in time. The MQL5 timer actively watches the clock. Regardless of what the markets do, the EA can know to wake up and do whatever action is needed. This is one of the few scenarios where converting from MQL4 into MQL5 comes with obvious advantages.

Wednesday, December 7, 2011

Automated Choice of Brokerage Company for an Efficient Operation of Expert Advisors

http://articles.mql4.com/508


Introduction

Very often we face situations when an Expert Advisor successfully operates with one brokerage company and is not profitable or even lossmaking on the other one. The reasons may be different. Different brokerage companies have different settings:
  • Quotes. They slightly differ because of two factors - different data feeds and different filtration that smooths quotes. For some Expert Advisors this may be relevant. Situations may occur when an EA trades often with one brokerage company and rarely on another one.
  • Slippage. It may differ much in different brokerage companies. This also may lead to worse characteristics of an EA because of lower expected profit. 
  • Requotes. In some brokerage companies they are oftener than in others. In this case an EA will miss successful entering points because of large number of requotes.


http://articles.mql4.com/508

Color Changing Indicators in MetaTrader

Many custom indicators in MetaTrader use lines that change colors to indicate a change in trend or market condition. Those types of indicators are among the more common requests that we get for programming Expert Advisors. Unfortunately, these indicators often present problems. What you see on the chart is not necessarily what the indicator says.

Take a look at the image below or click the link to view it in full size. You'll notice that I included the data window for the indicator, which is SuperTrend. As we walk from left to right, the data window does not suddenly shift from Trend Up to Trend Down. Instead, it shifts with an in between period where the trend is both up and down.

MT4 Color Changing Indicator

While the visual effect is immediately obvious, the numbers do not clearly indicate the indicator's condition. In fact, it frequently happens where the indicator entirely misrepresents its true calculation. If the last bar was only green and the indicator says that the current bar is red-green, then we can safely assume that the indicator is switching from green to red.

When the indicator says it's red-green and the past bar was red-green, it gets more tricky. We are forced to keep looking back through time until a "clean" red or green value appears. This enables us to capture the indicator's real value.

It does not, however, make for a happy trader. Consider the case where the indicator plots red-green, red, red-green, red. Because of the way MetaTrader draws lines from point to point, the indicator actually appears as a solid red line - a long, beautiful sell signal, right?

In fact, its true calculated values are red, green, red, green. This glitch can make for some ugly surprises. This is especially so when traders expect to ride a down trend and the line appears as solid red, but the indicator (and thus EA) keeps flip flopping on the trade direction. You have to keep this in mind when building EAs around custom indicators.

Tuesday, December 6, 2011

Copyright Issues When Programming Expert Advisors

People frequently discover indicators on forums, trading groups, etc. Although most are bad, occasionally an indicator looks promising enough to use if for programming an expert advisor. Are you allowed to use the indicator that you found in an Expert Advisor?

The crux of the matter is what you intend to do with it. Intellectual property (IP) law has a concept called public domain. If you create an indicator and then share it on a public web site, then the file is presumably free for all to use. Essentially, you give away the copyright when you share it for all to see. The only caveat would be if the file or hosting page places an explicit restriction on how the file may or may not be used.

Personal use of an Expert Advisor does not pose a problem. This includes indicators that you purchased. The only legal reason that prevents you from using a commercial indicator in a personal EA is if the purchasing agreement for the indicator forbids creating derivative products, such as using the indicator to build a new EA.

Writing a commercial EA with a public domain custom indicator also meets the hurdle. You cannot take someone else's work and pass it off as your own; you must substantially alter or improve it before the work becomes yours. Turning an indicator into an automated strategy qualifies as a substantial improvement.

The thorniest issue pops up when you want to use a commercial indicator to create a commercial EA without the permission of the indicator's owner. Most people, myself included, would call this theft. The only way that you can do this legally and ethically is to secure an agreement from the indicator's copyright owner.

I am a programmer. If you're deeply concerned about this issue and want to ensure this information truly reflects US law, then I strongly suggest that you speak with an intellectual property attorney. The information above is for general information purposes and should not be construed as legal advice.

Here's a quick summary:

    Create a private EA from a public domain custom indicator - Almost always ok, unless the indicator owner forbids it

    Create a private EA from a commercial custom indicator - generally OK, unless your purchasing agreement forbids it

    Create a commercial EA from a public domain custom indicator - generally OK, unless the indicator's creator forbids it

    Create a commercial EA from a commercial indicator - never OK, unless you strike an agreement with the copyright owner

Thursday, December 1, 2011

Central Banks coordinated move - lower USD Swap lines by 50 bp

http://economictimes.indiatimes.com/markets/global-markets/asian-shares-gain-on-central-banks-liquidity-move/articleshow/10939125.cms

TOKYO: Asian shares extended gains on Thursday after the world's six major central banks moved to tame a liquidity crunch for European banks by providing cheaper dollar funding. 

MSCI's broadest index of Asia Pacific shares outside Japan jumped 1.3 percent, after U.S. stocks rallied 4 percent and European equities rose 2 percent on Wednesday. Japan's Nikkei opened up 1.7 percent on Thursday. 

The U.S. Federal Reserve, the European Central Bank and the central banks of Canada, Britain, Japan and Switzerland said on Wednesday they would lower the cost of existing dollar swap lines by 50 basis points from Dec. 5, and arrange bilateral swaps to provide liquidity for other currencies. 

A move by China on Wednesday to cut the percentage of cash banks must keep as reserves also boosted sentiment. 

The central banks' move aims to thaw severe funding strains for European banks as lenders had been extremely reluctant due to concerns over the eurozone's ability to quickly resolve its debt crisis, and could warm investor stance towards risk. 

Monday, November 28, 2011

MF Global foreign branches to return funds

MF Global customers abroad may see their frozen funds at least partially returned in the near future, according to several reports this weekend. In the UK, clients subject to the asset freeze may submit claims in two weeks, while in Canada, a court has ordered MF Global’s trustee to begin making cash payments.
KPMG, the firm now responsible for MF Global’s UK branch, says that customers may submit claims beginning December 8. “This helps to create certainty around the number and size of claims with the intention of allowing a return of a proportion of client funds before March 30 2012,” explained Richard Heis, joint special administrator of MF Global UK. The amount clients can expect to recover will depend in turn on what KPMG receives from banks, exchanges, and other institutions. Approved claims will be paid within 14 days. This announcement comes on the heels of a US court order granting American trustees access to company funds. While MF Global’s American operations have been plagued by reports of missing millions (if not billions), these shortfalls are not expected to affect clients in the UK.


http://www.cftclaw.com/2011/11/mf-global-international-branches-return-funds/

Sunday, November 27, 2011

Europeans prepare for Euro breakup, riots

REPORT: FRANCE, GERMANY PREPARE TO TAKE DRASTIC MEASURES...

Banks brace for breakup of euro...

RIOTS WARNED...


Prepare for riots in euro collapse, Foreign Office warns

British embassies in the eurozone have been told to draw up plans to help British expats through the collapse of the single currency, amid new fears for Italy and Spain.

Saturday, November 26, 2011

EES Hardware Development Survey

EES is developing a trading hardware appliance for traders and would like your feedback:

http://eesfx.com/portal/ees-fx/surveys?survey=1

Understanding RAM Timings

http://www.hardwaresecrets.com/article/Understanding-RAM-Timings/26

http://en.wikipedia.org/wiki/Memory_timings

Memory timings (or RAM timings) refer collectively to a set of four numerical parameters called CLtRCDtRP, and tRAS, commonly represented as a series of four numbers separated with dashes, in that respective order (e.g. 5-5-5-15). However, it is not unusual for tRAS to be omitted, or for a fifth value, the Command rate, to be added on. It also remains a common practice to advertise only CL. These parameters define, in clock cycles, the various forms of latency (responsiveness to random requests) that affect fundamental performance metrics of random access memory. Lower numbers indicate fewer clock cycles are needed, implying faster performance.

Friday, November 25, 2011

Moody's cuts Hungary to junk HUF down 1.8%

http://in.reuters.com/article/2011/11/25/idINIndia-60726220111125


(Reuters) - Credit rating agency Moody's cut Hungary's debt to "junk" grade late on Thursday, dealing a blow to Prime Minister Viktor Orban's unorthodox economic policies and prompting his government to denounce the move as a "financial attack".
Moody's lowered Hungary's sovereign rating by one notch to Ba1, just below investment-grade, with a negative outlook, only hours after rival Standard & Poor's held fire on a flagged downgrade after Budapest said it would seek international aid.

Wednesday, November 23, 2011

Germany, Euro on death watch

Investors began to fear the worst for the euro after unusually weak demand at an auction for bonds from Germany, the region’s largest economy. One analyst went so far as to put the currency on a “death watch.”
Euro bills
AP


Germany sold just 60 percent of the 6 billion euros in 10-year bunds it brought to auction, about the weakest demand seen for the country’s debt in the currency’s 16-year history, economists said. The rejection of debt from Europe’s safe harbor marks a new stage for the crisis.
“No bunds wanted equals no Euros wanted equals the Euro death watch,” wrote Mark Steele, an analyst with BMO Capital Markets. “We have seen many poor German auctions. This is not the issue. The issue is how badly the euro is doing after the weak auction.”

"Disastrous" bond sale shakes confidence in Germany

(Reuters) - A "disastrous" German bond sale on Wednesday sparked fears that Europe's debt crisis was even starting to threaten Berlin, with the leaders of the euro zone's two biggest economies still firmly at odds over a longer-term structural solution.

http://www.reuters.com/article/2011/11/23/us-eurozone-idUSTRE7AM0VR20111123

Monday, November 21, 2011

Soil is the hot commodity

http://www.reuters.com/article/2011/11/21/us-farmland-idUSTRE7AK0EA20111121


(Reuters) - It took just 31 minutes for Donald Ellingson's family to end an agrarian tradition that had survived more than a half-century, by auctioning off 153 acres of rich Iowa farmland.
Five years after their father's death, Ellingson's three children had grown weary of the demands of running a farm. Their tenant farmer had retired, and finding a new one was tough. The youngest of them was 60 -- too old, they agreed, to return to a life of risky finances and long work days.

Sunday, November 20, 2011

EES Partner - ADVFN Free financial news & data services

GERMANS TRY TO KILL OFF POUND


BRITAIN will soon be forced to scrap the pound and join the euro, one of Germany’s most senior figures said yesterday.
In a chilling threat to UK sovereignty, German finance minister Wolfgang Schauble predicted that all Europe would one day use the single currency. “It will happen perhaps faster than some in the British Isles currently believe,” he said.