|
QuantShare
2012-04-28 06:45:57
1
|
|
Best Answer
Hello Thomas,
Yes of course, QuantShare can find these stocks.
Here is the formula:
barsPerMonth = 25;
hhv2 = hhv(close, barsPerMonth*24); // High close price for the last 2 years
dishigh = ((hhv2 / close) - 1) * 100; // Distance from highest (%)
rule1 = dishigh < 5;
perf6M = perf(close, barsPerMonth*6); // 6-month return
perf6M_0 = perf6M > 10;
perf6M_1 = ref(perf6M, barsPerMonth*6) > 10; // ref: reference 6-month return 6 months ago
perf6M_2 = ref(perf6M, barsPerMonth*12) > 10;
perf6M_3 = ref(perf6M, barsPerMonth*18) > 10;
rule2 = perf6M_0 and perf6M_1 and perf6M_2 and perf6M_3;
filter = rule1 and rule2;
You may also want to see signals on chart. To do this:
- Create a new pane
- Right click on the pane (chart) then select "Edit Formula"
- Type the above formula, add the next line then click on "Update Graph".
plot(filter, "", colorBlue);
|
|