Fidelity MOO and MOC order
Author: richard1000
Creation Date: 10/10/2013 4:44 PM
profile picture

richard1000

#1
I noticed Fidelity orders have MOC and MOO orders under their TIF choices. Of course, no such order is available in WL. Any chance such order could be available under WL trade tickets or strategy windows.

profile picture

Cone

#2
Anything's possible.

Currently, the AtClose trade type isn't used for live trading, but it could potentially be modified (perhaps with an overloaded parameter) to signal a MOC order in a Strategy. I'd think adding it to WLP's trade ticket would be pretty straightforward.

Unless I'm missing something, I really don't see a use for MOO in a strategy or trade ticket since you can already place an AtMarket order before the open to execute MOO.

Anyway, let your Fidelity reps know that you want this feature in Wealth-Lab, and they'll pass it up the chain.
profile picture

sedelstein

#3
Hello Cone

QUOTE:
Unless I'm missing something, I really don't see a use for MOO in a strategy or trade ticket since you can already place an AtMarket order before the open to execute MOO.


There really is a use for the MOO tag in WL

If you place a market order, Fidelity may send it anywhere and your fill will often be different than the "official" open
I have recently been taking the market orders that WL generates and inputting them in Active Trader Pro and tagging the TIF as Market On Open
for Nasdaq orders at least. These then get placed into the Nasdaq crossing system. This is the only way I have been able to actually achieve the price that is officially called the open and is what WL has in their datasets. (Same for MOC as well) I am MUCH happier with the fills I've been getting.

Being able to tag these orders in WL would be a great help.

Is this possible? Your thoughts?

profile picture

Cone

#4
In the last several months I've learned about the difference between a generic market order placed before the open and a MOO order. The MOO participates in the primary market's auction, so you get a fill that you can count on. As you said, the market order can execute anywhere.

I too would like to see a MOO option for Wealth-Lab Pro, and I'll definitely raise the issue to Fidelity decision makers. It always helps for customers to call in requests too.
profile picture

sedelstein

#5
Call made to the guy at Fidelity, Merrimac NH who handles customers. He talks directly to the developers for customers.

I think you adding in will help more than my call, so thanks

They are also looking into an issue w/ automated trading for me. In a limited margin IRA, I couldn't stage/place an order as a margin or a cash trade and had to quickly go over to ATP to execute. Might have been because it was a very short hold and might not have cleared yet. Still waiting to hear from them on that.
profile picture

Cone

#6
I've got the answer for the margin trading issue: It won't always work in WL Pro and it deals with Intraday Buying Power (check this in AT Pro under Accounts > Balances)

When your Intraday Buying power drops below the amount of your next purchase, the Fidelity back-end creates an order preview message that you must acknowledge. In WLP there's no vehicle to acknowledge that "preview", and therefore an order error results. In fact, if you select "Skip Preview" in ATPro's Trade > General preferences, you'll get the same error.
profile picture

sedelstein

#7
Thanks Cone

Did you get that from the Fidelity developers? The electronic trade support representative I spoke with has them looking into the issue.
I don't want to make them chase down a known issue but it would be great if they came up with a solution so that I can autotrade the IRA
profile picture

Cone

#8
It's from personal experience.

And see the clues here: https://www.fidelity.com/trading/faqs-margin
Limited margin for IRAs > How does it work?
profile picture

sedelstein

#9
Recently started trading a strategy that uses MOO and MOC orders. I've been using Active Trader Pro to enter these orders as still no ability to do this in WL. Turns out BUY orders Moo or MOC can be entered easily in ATP. Covering a short position can be done as well but you cannot alter the TIF (time in force) field for shorting Moo or MOC..... day only. I have to place these by phone with the active trader desk!

Any chance this can be brought to the developers attention once again?

Thanks........

P.s. The fills I am getting are the posted opens and closes so I am matching what I've tested in WL
profile picture

Cone

#10
Call Fidelity to submit a customer request for new trading features for WLP. It's already in my list along with another 30 or 40 features that users would like to see added.
profile picture

sedelstein

#11
Done that. I won't be holding my breath ;->)
profile picture

sedelstein

#12
I have a question related to this. Eugene, if you think it should go in a different thread, apologies in advance.

First a little background.

I have a strategy I like that goes long and short a number of tickers. The strategy as tested uses buy/short at market open or market close which as discussed above via cannot be generated via WL. I was willing to use Fidelity's Active Trader Pro (ATP) to enter the orders by hand. Rather tedious but I like the results and want to trade it.

It turns out that ATP will let you enter a buy or sell order MOO or MOC but will not let you enter a SHORT MOO or MOC, only day orders.
I've called the active trader desk and they were able to use their in house software to enter a short MOC order but they themselves were unable to enter a short MOO order. They are both valid market orders and it would be great to get the official opening or closing cross price. It's very odd and I have spoken w/ Fidelity's Merrimac NH office who have raised the issue with "senior management"

My question here is about how I can use WL and one minute data to see how the strategy might work if I were to forgo using the opening closing crosses and instead execute the trades at 9:31, or 9:32am etc....and 3:59pm or 3:58pm (I am on the East Coast) and see if the strategy degrades.

I am not looking for anyone to code this but perhaps some helpful suggestions as the best way to go forward and test this within WL and hopefully something less vague than use multiple time frames. Has anyone tried this sort of test?

Thanks



My initial thought is to output the trades to Excel (Copy/Paste). Print out the one-minute data to a csv file (Code WL to print out the high/low of the intraday bars n bars from open n=0...15 and then do a Vlookup in Excel and assume shorts get executed at the low of the bar, Longs at the high to be conservative) Then recalculate P&L It's a quick and dirty solution but it doesnt supply all the nice analytics of WL (Sharpe ratio, equity curves, etc..). Hopefully there's a way to get it done more elegantly all in WL
profile picture

Cone

#13
QUOTE:
if I were to forgo using the opening closing crosses
First thing to know is that the opening prices of 99.9% of EOD data out there does not give you the opening cross. The open is the first non-Reg-T full lot trade after 09:30:00.000. Most of the time, it is the opening cross, but when it is not (especially on NYSE) this price can vary by multiple percentage points from the opening cross of the primary market.

QUOTE:
something less vague than use multiple time frames
If you want :0931, 0932, etc. pricing, then you need to access intraday data. The most straightforward and relatively simple way to do it is to use multiple timeframes. The strategy must execute on 1-Minute bars (because that's what you're trading) and you need to re-create your EOD system indicators using the Daily timeframe. This is a clean solution and could be done more quickly than the Excel thing.
profile picture

Eugene

#14
I haven't tried it but here's something off the top of my head:

1. Using a GetExternalSymbol overload, get the Bars object corresponding to symbol's 1-minute data. Let's call it extBars:

Intraday / Multi-Time Frame | Accessing Intraday data from Daily

2. Call ConvertDateToBar on that Bars object (extBars), not the default Bars using the DateTime of 9:31am (3:59pm) to determine the bar corresponding to the time of your quazi-MOO/MOC entry/exit.

3. Get the bar's price and set a Stop/Limit order, optionally assigning a priority
profile picture

Eugene

#15
Synchronicity again :)
profile picture

sedelstein

#16
Thank you gentlemen. I haven't had much luck on the multiple time frame as I generally get error messages about accessing data beyond the bounds of the dataseries (Index out of range, Non-neg and less than the size of the collection) but I will give it a very hard look again.

The other idea I have is to use the intraday data to generate a VWAP and/or TWAP. If that worked (e.g. no performance degradation) it would give me better liquidity than what might be available using the crosses

fwiw Nasdaq publishes what goes through at the opening cross http://www.nasdaqtrader.com/Trader.aspx?id=OpenClose
The NYSE does not and offers it for a fee
profile picture

sedelstein

#17
The code below seems to work though it isnt the most efficient.

I tried using
CODE:
Please log in to see this code.
but if you use say a fixed number of bars I found that if bar 0 was the middle of the day (which it is going back 1000 bars), the function was true for that first mid-day bar even though it's wrong. (The first bar of the day was a 9:31 but it's not where the data started) Not sure if that's a bug. I resorted to using a time string

Is the code below reasonably OK. Is this the right approach. It works on holiday shortened days like the Friday after Thanksgiving

CODE:
Please log in to see this code.

profile picture

Cone

#18
1. Don't use BuyAt..(bar + n), where n > 1 in a Strategy!
2. Don't use AtClose orders in an intraday Strategy!.. You can't trade them, and, there's only 1 tick of difference between the close and the open of the next bar.
3. See Intraday Support Functions in the Wiki

CODE:
Please log in to see this code.

profile picture

sedelstein

#19
Thank you for the suggestions. Greatly appreciated. Your code will help me go a long way to actually implementing the strategy given the constraints on times in force at Fidelity
profile picture

sedelstein

#20
Ran this code as is and no trades were generated. I'm looking to see what I am doing wrong.

I have a question about the logic of
CODE:
Please log in to see this code.


If the position is null, look for a trade or if the position is not active look for a trade, but not sure about
CODE:
Please log in to see this code.


Thanks Cone

If it isn't too much bother, I'm still struggling a bit with the multiple time frames.

Here is the psuedo code of my daily strategy. The DataHolder class holds the daily data for analysis. Just not sure how to set up code so that the class holds daily data but the trading happens on the intraday schedule shortly after the open and before the close
CODE:
Please log in to see this code.


profile picture

sedelstein

#21
After spending some time with this and getting close, I'm wondering if the effort will pay off. Turns out the one minute data for the opening and closing bars of the day can be quite far off from the daily bars open and closing prices

I am using Fidelity data

Example, on 7/31/15 AAPL the close on the daily bars is 121.30, the last bar of that day (1 minute scale) is 121.46 a difference of 16 cents

18 cents difference on 6/19/15

Opening bars of the day generally matched the daily bar open. For AAPL, the only difference (in the last year) was 1/20/15 107.86 on the 1-min bar vs 107.84 on the daily

These price difference seems to matter to the strategy, Is this a common problem with the 1-minute data?
Is there a way to align them?
profile picture

Cone

#22
QUOTE:
Is this a common problem with the 1-minute data?

First review my post #13 especially about the opening price. This is a pretty arbitrary price in almost all data available.

The closing price, however, is not arbitrary - Daily data (for all providers that I know of except kibot) are corrected for the settlement price - the closing cross on the primary market. Using a MOC order you can participate in the closing auction to always get that price.

Let me show you how to get the Daily bar pricing in the Intraday chart:

CODE:
Please log in to see this code.

Notice that the close of the dotted series (the Daily bars) aligns to the last bar of the intraday series. It will not always match the closing of the intraday bar. In order to get the daily price for a MOC order on the last bar, you can change the close of that bar like this:

CODE:
Please log in to see this code.


Finally, before you do serious testing with Fidelity data, make sure that you run the "Bad History Data Check [Rev A.]" script on your daily and intraday data. Fidelity data has a way of getting corrupt (especially missing sections) after many updates.
profile picture

sedelstein

#23
Thanks for your help again. I will give this a try. My short term goal is to ensure I get the same results when I compress intraday data to the daily scale as I do on just plain old daily data. This looks like it will do it. Thanks for the warning on the data checks
profile picture

sedelstein

#24
I just ran
CODE:
Please log in to see this code.

and still got the same result. The Close of AAPL on 7/31 was still the same 121.46 instead of 121.30
profile picture

Cone

#25
No, no. You missed a VERY important comment in my code. Look at the difference between YOUR GetExternalSymbol and mine.

Actually too, all the fluff with SetScaleDaily, RestoreScale, Synchronize, etc. is not really necessary. You can do it all with this one call by passing 'true' to synchronize GetExternalSymbol. Just make sure that you call a symbol explicitly from a Daily DataSet!

CODE:
Please log in to see this code.
profile picture

sedelstein

#26
Ahh. Got it. Thank you. Will get back to work...

Best wishes for the holiday and New Year and lots of trading profits!
profile picture

sedelstein

#27
Hello Cone

"Bad History Data Check [Rev A.] was (unfortunately?) most enlightening. I took the option to delete files with bad data and reload only to find that errors persist.

Do you generally manually correct the data in this case? Any suggestions?

Thanks.
profile picture

Cone

#28
Most often, just reloading (or deleting and updating again) will fix problems with large gaps. Some symbols with spots of missing data around and before 2000 won't be fixed by reloading and something you have to live with. Occasionally, missing days are not errors - the company could have been under a trading halt that day. You might be able to search for those days here: http://www.nasdaqtrader.com/trader.aspx?id=tradehalts