|
Re: [Test] mode: Simulate both market *and* limit orders
[Re: jcl]
#486252
07/06/22 12:51
07/06/22 12:51
|
Joined: Feb 2017
Posts: 1,731 Chicago
AndrewAMD
OP
Serious User
|
OP
Serious User
Joined: Feb 2017
Posts: 1,731
Chicago
|
But why do you need trade ticks at all? Order filling is caused by ask and bid, not by trade ticks. Are you sure? Bid and ask price are market prices and are therefore relevant to market orders. But sometimes, when a trader has a buy limit order around bid price, another trader will sell at market, filling the limit order to the buyer's advantage. It is difficult to realistically simulate these kinds of fills without trade ticks. This is also why IB offers Midprice, Pegged-to-Midpoint, Pegged-to-Primary, etc. orders, because there are people on the opposite end of the trade who will fill these orders. I have a client that wants to trade better-than-market prices by placing limit orders somewhere between bid and ask.
|
|
|
Re: [Test] mode: Simulate both market *and* limit orders
[Re: jcl]
#486257
07/06/22 14:46
07/06/22 14:46
|
Joined: Aug 2021
Posts: 101
MegaTanker
Member
|
Member
Joined: Aug 2021
Posts: 101
|
A limit order is filled when an order book entry matches the limit. They're also filled when your limit order is on the top of the order book and someone places a market order, thereby taking your order from the book. These market orders never make it to the order book, no? I think using ask/bid data is close enough for simulation but this data usually doesn't have size attached to it (but from some sources it might) whereas trades data tends to have the trade size attached, therefore you can accurately simulate how much of your order would be filled.
|
|
|
Re: [Test] mode: Simulate both market *and* limit orders
[Re: AndrewAMD]
#486258
07/06/22 14:47
07/06/22 14:47
|
Joined: Feb 2017
Posts: 1,731 Chicago
AndrewAMD
OP
Serious User
|
OP
Serious User
Joined: Feb 2017
Posts: 1,731
Chicago
|
Question: How does Zorro simulate this order? When does it fill, and at what price?
Buy order, one lot, Entry = -1000.0 (i.e., entry limit is 1000.0). (This is to simulate a limit buy order at 1000.0.)
Scenario A) Bid = 999.0, Ask = 1001.0 Scenario B) Bid = 1000.0, Ask = 1002.0 Scenario C) Bid = 1000.1, Ask = 1002.1 Scenario D) Bid = 998.0, Ask = 1000.0 Scenario E) Bid = 997.9, Ask = 999.9
|
|
|
|