Buy if close is 10% or less from the high of today
Author: traders
Creation Date: 2/23/2010 12:38 PM
profile picture

traders

#1
If anyone can help me out it would be greatly appreciated...I can find my way around a spreadsheet or EasyLanguage, but trying to write for WL is tough for me!!!

I am trying to write a strategy that would work on daily and intraday charts (could be 2 separate strats.) Basically I want to buy a stock if it closes 10% or LESS from the high of today, and sell it at the open tomorrow. I would also like to be able to limit the entries based on the past few days data, i.e. if stock is up 5% over past X days, then buy/don't buy.
I tried coming up with this below, but not giving any signals...
CODE:
Please log in to see this code.



Thanks very much in advance for any help!!
profile picture

Cone

#2
Since it's an EOD strategy, I don't see a need for any extra work to create the intraday code. Run this on a Daily chart for DROOY, for example. (Coded with Strategy Parameters so you can easily adjust or optimize.)

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

traders

#3
Thanks so much!

Unfortunately, I have so little experience working with WL that I don't know what so many of the lines mean.

If I want to change the parameters of how far from today's high the stock has to be, where do i do that?

If I want to change the amount of days of history that I am looking at (in order to trigger signal) where do I change that?


profile picture

Cone

#4
The User and Programming Guides are a good place to start. Look up How to Run Example Code and Strategy Parameters (and after you compile, just look at the bottom of the Data Tree).
profile picture

traders

#5
Thank you, I will do some homework.