Strategy will back-test but won't run in Strategy Monitor
Author: Bionian
Creation Date: 11/13/2009 12:52 PM
profile picture

Bionian

#1
I built this rule-based strategy and converted it to code. I can back-test it, and I get plenty of trades, but when I try to run it in Strategy Monitor I get no results. When I set the Strategy Activation Settings for a 5-minute intra-day scan, it will update data, but return no results. I don't know if it is scanning or not. Those settings are: Paper Account 1, Data Range: 1 bar, Position Size $25,000, Scale: 5 minutes, no boxes checked.

If I try to run it as daily bars, nothing happens at all. I try to select "run now," and I see the "last scan" change to the current time for about one half-second, but it changes back to 4:30 and doesn't even start updating data. Those settings are: Paper Account 1, Data Range: 1 Day, Position Size: $25,000, Scale: Daily, no boxed checked.

If it matters, in the Strategy Activation Settings, in the Data Range drop-down box, the most recent date is 11-10-2009, and it is grayed out. Earlier dates can be selected, but nothing later than 11-10-2009 (today is 11-13). I have checked my computer clock, and it is set to internet time, and is correct.

Interestingly, if I set the scale to daily, but the data range to 1 year, I do get a history of 717 trades, and 77 alerts- one for each currently open positions, dated 11-12, with orders to place protective stop losses for each open position as per my strategy, so the strategy seems to work when the data range is set to 1 year, but nothing less.

Finally, I decided to test the "Four Down Days" strategy on 5-minute bars with the same intra-day settings as above, and I have received 28 trades so far, so the Strategy Monitor appears to be working.

What am I doing wrong? Thanks for your help.

-Rick

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

Eugene

#2
CODE:
Please log in to see this code.

The strategy requires at least 51 bar of "seed" data just to warm up. If you select 2 days of data to load in the SM, obviously it won't generate anything.

Furthermore, due to the use of the 50-period EMA the results will be unstable at first. Make sure you start the trading loop at no less than (50 * 3) bars, and revisit the Programming Guide > Indicators > Stability of Indicators.

Finally, SellAtClose(bar) won't produce Alerts.
profile picture

Bionian

#3
Thanks, Eugene. I'm there. Also, when running "Four Down Days," When I double-click on one of the symbols in the Alerts pane, I get a new chart window with "no data available." In the past, I have been able to get a chart that way. I didn't see anything about that in the User Guide. Is there somewhere else I should go?

Finally, also in the Alerts pane, I have not seen any "buy" signals- all sells. Am I doing something wrong here as well?

Thanks-
Rick
profile picture

Eugene

#4
Rick,

"No data available" may mean on demand updates disabled (and for the better!) in the Data Manager, or when the symbol is quarantined (failed Fidelity data updates several times e.g. delisted). You will see it in the User Guide:

1) Data > Data Manager > Update Data > On Demand Data Updates, and
2) Data > Data Manager > Symbol Management

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).