Gamestudio Links
Zorro Links
Newest Posts
C++ scripts
by AndrewAMD. 07/02/22 13:02
FXCM doesn't show up in Broker drop-down
by Smallz. 07/02/22 12:32
History & HistoryFolder
by DdlV. 07/01/22 14:57
car.c how to add a trailer or wagon?
by Ice2642. 07/01/22 13:35
IB: brokercommand to cancel **all** orders.
by AndrewAMD. 06/30/22 17:21
Save As dialog box (like file_select)
by jcl. 06/30/22 10:18
AUM Magazine
Latest Screens
DEAD TASTE
Tactics of World War I
Hecknex World
Scheherazade's Journey
Who's Online Now
2 registered members (AndrewAMD, 3run), 440 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Anas, PeroPero, AlexTomb, BigW, QJSH
18790 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
MT4, handling requote issues #485921
05/11/22 15:32
05/11/22 15:32
Joined: Aug 2017
Posts: 198
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 198
Netherlands
As for using the MT4 gateway and handling requote issues, the manual suggests to adjust the slippage.

I did this by allowing a large slippage:

Code
brokerCommand(SET_SLIPPAGE, 1000);


I try to control the execution prices by sending limit orders, like '- priceClose()' for the 'enterLong()', where 'EntryTime = 60'.

However, every now and then I still receive requotes with this royal slippage setting.

From the Zorro log:
Quote
[Wed 22-05-11 10:59] 10304 -29.96 14/15 (1.05499)
(AUD/USD::L) Long 17@0.700640 Entry limit
(AUD/USD::L) Entry limit 0.700640 hit by 0.700640 at 10:59:00
Warning 075 (AUD/USD::L) - can't open 17@0.70064 at 10:59:00


and from the MT4 log:
Quote
0 12:59:01.024 '587488': instant order buy 0.17 AUDUSD at 0.70064 sl: 0.00000 tp: 0.00000
0 12:59:01.232 '587488': requote 0.70056 / 0.70065 for open buy 0.17 AUDUSD at 0.70064 sl: 0.00000 tp: 0.00000


Are there any other things I can do to prevent requote issues with MT4? Is sending market orders the only final solution for this?

Last edited by Grant; 05/11/22 15:32.
Re: MT4, handling requote issues [Re: Grant] #485934
05/13/22 08:13
05/13/22 08:13
Joined: Jul 2017
Posts: 781
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 781
You can: 1) set Entry to appr. bid-ask mid-point
2) experiment with OrderLimit (and possibly OrderDelay) and/or make changes to the MT4 bridge EA to send real limit orders...and/or write your own brokerCommand() + handle cases when the order isn't executed in the time allowed

Re: MT4, handling requote issues [Re: Grant] #485936
05/13/22 11:24
05/13/22 11:24
Joined: Aug 2017
Posts: 198
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 198
Netherlands
Thank you Zheka for your suggestions!

As for 'less aggressive' limit orders, like a mid price, why would this help to prevent this from happening, other than a possible faster filling?

Regarding the OrderLimit. The manual states that MT4 won't treat this as an actual limit order, but will only create a 11 minute pending order.
Will this result in poor fillings, compared to a hard limit price?

The manual also states:
Quote
It is not recommended to use OrderLimit when limit orders are not properly supported by the broker.

So I'm not 100% sure if this is a good idea.

To make sure what works and what won't, I will start with brokerCommand(SET_WAIT,500) and observe how it behaves.

Edit: I see that this command isn't supported for MT4 access, so I will switch to market orders instead.

Last edited by Grant; 05/13/22 15:04.
Re: MT4, handling requote issues [Re: Grant] #485940
05/13/22 15:37
05/13/22 15:37
Joined: Jul 2017
Posts: 781
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 781
I would verify first that SET_SLIPPAGE is indeed working correctly.

Zorro is sending a market order as soon as the price reaches Entry. IF there are no re-quotes/issues when you don't use Entry (i.e. send market orders immediately), then the problem is probably with SET_SLIPPAGE.

Re: MT4, handling requote issues [Re: Zheka] #485943
05/13/22 16:05
05/13/22 16:05
Joined: Aug 2017
Posts: 198
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 198
Netherlands
I've added the SET_SLIPPAGE recently after I had requote issues before.

In my example above, Zorro sends a buy limit @0.700640.
Then a requote happens at '0.70056 / 0.70065' (I assume(!) this is the bid / ask price).
So the difference between my limit and the ask price is 0.00001.
My slippage is set at 1000 pips, which means 0.0001 x 1000 = 0.1, so that should be sufficient to overcome this small limit / ask offset, correct?

Re: MT4, handling requote issues [Re: Grant] #485947
05/13/22 20:37
05/13/22 20:37
Joined: Aug 2017
Posts: 198
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 198
Netherlands
It turns out that my MT4 demo account has a market maker connection.

Are there any other members here with a MT4 account with ECN/STP or DMA access who never experience any requote issues?

Re: MT4, handling requote issues [Re: Grant] #485956
05/14/22 23:47
05/14/22 23:47
Joined: Jul 2017
Posts: 781
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 781
The concept of "re-quote" per se doesn't exist at the 'free market'/exchange. As liquidity (volume-at-price) is 'consumed' or added, the execution price of a market order will be different from the price at the moment you sent your order. Such 'slippage' can be both positive and negative.

No, there are no 'requotes' with DMA/STP brokers; just bids/asks changing from moment to moment.

Re: MT4, handling requote issues [Re: Zheka] #485957
05/15/22 00:04
05/15/22 00:04
Joined: Aug 2017
Posts: 198
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 198
Netherlands
Originally Posted by Zheka
No, there are no 'requotes' with DMA/STP brokers; just bids/asks changing from moment to moment.


Thank you. This confirms what I've heard on other forums about the pros/cons between different broker/account types.

I've switched to an IC Markets demo account and will check the process for any possible re-quote issues.

Last edited by Grant; 05/15/22 00:04.

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1