Narrow Range Day (NRD) strategy
Author: robl
Creation Date: 1/27/2011 9:24 AM
profile picture

robl

#1
I am brand new at wealth lab and was hoping I could get help programming my strategy so I can start trading. The strategy is pretty simple. I need the following criteria met in order to have a buy alert: 1. 20 day moving average above 50 day moving average
2. 4 down days followed by a narrow range day
3. then get a buy signal if stock breaks above narrow range days high
4. once bought get sell signal if stock breaks below narrow range day or if stock breaks above high of first down day.

I am really new to wealth lab and would appreciate any help you can give to get this strategy going

profile picture

Cone

#2
First thing to learn about is the Strategy Builder. See User Guide: Strategy Window > Strategy Builder

The idea is that you can get at least a good start on simple strategy rules, just using drag and drop:


Which produces this Strategy code:

CODE:
Please log in to see this code.


Now, we can add the rest of the rules, but you need to define "narrow range day".
profile picture

robl

#3
quarter of the size of the average day?
profile picture

Cone

#4
Well, the specifications are inexact since you didn't define the order types, if you wanted to enter on a stop, or exit after a close, etc. But here's one idea (below). Paste it in a Strategy Window, Compile, Save it, and execute it on a large DataSet - you'll need lots of opportunities to find a stock that meets these entry conditions. You can play with the sliders to adjust some of the parameters. Have fun experimenting!

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

robl

#5
A market order is fine if the stock brakes above the narrow range days high to get into trade. It is also ok for a buy or sell at market to get out of trade if it brakes low of narrow range day or brakes high of first day down. Thanks for the help. Can you walk me through how to get this into the wealth lab for test and then how do I use it live to give me alerts?
profile picture

robl

#6
I am having trouble getting it into wealth lab it keeps pasting whole thing on 1 line, have you ever seen that before.
profile picture

Eugene

#7
That's a IE thing. Copy/paste works fine with all other browsers e.g. Firefox or Chrome.

Workaround if you have to stick with IE: copy to Wordpad, copy from Wordpad, paste to WL. Voila.
profile picture

robl

#8
I backtested the strategy and it only found 2 trades in the S&P 500 all the way back to 1991. If I go through the charts however I see stocks that meet my criteria.
Can you please help me try to figure out what went wrong?
I need 4 down days, then a narrow range day and then the stock needs to break the high of the narrow range day to give a buy signal. The sell signals would be a break of the narrow range day low or if the stock moves back up above the high of the first down day.

profile picture

Cone

#9
CODE:
Please log in to see this code.
Which ones and what dates?
profile picture

robl

#10
BAC last couple of weeks
profile picture

Cone

#11
Well, no, it does not meet your "narrow range bar" criteria. But if you move the "Narrow Range" slider to 0.55 or greater, then you'll start seeing some trades.
profile picture

robl

#12
Thank you. How do I change the "Narrow Range" slider to .55. Sorry I am very new.
profile picture

Eugene

#13
Check out Reference > Data Panel > Strategy Parameters in the Wealth-Lab User Guide (Help menu).
profile picture

robl

#14
I am really sorry but I dont understand what your saying. Do I need to change something in the programming? I cant find reference or data panel?
profile picture

Eugene

#15
I was suggesting that you find the User Guide under the Help menu, expand "Reference", then "Data Panel", and click on "Strategy Parameters" to read the manual on how to change parameter values in Wealth-Lab.

With your Strategy open, on the left side of the Wealth-Lab's workspace, below the DataSets tree, can you see a little white box with the bluish labels: "Fast Period", "Slow Period", "Number of Bars", "Narrow Range"?
profile picture

robl

#16
yes I see it and changed it to .55 hopefully that will help. Thanks for the help
profile picture

robl

#17
It keeps reverting back to .25 when I open strategy instead of .55
profile picture

Eugene

#18
I'd suggest you review the chapter on strategy parameters. Saving is explained there.
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).