- ago
Whilst WLD7 does a good job at holding the order for release at (preference) indicated time before market close, some exchanges do not recognize MOC orders. Is there a way to have order manager release the order as plain market order (instead of MOC)?
If not, can we add an option in preferences to do so- many thanks
Michael
0
596
Solved
28 Replies

Reply

Bookmark

Sort
Cone8
 ( 29.06% )
- ago
#1
QUOTE:
Is there a way
This is too specific to make a special option for this special case. The way to do it would be to send the market orders yourself near the market close.

If it needs to be auto-traded, you could create a single strategy that reads a file of MOC-orders-for-exchanges-that-don't-support-MOC and places all those orders at a designated time. If you need help with that strategy, I could whip it up for you in about 5 minutes - with bugs, maybe 15 without bugs :)
0
- ago
#2
Thank you - I would need the coding help, appreciate it
0
Cone8
 ( 29.06% )
- ago
#3
Let's call these orders "MMOC", which means to send a market order near the session close.

First, let's think of the simplest solution...

How are the MMOC orders generated? Could the script be set up to Stage the orders in the Order Manager and then you'd manually click Place at the right time?
0
- ago
#4
Ideally the script would automate the conversion of MOC to MMOC and release at pre-set times. WL7 seems to know the stock market associated with a symbol (US Markets, LSE, etc...). Could the script check "Markets and Symbols" to obtain closing time for the release, then release MMOC at closing less (trading preferences) mins?

If too complicated, then the script could have a time variable set at the relevant release time and do the rest above

Thank you
0
Cone8
 ( 29.06% )
- ago
#5
Sure it could do that, but you didn't say how these orders are generated.

Is it a Daily or intraday strategy that create the MOC orders?
If intraday, what interval?
Are you using Streaming windows? Strategy Monitor?
Which broker(s)?
0
- ago
#6
the strategy runs every morning on daily data for a single symbol, as part of a broader meta strategy that ends up delivering market or market close orders to interactivebrokers.

hence it would be interesting if the new MMOC script can run sometime later during the day to pick up and convert MOC orders from the order manager, just a thought
0
Cone8
 ( 29.06% )
- ago
#7
Tell me if this is right.

1. You have a strategy that generates MOC orders.

2. Since you said "U.S. Markets", around 8000 of the stocks you potentially trade do support native MOC orders, and you want to use MOC orders for those.

3. For other markets, you want to save the MOC orders to a file that can be read later, and transmitted as Market (MMOC) orders near their respective session close.

0
- ago
#8
here are the responses:
1 - yes, the strategy however can run multiple times for different single equities with their specific parameters (not PV or WFO)
2- yes, US orders would not necessarily need conversion to MMOC - unless someone from another forum discussion wants to change the code and issue limit orders instead of MOC (ie LMOC)
3 - yes , non-US would need change to MMOC. However I was not thinking about storing MOC orders on a separate file but simply letting the strategy place them into order manager without any change. Could the script then pick up MOC orders from order manager and change them to Market orders prior to closing time.
0
Cone8
 ( 29.06% )
- ago
#9
Since the strategy uses the Daily scale, there's no chance for it to activate on it's own to auto-place the order. The concept it to create a "MMOC Strategy" that's running on 1-minute bars (the symbol doesn't matter). When a new bar is added, it executes and can check an external file for trades to place and at what time.
0
Glitch8
 ( 12.31% )
- ago
#10
Am I missing something, but couldn't the strategy submit a MarketClose order, which WL would then submit as a market order a specific number of minutes before the actual close as configured in Trading Preferences?
0
Cone8
 ( 29.06% )
- ago
#11
@Glitch, the broker supports MOC (so a MOC order will be placed) but MOC isn't available for all markets being traded. My impression is that a MOC order would fail for this case.
0
Glitch8
 ( 12.31% )
- ago
#12
But can't you turn off MOC and allow just a market order to be placed a minute before market closing time?
0
- ago
#13
correct, it's all about market close timing and order release management as market order
0
- ago
#14
I like the proposal by Glitch - changing MOC to Market order and sending 1 minute before close (MMOC).
a) can you help with the code as previously suggested or
b) should this become part of feature request for LOC (limit on close) by adding a MMOC (market on close). I assume both could be sent 1 min before close
Thank you
0
Cone8
 ( 29.06% )
- ago
#15
We're taking care of this in Wealth-Lab 8 (unofficial release date is 10 April 2022!)

There's a new option to "Use MOC". If you leave that unchecked, it will send a regular market order the number of minutes you specify in the preference below.

1
Best Answer
- ago
#16
brilliant - thank you
0
- ago
#17
Trying to issue a marketclose transaction to Frankfurt exchange at 17:15 cet (reg.close is 17:30). As per #15, I have tried MOC unclicked with 900 seconds lead time as per pic. The order is not sent to the exchange at 1715 nor later. I may probably be doing something wrong. Do below settings need any change to achieve a 17:15 market execution of a marketclose coded transaction?

Thank you


0
Cone8
 ( 29.06% )
- ago
#18
I mistyped, so I'll change that - needs to be checked.
The proper guidance is in the User Guide for that Preference. Open the Trading Preferences page and hit F1. I'll just copy it here -

-[ ] Use MOC (Market-on-Close) when Possible
Behavior 1:
When selected, broker providers that support MOC will place a MOC order instead of a regular Market order for OrderType.MarketClose, which work in conjunction with the preference: MarketClose/LimitClose Orders submit how many seconds before market close (see below).

Behavior 2:
If Use MOC is not selected or if not supported by the broker, Wealth-Lab will place a regular Market order for OrderType.MarketClose at the predetermined number of seconds before the end of the session.

Edit -
Wow, that looks wrong too! In both cases MOC needs to be selected to get the behavior! (But I'm going to make sure first.)
0
Cone8
 ( 29.06% )
- ago
#19
Okay, I think everything is okay. If MOC is not checked Wealth-Lab won't attempt to place an order as a MOC order type.

However, if you place a MarketClose order, it means you want that functionality. The order below was placed manually with MOC not checked. It's in the "WaitForClose" state and will be placed as a regular market order the number of seconds I specified before the close. (For this case you'd usually use 60 seconds or less.)

0
- ago
#20
Tested today again without success... however I think we can start narrowing down the issue.

Specifically - I am selling EXS2, Frankfurt exchange at 17:15 with a marketclose strategy instruction. The symbol is defined in WL8 as EXS2.DE for Yahoo updates and traded by IB as EXS2. In a prior discussion Cone had advised to update IBContracts.txt with:

EXS2.DE=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|

The translation works for buy/sell orders using EXS2.DE as symbol - and traded as EXS2 by IB.

The issue appears to be with the marketclose instruction not finding the open position in IB (see below error message from order manager).



If I edit the symbol on the strategy order line to EXS2, order manager will accept the order and hold it for marketclose execution. However - nothing happens between cet 17:15 and 17:30. Order manager may be treating EXS2 as a US stock (22:00 cet close).



the last pic is to illustrate the sequence (done after market close in Frankfurt) - I cancelled the original marketclose order and executed manually in IB.

To sum up. I suspect marketclose orders are not properly translating symbols from IBContracts.txt, as regular buy / see orders do.

Thank you

0
Cone8
 ( 29.06% )
- ago
#21
QUOTE:
To sum up. I suspect marketclose orders are not properly translating symbols from IBContracts.txt, as regular buy / see orders do.
The order type doesn't affect how the contract is identified. And, it's correct otherwise the "regular buy / see orders" wouldn't work. Also, with "Use MOC" unchecked, the MarketClose order is placed as a regular market order anyway.

QUOTE:
not finding the open position in IB (see below error message from order manager).
So actually, the order was processed to be transmitted, but the matching position couldn't be identified. Did you happen to look at the Accounts tool to see if it showed up there?

QUOTE:
the last pic is to illustrate
It illustrates to me that you're using two different symbols EXS2.DE and EXS2.

Next time, check the Accounts tool to see what Wealth-Lab finds in your account. This should be very accurate! And, make sure you're using the same symbol when you exit it.
0
Cone8
 ( 29.06% )
- ago
#22
Theoretically, if you have both these records in IBContracts.txt, then it shouldn't matter which of the two symbols you use. Did you already do that?
EXS2=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|
EXS2.DE=EXS2|EUR|STK|SMART|IBIS|EXS2|||0|
0
- ago
#23
QUOTE:
The order type doesn't affect how the contract is identified. And, it's correct otherwise the "regular buy / see orders" wouldn't work. Also, with "Use MOC" unchecked, the MarketClose order is placed as a regular market order anyway.


MOC was checked - I forgot to mention

WL8 sell/buy orders work for EWS2.DE, marketclose dont. NO sense to make separate entries in IBcontracts to circumvent a bug
0
Cone8
 ( 29.06% )
- ago
#24
Creating 2 contracts is a work-around for you using 2 different symbols in order to identify the same contract. But that probably won't save you either because the different symbols won't match when the Order Manager tries to synchronize the Position for the exit.

Use the same symbol when you exit. I don't care which one, but check which one shows up in the Accounts tool.
0
- ago
#25
Accounts show the open position symbol as EXS2
How would I update data from Yahoo if symbols were converged to EXS2?
(currently using EXS2.DE for data updates by Yahoo and EXS2 translation for IB trades)
Thank you
0
- ago
#26
QUOTE:
How would I update data from Yahoo if symbols were converged to EXS2?

You can't, but vote for this feature request:
Add Symbol Mappings for Historical Providers
1
Cone8
 ( 29.06% )
- ago
#27
We can identify the correct contract with either symbol using IBContracts.txt, and, if you trade only using EXS2, the IB Symbol, there are no problems. But there are a couple other issues to look into when using other mappings.

1. Cosmetic
If you trade in and out using EXS2.DE, everything also works, but while holding the position, both EXS2.DE and EXS2 are shown in the Accounts tool. I don't know why!

2. The big problem is if you start with EXS2.DE and then try to trade out with EXS2. Now since this was a manual trade, it goes through without a problem and although IB sells the Position, we're left with an artifact of a Position in Accounts.



We'll get a better handle on this, but for now, just don't switch symbols and I think you shouldn't have a problem.
0
Cone8
 ( 29.06% )
- ago
#28
I would have expected this manual trade to go through and result in a short position since the Accounts tool "thought" there was a position in EXS2.DE. Instead, the Position matching wouldn't allow the sale - which is actually good since we didn't intend to short.

0

Reply

Bookmark

Sort