* You are viewing the archive for the ‘MT4’ Category

MetaTrader 4 Error 136 – Off Quotes

I have been running this particular expert adviser on Oanda for some time and it’s been working great.  Probably about a week ago, I began to get this error 136 off quotes error when it sent out the OrderSend command.  I contacted Oanda support and posted the question on Oanda forum, but the only reply I got from Oanda was, “We haven’t heard from other customers complain about this problem.  We do not provide programming support or advice.  Please blah blah blah…”

How could one thing work for a long time and break all of a sudden?  I asked Oanda if they changed something but no response was given.  Looks like I had to figure it out on my own.

I Googled and Googled and the discussion was circling around timing of the order, delayed quotes, etc.  So I changed the slippage to 5 pips in my script and also the default setting on MT4.  None of them worked.  The ‘off quotes’ error continued to happen.

So I decided to change each parameter in the OrderSend command to see which one was giving me the grief.  Then I found it.

My original command looked as follows:

OrderSend(Symbol(),OP_SELLLIMIT,lots,mid,3,0,mid-tp*Point,”expert comment”,255,TimeCurrent()+(PERIOD_M1*60)*14,CLR_NONE);

Oanda originally accepted the expiration on MT4 at the minimum of 10 minutes if I remembered correctly.  Mine was set at 14 minutes.  See the formula highlighted in orange above.

Somehow they decided to synch up with the FxTrader Java platform on which the minimum of order expiration was 1 hour.

After I changed the command to

OrderSend(Symbol(),OP_SELLLIMIT,lots,mid,3,0,mid-tp*Point,”expert comment”,255,TimeCurrent()+(PERIOD_M1*60)*60,CLR_NONE);

The expert adviser now works.  However, I don’t want to leave my order out there for an hour.  So I have to write some code to delete the unfilled order after 14 minutes as I had originally programmed.

 

 

 

 

Can You Change Time Zone on MetaTrader 4?

Unfortunately, the time zone can only be changed from the server side, i.e., the broker.

Time zones used by the MT4 brokers:

Interbank FX:  GMT

FXCM & Forex.com:  EST  (GMT – 5)

MIG:  CET (GMT + 1)

Alpari:  CET (GMT + 1)

FXDD:  GMT + 2

 

 

U.S. Based MetaTrader 4 Forex Brokers

Three brokers I am aware of are the U.S. based:  Interbank FX, FXCM, and Forex.com

I thought Interbank FX wasn’t bad as a MT4 platform broker.  Their spreads aren’t the best, not the majors are ok.  The spreads for Euro-Dollar, Dollar-Yen, and Euro-Yen are 2, 2, and 4 pips respectively.  They do widen the spreads during news announcement, but who doesn’t.

FXCM and Forex.com are also offering MT4 in addition to their own proprietary trading platforms.  However, their spreads on MT4 are wider than the ones on their own trading platforms.  In addition, their spreads are not consistent.  I don’t think I like the idea of spreads being changing all the time.  For example, on both MT4 with the two brokers, I have seen Euro-Yen spreads changing from 3 pips to 6 pips during non-news event times.

But the best way for you to find out which MT4 broker suits you is to test your strategy on their demo accounts.

 

 

Where Can I Find Forex Historical Data?

On dukascopy.com, they actually provide the historical data in multiple formats and various time frames.

If you are using MT4, you can get the data directly from the platform.  First, open the chart of the currency pair and time frame you’d like to retrieve the data.  And then just select File / Save As…

Save Forex currency historical data in MT4

 

 

Switch to our mobile site