Buy 12-month high, sell if falls more than 10%
Author: Jim0000076
Creation Date: 9/27/2012 9:26 AM
profile picture

Jim0000076

#1
Hello, I am new to WL and am quite overwhelmed by the program. To start with I just want to write a simple code to do something like the following:
Buy the 12 month high.
Sell if stock falls more than say 10%.
Buy on the Monday at open after scanning weekly data.

Sounds quite simple, but I have absolutely no idea where to start. Also, is there a simple reference somewhere at to what each of the lines in the WL code mean? Thanks in advance, any help appreciated.

Jim

profile picture

Eugene

#2
Welcome to the forums.
QUOTE:
Also, is there a simple reference somewhere at to what each of the lines in the WL code mean?

The QuickRef (hit F11) and the WealthScript Programming Guide (Help menu). "WL code" is actually C# code with WealthScript library on top of it. See also this FAQ: How do I start with C# ?
QUOTE:
Buy the 12 month high.
Sell if stock falls more than say 10%.
Buy on the Monday at open after scanning weekly data.

Try creating a Strategy from Rules - way easier to start with. The yearly high rule might not be available but you can emulate it using a corresponding numbers of Daily bars. See Conditions tab, "Price/Volume action", "Price makes a new high within period":



For scanning Weekly data, switch the chart to weekly and the Strategy's guts will adjust.