StockFetcher Forums · General Discussion · Coding for Confirmation<< >>Post Follow-up
wkloss
230 posts
msg #97858
Ignore wkloss
12/6/2010 7:14:29 PM

I need help in writing code that shows confirmation. For example, I want to see stocks that crossed above and closed above an indicator yesterday. Today, that stock closed again above the indicator, thus confirming the signal. I don't have a specific indicator in mind but intended to insert the indicator in the generic confirmation language. What I'm trying to get away from is running a filter and getting 500 stocks, many of which crossed above the indicator a week or ten days ago because by then its too late to act on the signal anyway.

Here is an example of how I think it could be coded

Show stocks where close 2 days ago crossed above the (indicator goes here) 2 days ago
and close has been above (indicator goes here) for the last 2 days

Another approach could be to list the stocks in the order they confirmed the signal with the most recent confirmations being listed first.

I hope I'm making sense here.

Any help will be appreciated.

Bill


four
3,998 posts
msg #97862
Ignore four
modified
12/6/2010 10:42:40 PM

Fetcher[
draw ma(25)
LOW within the last 0 days crossed above ma(25)
symlist(pcln)
offset 10/22/10
]


We assume today's date is 12/6/10
--------------

Use the above example with PCLN on the date 10/22/10. PCLN's LOW crossed above ma(25).
Now change the offset to 10/23/10 , 10/24/10 ...

- OR -

Remember the offset can also be a number.
offset 12/6/10 - 10/22/10 = 30 TRADING days

Fetcher[
draw ma(25)
LOW within the last 0 days crossed above ma(25)
symlist(pcln)
offset 30
]



wkloss
230 posts
msg #97911
Ignore wkloss
12/9/2010 8:22:36 PM

four,

I have attempted to apply your suggestions to an existing filter without any success. That filter is your Play The Low Crossover. Simply adding an offset won't work on this one, probably because of how you constructed it (which I don't understand).

The things I was trying to do are:

1. Get a confirming signal. 2 days ago there was a crossover and it closed above/below the signal line in the same direction. Yesterday it also closed above/below the signal line and

2. Limit the list to crossovers/confirmations in the last 2 days.

The way you wrote this filter illustrates how the signal did since the crossover but I'm already sold that it works. I'm just trying to add a confirmation and limit the results to recent signals. Perhaps I didn't ask for the right thing. Perhaps I should have just asked for the results of this filter to be list in date order with most recent to be listed first.

I appreciate your response and anything else you are willing to do.

Bill

four
3,998 posts
msg #97920
Ignore four
modified
12/10/2010 12:49:57 AM

Does this help ?

Fetcher[
set{v1, low 1 day ago}
set{v2, low 2 day ago}
set{v3, low}
set{z1, min(v1,v2)}
draw z1 on plot close
draw v3 on plot close
symlist(SOXL)

v3 2 days ago crossed above z1 2 days ago
offset 12/3/10

]



wantonellis
102 posts
msg #97949
Ignore wantonellis
modified
12/10/2010 5:30:07 PM



wkloss
230 posts
msg #97956
Ignore wkloss
12/11/2010 10:56:06 AM

four & wantonellis,

I will use four's SOXL to better explain. On 12/30 it looks like the purple line crossed above green and SOXL closed above the green line, so that gives the signal. On 12/1, SOXL closed above the green lines, so I have my confirmation.

IMO, 12/2 should be my entry date.

I think the issue is in the way the list of candidates can be sorted. If there are several hundred candidates that have crossed above the green line over the past few days, the list becomes difficult to work with. If they were sorted based on the most recent crosses over the green line, it would greatly simplify picking the ones you want to trade. In the SOXL example, the chart is on 12/10. I wouldn't take that trade on 12/10 because I think most of the move would be over by then.

Something I noticed is that most candles are above the purple line. If a fall below the purple line but still above the green line means something, I missed that.

Thanks for help from both of you.

Bill

wantonellis
102 posts
msg #97961
Ignore wantonellis
modified
12/11/2010 1:15:26 PM



wkloss
230 posts
msg #97964
Ignore wkloss
12/11/2010 4:11:05 PM

wantonellis

I think you nailed what I'm trying to do but I still can't get it to work on the following filter from four.

draw cma(min(low,low 1 day ago),3) on plot close
draw cma(low,1) on plot close
do not draw min(low,low 1 day ago)

Could you or four add the correct coding for the column?

I suppose this seems simple to you but I think it might show Stockfetcher how frustrating it is to add basic commands.

Bill

four
3,998 posts
msg #97965
Ignore four
modified
12/11/2010 5:13:34 PM

This ?
hp722c
0 day is 18 NOV 10

Fetcher[draw cma(min(low,low 1 day ago),3) on plot close
draw cma(low,1) on plot close
do not draw min(low,low 1 day ago)

set{daya, days(cma(low,1) crossed above cma(min(low,low 1 day ago),3),20)}

add column separator
add column daya {xover days ago}

sort column 6 ascending
symlist(at)
]



Fetcher[

draw cma(min(low,low 1 day ago),3) on plot close
draw cma(low,1) on plot close
do not draw min(low,low 1 day ago)

set{daya, days(cma(low,1) crossed above cma(min(low,low 1 day ago),3),20)}

add column separator
add column daya {xover days ago}
rsi(2) < 25
sort column 6 ascending
close > 1
avgvol(55) > 5000000
close > open

]



Good teamwork !
PS ignore what is in yellow

wkloss
230 posts
msg #97986
Ignore wkloss
12/13/2010 8:41:47 PM

four,

works great. Thanks to you and wantonellis.

Bill

StockFetcher Forums · General Discussion · Coding for Confirmation<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus