OrderLimit support and behaviour

Posted By: Sphin

OrderLimit support and behaviour - 03/04/18 13:23

Does the FXCM API support OrderLimit? If not is there any broker known that does?

As far as I know something like this should be prevented by OrderLimit or is it still a matter of slippage? From trade log:
Code:
[1158: Fri 18-03-02 14:17:01] (1.37795)
2018-03-02 14:17:55.4555
Asset: GBPUSD_FXCM, Price: 1.37750, Spread: 0.00001, Commission: 0.00007
OrderLimit: 1.37746
[GBPUSD_FXCM::S5254] Short 1@1.37694  at 14:17:55.


Is there a chance to simulate OrderLimit if it is not directly supported by the API or on MT4 accounts?

Thanks, Sphin
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/05/18 13:15

You limit order to sell was below Bid and so got immediately converted into market.
Which - given your latency and a fast falling market - resulted in a significant slippage.

This would happen regardless of the broker/API.

Frequency of price updates from the API is another thing that will influence this behaviour(to be changed via TickTime).
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/05/18 16:46

Sure?
Quote:
OrderLimit
Send a limit order at the given limit price, instead of a market order, to the broker at the next enterLong or enterShort call. This is different to an Entry limit. It does not produce a pending trade, but cancels the order if it is not filled within a few seconds, dependent on broker API. If the broker API supports limit orders, this guarantees a fill price at or better than the limit. [...]
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/05/18 17:50

I am not familiar with nuances of FXCM plug-in.

But logically:

- if the plug-in does not support OrderLimit, then most probably the order went as just the market order

- if the plug-in does or were to support OrderLimit, then the order would be directly sent as 'limit' to the broker, where it would be subject to the usual limit order handling rules I described above.
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/05/18 18:35

Logically I would say that
Quote:
if the plug-in does or were to support OrderLimit, then the order would be directly sent as 'limit' to the broker, where it would be subject to the usual limit order handling rules I described above.

and
Quote:
If the broker API supports limit orders, this guarantees a fill price at or better than the limit.

are not the same. The usual limit behaviour should be already covered by 'Entry', at least it is explained in the manual similar to your description. But who knows.
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/05/18 19:54

Quote:
If the broker API supports limit orders, this guarantees a fill price at or better than the limit
This will normally be true if the limit price is "same or better" than the current.
But in this case it was "worse".
So, the order - already at the broker - got converted to market BY THE BROKER (nothing Zorro can do about it by then).
And in a fast falling market (with liquidity quickly removed on the bid side, i.e.bid price falling even faster) and with latency, you got 'slipped' vs the desired limit price.

Change the limit price to bid-ask mid-point. OrderLimit will then work as intended: if not executed quickly, the order will get cancelled and you can resubmit it again to chase the moving price but still guarantee favourable execution.
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/06/18 19:07

If it works this way then it does.

My intention was to sell only if I get at least 1.37746 otherwise cancel the trade. But this is only possible if the actual bid is below my limit otherwise sending a market order has the same effect? That's bad because I simply don't know if the next price is above or below it so I have to guess. There is no other chance to realize this?
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/07/18 10:26

What happened is quite a rare event, a very special case.
Had the movement been less swift, you would get executed at "market" - which will be better than 1.37746...
Of course, if the strategy is to trade around "news", then such situations might be happening more often.
Please give more details of a typical situation/approach.

What will help in any case is reducing latency between you and the broker, including: server location, frequency of price updates by Zorro, tuning of NIC/OS settings, efficiency of code, CPU speed.
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/07/18 18:37

Quote:
Change the limit price to bid-ask mid-point

I hope to do it right but there seems to be not the desired effect:

2018-03-06 11:22:39.994
Asset: EURUSD_FXCM, Price: 1.23605, Spread: 0.00002, Commission: 0.00007
OrderLimit: 1.23604
[EURUSD_FXCM::L8224] Long 1@1.23701 at 11:22:40.

2018-03-07 09:17:29.427
Asset: GBPUSD_FXCM, Price: 1.38658, Spread: 0.00002, Commission: 0.00007
OrderLimit: 1.38657
[GBPUSD_FXCM::S6627] Short 1@1.38636 at 09:17:29

Do I have to set also a value for Entry when using OrderLimit? Up to now I didn't.
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/07/18 19:59

I do not think you need Entry with OrderLimit; but you can experiment with Entry instead of OrderLimit.

The above is strange. Need to ask support if/how exactly Limit orders are supported with FXCM.
What if you set OrderLimit price 1 pip below bid (for long) in a calm market? Will it work properly at all?

What's your latency to FXCM server?
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/08/18 18:20

Quote:
Need to ask support if/how exactly Limit orders are supported with FXCM.

This was my first sentence within this thread. laugh Normally I ask those questions, that might be also interesting to others, in the forum.

OrderLimit is available when the SET_LIMIT command is supported by the broker API (manual). Because SET_LIMIT is not listed in the manual at the FXCM API and because of my experience from above I guess it isn't supported by FXCM. As far as I can see only IB API supports SET_LIMIT propperly (MT4 does strange things).
Posted By: jcl

Re: OrderLimit support and behaviour - 03/09/18 08:45

Yes, AFAIK OrderLimit is only for IB and the new Bittrex plugin at this point.
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/10/18 14:49

But OrderLimit is the only way to get surely filled at the limit price or better (or the trade will not be filled at all and is cancled) while using Entry limit Zorro sents a market order if the price crosses the limit resulting in slippage etc. or cancles the trade after EntryTime?
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/10/18 16:34

Yes, but in a normal market it is more likely to be positive slippage.
For it to be negative, price has to just touch the limit and immediately retreat.

The danger is during volatile markets. Zorro triggers everything on Ask, and Ask and Bid can spike, triggerring stops/limits. So, negative slippage is more likely on the Short entries.
Some brokers add "Order execution options" to prevent such situations. https://alpari.com/en/trading/ecn_settings/

Since Entry limits are not sent to the broker anyway, you will be better off tracking the price mid-point in the script and just sending a market order yourself.

Of course, if the game is to "catch" a guaranteed fill during the news release then you need real limit orders residing at the broker server.
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/10/18 18:45

Quote:
Some brokers add "Order execution options"

So does FXCM, but it seems only via Tradestation and not via API.
Posted By: Zheka

Re: OrderLimit support and behaviour - 03/10/18 19:28

https://www.fxcm.com/uk/trading-services/api-trading/compare-api/
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/11/18 10:38

Maybe the version of Forexconnect on which the FXCM plugin is based (' the FXCM plugin uses an older and more stable version of the API') did not support OrderLimit. Another reason for a more common usable FIX plugin.
Posted By: Sphin

Re: OrderLimit support and behaviour - 03/31/18 17:36

At last I must agree to you, there should be really a better implemenation of limit orders at least if the API supported it anyway. As far as I read about MT4 there seem to be indeed no limit orders beside of pending orders until the price hit the limit and then change them to market orders but e.g. as you quoted the FXCM APIs can and I heard in MT5 real limit orders should also be possible.
Posted By: jcl

Re: OrderLimit support and behaviour - 04/03/18 08:18

Except for MT4, most APIs normally support limit orders. They are normally implemented in new broker plugins and will be eventually also implemented in updates of older plugins.
© 2024 lite-C Forums