loading in a stock search algorithm
Author: Roncrc
Creation Date: 8/24/2010 3:11 PM
profile picture

Roncrc

#1
I would like to load a 5 line algorithm similar to the following

MINL5>MINL20 MEANING "THE MIN. LOW FOR THE PAST 5 DAYS IS GREATER THAN THE MIN. LOW FOR THE PAST 20 DAYS."

i HAVE 4 MORE LINES OF CODE LIKE THIS, CAN SOME ONE HELP ME LOAD THIS CODE IN THE WEALTH LAB NET SOFTWARE

profile picture

Cone

#2
Sure. Post the requirements here (be specific) and I or someone else is likely to pick it up for you.
profile picture

Roncrc

#3
Cone

MINL5>MINL20
Minimum low of the last 5 days is greater than the minimum low of the last 20 days
Cone

AND MAXH7.1=MAXH36
and Maximum high of the last 7 days as of 1 day ago is equal to the Max high of the last 36 days

AND MAXH3.1<MAXH36.1
and Maximum high of the last 3 days as of 1 day ago is less than max. high of the last 36 days as of 1 day ago

AND H>MAXH3.1*1.005
and The high of the setup day to be greater than the max. high of the last 3 days as of 1 day ago times 1.005

AND AVGV50>5000 In this case 5000 = 500,000 shares
and The Average Volume of the last 50 days be greater than 500,000

Thanks Ron

profile picture

Cone

#4
1. Open a new "Strategy from Code" Window. (Ctrl+Shift+S)

2. Click on the Editor view, delete the template code, and paste in the following. (If you're using Internet Explorer, you should paste this into a text editor first and copy it from there.)

CODE:
Please log in to see this code.

3. Select 1 symbol in the DataTree and click the "Run the Strategy" button in the Editor toolbar. It should compile and run without error.

4. Save the script

To run the script on an entire DataSet of symbols:
a. first make sure the DataSet is updated (use the Data Manager)
b. select a minimal amount of data that is required by your script for all indicators to be valid. Only 50 bars are required, but 250 fixed bars will give you a year's worth of data to look at when viewing a chart.
c. click on the DataSet name, and then "Backtest on all Symbols..." or "Go".

If the screen generates any hits, they'll show up in the Alerts view.
profile picture

Roncrc

#5
Cone, I did all you reccomended then I loaded in the NYSE composite of 1700 plus symbols with the scale set on "Daily, 4 months, and $5000 position, and ran an update then a backtest on all the symbols. It took quite some time to complete the backtest but when the sort was done it showed 1700+ alerts and listed every symbol. I expected only a few to meet all the criteria in the strategy? What did I do wrong???
Ron
profile picture

Roncrc

#6
What I would like is to have only a list of stocks that meet the algorithm after the close of the market on that day and then, if possible, do a sort on those stocks by ADX value so that I could review each one for a trade potential on the next day.
profile picture

Cone

#7
You must have missed something. It sounds as if you weren't running the STrategy above. Close it, reopen it (Ctrl+O), and then run it again from a Strategy Window.

Note that when running backtests on large DataSets, it's very important to update the data first in the Data Manager. While that update operation is expected to take several minutes, after the update and running the test on the Russell 2000, Daily, 250 Fixed bars, data as of yesterday, the test ran in 15 seconds (Win XP, 3.2GHz HT Pentium, about 3 yrs old) and produced 0 Alerts. Your conditions are rather restrictive.

Also, to make sure your data provider isn't trying to update "on demand", you can disable that too in the File menu.

You can achieve the sort by putting adding ADX to the signalName, but let's get you squared away and make sure you're running the right script...one that doesn't alert for every symbol.
profile picture

Roncrc

#8
Cone, You were correct after I updated the file and ran it again from the Strategy window and I disabled "on demand" it took about 1 minute to run and the result on a amex was 7 alerts. Thanks

Now for the next step, can you advise me on how to add ADX to the signalname so that I can sort the resluts by the ADX value?

Thanks again
Ron
profile picture

Roncrc

#9
Cone, can you advise me on how to add the ADX value to the signalname column, as you suggested above, so that I can sort the results by the ADX value?
Thanks, Ron
profile picture

Cone

#10
CODE:
Please log in to see this code.
.. save, and then be sure to click the "Compile" button before running it.
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).