Orders Don't Get Placed
Author: marty n
Creation Date: 11/23/2009 10:03 AM
profile picture

marty n

#1
For learning purposes, I'm following a rule-based strategy. The strategy backtests, i.e. it generates entries and exits on charts, but some orders (in paper accounts) don't get placed. There are more orders on the charts and in the trade summaries than reach the orders.

Following is the strategy:
CODE:
Please log in to see this code.


Any help would be appreciated.

Thank you.
profile picture

Cone

#2
Did you assign the Strategy to a Paper Account? If so, then there is no explanaiton. Give us more details about what you're doing. (symbols, time frame, Chart Window or Strategy Monitor, etc.)
profile picture

marty n

#3
Thanks.

Yes, this is being done in a paper account, using 15 minute bars.
The strategy is activated and AutoPlace is ON.
"Automatically stage orders from strategy alerts" is checked.


Two of the symbols are FAS and MWJ.

Thanks.
profile picture

marty n

#4
This just happened again.

At 12:45, an alert was generated to sell MWJ, which was bought at 9:45 today and shows up on the chart. However, the sell never made it to an order, although it is on the chart.
profile picture

Cone

#5
Staging is a known problem for live orders, but this is the first time it has been reported for Paper Trading.

In the Orders tool (Ctrl + R), select Account: PaperAccountN, where N is the Paper account you're using. Are the orders there?
profile picture

marty n

#6
No - some are missing.

For example, an order to sell FAS was filled (paper account) at 2:01 but the corresponding buy is missing.
profile picture

marty n

#7
I don't think the problem is with the strategy since some orders are getting filled.

Is there a log of alerts so I can see a record of all alerts that the Strategy Monitor issued?
profile picture

marty n

#8
Could this be related to the problem IZ_Trader is having in "Cannot Get Quote For Symbol"?
profile picture

Cone

#9
Sure it could. The Paper trader checks snapshot quotes periodically (every 10 seconds or so). So, if it can't get the quote, it can't execute the trade. Obviously live trading is not so limited.
profile picture

marty n

#10
Is there a way to log alerts so I can see a record of all alerts that the Strategy Monitor issued? Is there something at my end that would be preventing getting the quote and executing the order?
profile picture

Cone

#11
You got me running down the wrong path. The problem with getting Alerts to the Orders tool wouldn't be caused by not getting quotes. Quotes is only a problem for the Paper Trader to execute the orders.

What I understand your problem to be is that some Alerts aren't getting to the Orders tool. That's a known intermittent bug, but it's the first time I've heard of it happening while Paper Trading. It would help if you could create a Support Ticket and attach an image of the Alerts view along side an Orders tool showing that they were not Auto-Staged.

Eugene, do you have an ready-made example of writing Alerts to text file? Community.Components? It would be a good idea to change one of the Alert method examples in the QuickRef to write to a file instead of the debug window for easy reference. Example -

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

Eugene

#12
Thank you. Will get it done asap.
profile picture

marty n

#13
I'll send the Support Ticket and images after tomorrow's close. I accidentally closed the orders window (instead of minimizing it) and I didn't realize that closing the window causes Auto Place to be off when you open it again. This resulted in several periods with Auto Place off. I'll try to collect a full days data and send it in tomorrow.

Thanks.
profile picture

marty n

#14
I'm not sure if this has anything to do with this problem, but I noticed something that seemed strange. I noticed that there are gaps in prices for 15-minute bars on MWJ. This seemed strange since the price shouldn't change from the close of one (intraday) bar to the open of the next bar.

I then looked at 1-minute data and saw many missing bars. For example, on MWJ, there's a 3:27 bar and the next bar is 3:35. No data 3:27 - 3:35.

So if I'm running a strategy using 15 minute bars, when the strategy runs at 3:30 and there is no data, there will be no alert, no order, no nothing!

Can this be causing the problem and what can be done? The data should really be more reliable. I confirmed missing Fidelity data using Active Trader with 1-min charts.

Thanks.
profile picture

marty n

#15
Sorry for the numerous posts. I should have checked other data sources before the last post.

I also checked this chart (MWJ 1-min) on Yahoo and there are many similar missing data. If this is not correctable, does this make this symbol untradeable?

Thanks.
profile picture

Eugene

#16
QUOTE:
I also checked this chart (MWJ 1-min) on Yahoo and there are many similar missing data. If this is not correctable, does this make this symbol untradeable?

The data are missing because the symbol simply was not trading at that time. MWJ is a low volume ETF with small turnover and liquidity. Its 1-minute Yahoo chart clearly shows there could be extended intraday periods without trades.
profile picture

marty n

#17
Thanks again. This might be the source of the whole problem. Before you guys do any more work on this, let me look at other symbols that have experienced no alerts or no orders. I'll also run the strategy on more reliable symbols.

However, Cone's suggestion for being able to write Alerts to a text file would be useful - could I still get that?

Thank you so much...
Marty
profile picture

Cone

#18
QUOTE:
could I still get that?
The code is posted above (though I'm going to change it a little right now so that it writes to your personal WLP Data folder to avoid any O.S. conflicts). Just add the AlertsToFile procedure to your the WealthScript class as shown, and then call AlertsToFile() at the end of your Strategy.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).