Tuesday, May 12, 2009

OrderSend Error 129 — What to Do?

When using some MT4 expert advisors you may have encountered a rather annoying error message, which reads «OrderSend Error 129». This error should be avoided during EA’s creation, but even if you aren’t the author of the problematic EA, this error is rather easy to fix. OrderSend Error 129 in MetaTrader platform is internally called ERR_INVALID_PRICE («Invalid Price»), which means that expert advisor is trying to open an order with the invalid current price. There are two possible reasons for this error and respectively two solutions.
First reason can be that the price (Ask or Bid) used in the OrderSend function is different from the current market price and theis difference is greater than the Slippage parameter of the OrderSend function. In this case the problem usually lies in the fast market price action, which requires a price refresh inside MT4 immediately before calling the OrderSend function. Just add this code before every OrderSend call:
RefreshRates();
If this is the only error popping up with this EA it’s also a good idea to use the cycle that will try several RefreshRates and OrderSend calls for better reliability:
int count = 0;while ((result == -1) && (count < 10)){RefreshRates();result = OrderSend(...)count++;}
You can use any other number instead of 10 to increase the amount of tries. But if 10 tries isn’t enough then your broker’s MT4 server is probably to slow to trade with this EA at all.
Second reason is more trivial and easy to fix than the first one. The price that is send with OrderSend function should be normalized to the standard of rates that is used in your broker’s MT4 server. For example, if you try to use price like 1.23339 to open EUR/USD position and the current EUR/USD rate at your broker is 1.2334, it won’t work because your order open price isn’t normalized. If your broker uses 6-digit quotes for EUR/USD then sending price like 1.2334 when the actual rate is 1.23345 will also generate OrderSend Error 129. In any case you should use NormalizeDouble function to fix the open price before sending it to your broker. It takes two parameters: first is the value you want to normalize (the price), second is the number of digits after the dot in the resulting number. Here is the example of its usage for the brokers with 6-digit quotes (like 1.23345 for EUR/USD):
OpenPrice = NormalizeDouble(OpenPrice,5);OrderSend(Symbol(), OP_BUY, 1, OpenPrice, ...);
It’s also a good idea to normalize all your StopLoss and TakeProfit values before using them in the OrderSend function. This is a good coding practice even if you don’t get any Error 129 messages.
I don’t know if the listed ways of handling OrderSend Error 129 are universal and are suitable for all cases but they’ve always worked for me. If you have any thoughts, comments or questions regarding MT4 Error 129 and the ways to treat it, feel free to reply to this post using the form below.

Dollar Loses Against Euro as Housing Sector Improves

Housing sector in U.S. showed some improvement today, while the stock markets were less than usually concerned with the swine flu outbreak and the global recession. EUR/USD rose for the second day today and is now trading near 1.3328.
Construction spending rose by 0.3% in March compared to February level. That was the first gain in more than a year. February change was -1%. The median forecast for March was at -1.5%.
Pending home sales index rose by 3.2% in March, following 2% increase in February. According to the market analysts’ forecast it should have remained unchanged in March.

Know Any Good Free Forex Sites?

I am currently working on a project that has a lot to do with the free Forex sites. If you know any good free sites that offer information about trading, or some downloads, or EAs, or anything else interesting, please, post the URLs in a commentary below. If you own such site this is a good chance for you to promote it :). But the site should be free, I don’t need any affiliate or broker sites here. Just free informational Forex sites like this blog or fxstreet.com, for example. Thank you in advance.

EUR/USD Down as Stocks Fall Despite Good Fundamentals

EUR/USD declined fro the second day after rising earlier today as the stock markets failed to sustain a growth and corrected almost to a zero daily change after opening positively today. Very good fundamental reports were released in U.S. today and yesterday but they failed to inspire the markets for another bullish wave. EUR/USD is now trading near 1.3282.
ADP employment change was reported at -491k from March to April on a seasonally adjusted basis; that’s a positive value if you compare it to -708k decline during a previous month (revised upwardly from -742k). Forecasts showed -645k change for April.
Crude oil inventories increased by 0.6 million barrels last week and now total above 375 million barrels.
Yesterday, a report showed that the ISM services index rose from 40.8% to 43.7% in April. It was expected to go up only to 42%.

EUR/USD Trades with High Volatility after ECB Rate Cut and U.S. Employment Report

EUR/USD rose immediately after ECB announced a rate cut today but then began to fall sharply before the reports on the U.S. employment sector were released. Now it’s trading near 1.3360 — above its daily open level at 1.3312.
ECB decided to cut the interest rate by 0.25% today and now the Eurozone’s benchmark rate is at 1%.
Initial jobless claims were at 601k last week — down from 635k reported a week before. They were expected to remain at 635k level.
Nonfarm business productivity growth was reported at 0.8% for the first quarter of 2009 after posting 0.6% change in the fourth quarter of 2008 (revised down from -0.4%). This indicator was expected to come out near 0.6% today.

EUR/USD Rallies to Monthly High after Nonfarm Payrolls

EUR/USD rose for a second day today and reached the highest value in more than a month after the U.S. employment declined at a less than expected rate. Traders felt more confidence in the high-yielding assets and turned to stock and euro buying, dumping the low-yielding greenback. EUR/USD is now trading near 1.3488.
Nonfarm payrolls decreased by 539k in April instead of the expected 600k. In March they were down by 699k. The overall unemployment rate rose from 8.5% to 8.9% as expected.
Wholesale inventories were down by 1.6% in March, following 1.7% drop in February. Forecasts by the economic strategists showed -1% change.

Forex Technical Analysis for 05/11—05/15 Week



























































Floor Pivot Points
Pair3rd Sup2nd Sup1st SupPivot1st Res2nd Res3rd Res
EUR/USD1.26111.27881.30311.32081.34511.36291.3872
GBP/USD1.42081.43611.46411.47941.50741.52271.5507
USD/JPY92.6694.1496.6298.10100.58102.06104.54
EUR/JPY118.52121.44126.48129.40134.44137.36142.40














































Woodie’s Pivot Points
Pair2nd Sup1st SupPivot1st Res2nd Res
EUR/USD1.28041.30641.32251.34851.3645
GBP/USD1.43931.47051.48261.51381.5259
USD/JPY94.3997.1298.35101.08102.31
EUR/JPY121.97127.53129.93135.49137.89





























































Camarilla Pivot Points
Pair4th Sup3rd Sup2nd Sup1st Sup1st Res2nd Res3rd Res4th Res
EUR/USD1.30431.31591.31971.32361.33131.33511.33901.3506
GBP/USD1.46831.48021.48421.48821.49611.50011.50401.5159
USD/JPY96.9298.0198.3898.7499.4699.83100.19101.28
EUR/JPY127.13129.32130.05130.78132.24132.97133.70135.89



























Tom DeMark’s Pivot Points
PairEUR/USDGBP/USDUSD/JPYEUR/JPY
Resistance1.33301.493499.34131.92
Support1.29091.450195.38123.96























































Fibonacci Retracement
Levels
PairsEUR/USDGBP/USDUSD/JPYEUR/JPY
100.0%1.33851.494799.57132.33
61.8%1.32251.478298.06129.29
50.0%1.31751.473197.59128.35
38.2%1.31251.467997.13127.41
23.6%1.30641.461696.55126.25
0.0%1.29651.451495.62124.37




Two New Categories — Oil and Gold Trading Brokers


I added two new Forex broker categories to the site today — Forex brokers with gold trading and Forex brokers with oil trading. Recently I’ve noticed that many traders seek opportunity to trade on something other than plain old currency pairs. Apart from being able to trade currencies they usually also want to have an opportunity to trade oil or gold from time to time when there are some good fundamental conditions for such trades. These two new categories should help traders to find those Forex brokers that fit their oil/gold trading needs, while they will still be able to choose only those brokers that support their favorite payment method and trading platform.
By the way, I failed to find any Forex broker with oil trading that wouldn’t offer gold trading, though it’s not true for vice versa (not all gold trading brokers support oil trading). So, if you see an oil trading broker you can be almost 100% sure that it also has GOLD among its trading symbols. And almost all gold trading brokers feature not only gold but also silver and sometimes platinum, while more advanced brokers offer all possible precious (and sometimes not only precious) metals.

Real Scalping Contest from InstaForex


InstaForex has announced that the «Real Scalper InstaForex» contest will be held every week on Friday (full Friday trading session). It’s an extreme scalping contest that is performed on the real money accounts with $100 initial deposit and $1,500 prize fund. The rules are very simple — you register for the contest, fund the contest account with exactly $100.00 before Friday (server time) and trade all day on Friday to come with the highest balance out of all contestants. The prizes are distributed in the following way:
1st place — 500 USD;
2nd place — 400 USD;
3rd place — 300 USD;
4th place — 200 USD;
5th place — 100 USD.
It’s an curious thing to know that in the first «Real Scaler Contest» only 10 traders out of 200 registered deposited exactly $100.00 before Friday and thus every 2nd participant became a winner that time. Of course, all the account balance that remains after the contest can be freely withdrawn by the participants. This contest is a great opportunity for the scalpers and short-term intraday traders to earn money and prove their skills. All traders are able to easily follow up the contest progress through the ranking table.
If you are interested you may get more information about InstaForex and register for this contest.

EUR/USD Fails to Break Through Resistance on Global Trade Decline


The dollar was losing strongly during the early trading session today but failed to fall past its support and euro’s resistance level located near 1.3720, as the U.S. reported decline in its global trade and traders shunned the high-yielding assets. EUR/USD is now trading near 1.3622.
U.S. trade balance report for March showed an increase from $26.1 billion to $27.6 billion deficit today as the exports fell faster than the imports in U.S. The average forecasts pointed at about $29 billion deficit report.
Treasury budget report for April revealed $20.9 billion deficit, which followed $191.6 billion deficit in March (revised negatively from $159.3 billion). The budget deficit came out to be quite the same as the market participants expected.

Oil and the Euro tend to head in the same direction!



Today, I couldn’t help but notice that oil is around $59.50! The bottom was put in at around $33. So we’ve almost doubled off of the lows.
Why do I mention oil? Because oil and the euro tend to travel in the same direction (over time). This also helps to influence the dollar downward.
So in light of the U.S. dollar index breaking its uptrend line and falling below its 200 SMA…and the EUR/USD coming back up above its 200 SMA for the first time in a long time…and oil hitting “new highs”…I’d say it might be best to be a buyer of the euro vs. a short seller of it.
Therefore, look for buy signals in whatever time frame that you choose. We’re re-entering the era of a falling dollar once again. So even if you’re a short term trader, you want to keep that in the back of your mind and trade against the dollar. The best way to do this initially is through the euro (EUR/USD) since it’s where the next biggest pool of liquidity is for investors.
This is why they call it the “anti-dollar”. There’s no currency that has a higher inverse correlation to the dollar than the euro. Therefore, if you get bearish on the dollar, you’re automatically bullish on the euro.
Then once this “dollar downturn” strengthens, being long AUD/USD could be a great viable option as well based off of the superior fundamentals that they have on just about every other country right now