Feed

OrderSend Error 129 — What to Do?

by shahid hussain on Monday, May 11, 2009,

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 <>
{
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.


Forex Technical Analysis for 05/04—05/08 Week

by shahid hussain

EUR/USD trend: sell.
GBP/USD trend: hold.
USD/JPY trend: sell.
EUR/JPY trend: sell.

Floor Pivot Points
Pair 3rd Sup 2nd Sup 1st Sup Pivot 1st Res 2nd Res 3rd Res
EUR/USD 1.2567 1.2726 1.2983 1.3142 1.3399 1.3558 1.3816
GBP/USD 1.4025 1.4210 1.4444 1.4629 1.4862 1.5047 1.5281
USD/JPY 93.29 94.96 96.06 97.73 98.83 100.50 101.60
EUR/JPY 123.18 124.63 126.64 128.09 130.10 131.55 133.56
Woodie’s Pivot Points
Pair 2nd Sup 1st Sup Pivot 1st Res 2nd Res
EUR/USD 1.2750 1.3033 1.3167 1.3449 1.3583
GBP/USD 1.4222 1.4468 1.4641 1.4886 1.5059
USD/JPY 94.82 95.78 97.59 98.55 100.36
EUR/JPY 124.77 126.92 128.23 130.38 131.69
Camarilla Pivot Points
Pair 4th Sup 3rd Sup 2nd Sup 1st Sup 1st Res 2nd Res 3rd Res 4th Res
EUR/USD 1.3012 1.3126 1.3164 1.3203 1.3279 1.3317 1.3355 1.3470
GBP/USD 1.4447 1.4562 1.4600 1.4639 1.4715 1.4754 1.4792 1.4907
USD/JPY 95.64 96.40 96.65 96.91 97.42 97.67 97.92 98.69
EUR/JPY 126.75 127.70 128.02 128.34 128.97 129.29 129.61 130.56
Tom DeMark’s Pivot Points
Pair EUR/USD GBP/USD USD/JPY EUR/JPY
Resistance 1.3479 1.4955 99.67 130.83
Support 1.3063 1.4536 96.90 127.36
Fibonacci Retracement Levels
Pairs EUR/USD GBP/USD USD/JPY EUR/JPY
100.0% 1.3301 1.4814 99.40 129.54
61.8% 1.3142 1.4654 98.34 128.21
50.0% 1.3093 1.4604 98.02 127.81
38.2% 1.3043 1.4555 97.69 127.40
23.6% 1.2983 1.4494 97.28 126.89
0.0% 1.2884 1.4395 96.63 126.08


Forex Market is Closing Down

by shahid hussain on Monday, April 6, 2009,

Some people predicted it long ago, but no one really believed it until today. It was announced by the BIS (Bank for International Settlements), IMF (International Monetary Fund) and the world’s leading private banking institutions that the traditional Forex market is going to be closed very soon. The retail Forex market attracted to much attention from the general public, creating riches for some and making others poor. It was decided that all on-line Forex brokers should be closed during the next 4 weeks, with all currently remaining traders’ funds donated to the various charities throughout the world. The governments of the G20 countries will discuss the creation of a single super-national Forex broker that will offer just a single currency pair for retail trading purposes — OCD/ZRP (Oceanian Dollar/Zeldian Rupee), with the daily trading volume of about 15,000 units. The registration with the new broker will be limited only to all currently existing Forex traders, so that no new traders will be appearing.


EUR/USD Down Slightly after Series of Reports

by shahid hussain

EUR/USD fell from 1.3242 to 1.3222 (only 20 pips) today. The news reports from U.S. were mixed, but they were bad enough to destroy the market optimism and shift the focus on the Forex from the dollar’s weakness to tomorrow’s ECB rate decision.

According to ADP report, the private nonfarm employment declined by 742k in March after falling by 706k in February (revised down from 697k). The report was expected to show an improvement to 663k decline.

Construction spending fell by 0.9% in February, following 3.5% decline (revised down from 3.3% drop) in January. Traders expected a decline by 1.9%.

ISM manufacturing index (PMI) rose from 35.8% to 36.3% in March. A growth to 36% was expected.

Pending home sales index increased by 2.1% in February after declining by 7.7% in January. According to the median forecast it was expected to remain unchanged.

U.S. crude oil inventories rose by 2.8 million barrels last week, continuing its gaining streak.


Euro Peaks High against Dollar as Rate Cut is Slow

by shahid hussain

EUR/USD rose at a very fast pace today, posting the biggest daily gain since March 18 so far. Mixed news on the U.S. fundamental indicators didn’t affect the trading much as the Forex traders looked at the ECB’s rate cutting action. EUR/USD is currently trading near 1.3413.

Last week initial jobless claims were reported at 669k, which is 12k above than 657k (revised up from 652k). Traders expected a small decline to 650k, but the employment sector is still in its worse state in U.S.

Factory orders increased by 1.8% in February — for the first time after six months of decline (in January they decreased by 3.5%). The forecasts showed 1.5% growth for February.

European Central Bank cut the Eurozone interest rate from 1.5% to 1.25% today, while the markets were almost sure that the rate will be slashed to 1%. This caused a lot of optimism for euro bulls and the currency is dominating the market at this moment.


Japanese Candlestick Patterns

by shahid hussain

Many traders ask me for the detailed descriptions of the Japanese candlestick patterns that are detected by the MT4 indicator Pattern Recognition Master. So, here’s the list of the patterns that it can recognize with the corresponding chart pictures and signal descriptions:


Bearish patterns
Shooting Star Shooting star. Can signal an end of the bullish trend. Should be confirmed by other patterns. The longer is the shadow the stronger is the signal.
Evening Star Evening star. Acts as a stronger trend reversal signal. Note that the shadows should be very short and the body shouldn?t large as well.
Evening Doji Star Evening doji star. Almost the same as previous, but some traders consider it a stronger signal.
Dark Cloud Pattern Dark cloud pattern. The two-candle pattern is ending the bullish trend. Note the opening of the second candle — it should be above the first one?s close. Second candle should close below the 50% of first candle?s body. Both bodies should be long enough. Moderately strong signal.
Bearish Engulfing Pattern Bearish engulfing pattern. This two-candle pattern appears at the end of the uptrend. Second (bearish) candle should open higher than first candle?s high and should close above the first one?s low (completely engulf it). Moderately strong signal.


Bullish patterns
Bullish Hammer Bullish hammer. Can signal an end of the bearish trend. Should be confirmed by other patterns. The longer is the shadow the stronger is the signal.
Morning Star Morning star. Acts as a stronger trend reversal signal. Note that the shadows should be very short and the body shouldn?t large as well.
Morning Doji Star Morning doji star. Almost the same as previous, but some traders consider it a stronger signal.
Piercing Line Pattern Piercing line pattern. The two-candle pattern is ending the bearish trend. Note the opening of the second candle — it should be below the first one?s close. Second candle should close above the 50% of first candle?s body. Both bodies should be long enough. Moderately strong signal.
Bullish Engulfing Pattern Bullish engulfing pattern. This two-candle pattern appears at the end of the downtrend. Second (bullish) candle should open lower than first candle?s low and should close above first one?s high (completely engulf it). Moderately strong signal.

If you never hear about Pattern Recognition Master before and don’t want to detect these patterns on your own, then you can simply download this wonderful indicator.


LiteForex Announces Special Promotion for Certain Countries

by shahid hussain

LiteForex broker announced a promotion campaign for the Forex traders from the following list of countries: U.S., Nigeria, Brazil, Thailand, Malaysia, Indonesia and Russia. Anyone who opens account between the April 1st to June 30th, makes his first deposit and applies for participation in the campaign will receive 10% bonus on their deposit (up to $10,000). The profit from the trading with this bonus can be freely withdrawn, while the bonus itself can be withdrawn only after a certain amount of traded positions — 20 positions should be closed with no less than 1% of original deposit taking part in them.


Looking for something?

Search the Site

If you can't find what you are looking for, please leave a comment somewhere, subscribe to our feed and hopefully your question will be answered shortly, so please visit again!