StockFetcher Forums · Filter Exchange · Why?<< >>Post Follow-up
dleather25
39 posts
msg #159574
Ignore dleather25
9/8/2022 10:27:51 PM

can anyone tell me why my filter keeps showing me -1 when I am trying to find when close reached a new 3 month high.

Fetcher[set{h2, cma(high,2)}
set{dsh, days(h2 reached a new 3 month high, 63)}
add column dsh
optionable
volume > 50000
close < 450
volume < average volume(30)
]



dleather25
39 posts
msg #159575
Ignore dleather25
9/8/2022 10:29:43 PM

It keeps saying -1, but if the chart time is 3 months then unless the close price does nothing but knife all the way down then it would have to have a new 3 month high.

xarlor
499 posts
msg #159576
Ignore xarlor
9/9/2022 7:41:05 AM

To visualize what dleather25 is saying, notice the CMA you created is -1 for those that are not reaching a new 3-month high (line steadily goes down or stays the same).

Fetcher[
set{h2, cma(high,2)}
set{dsh, days(h2 reached a new 3 month high, 63)}
add column dsh
optionable
volume > 50000
close < 450
volume < average volume(30)

draw h2 3 month high on plot price
do not draw h2
]



dleather25
39 posts
msg #159578
Ignore dleather25
9/9/2022 1:34:27 PM

How do I code it where it tells me the 3 month high or 3 month low for that given chart ( 3 months) I would think since the chart-time is 3 months the line would come down to where the 3 month high is on the chart. Hopefully that makes sense. I'm trying to create a solid Rounded Top filter.

styliten
227 posts
msg #159579
Ignore styliten
modified
9/9/2022 3:42:56 PM

@ xarlor

Thanks for the clarification.

A dsh = -1 seems to suggest that the max value of H2 within the last 63 trading days (with today as day ?0/1) is set by a value OUTSIDE this date range.

Fetcher[dow 30

set{h2, cma(high,2)}

set{dsh, days(h3 reached a new 3 month high, 63)}

draw h2 3 month high on plot price
draw h2
]



so take KO as an example:



The April 25 peak value became max H2 and lasted all the way through August 3; the new max H2 within the last 63 days is from August 18, and it will become the max H2 all the way thru November (unless between now and November a newer max H2 comes up).

So adding "dsh > 0" seems the easiest fix :

Fetcher[
set{h2, cma(high,2)}
set{dsh, days(h2 reached a new 3 month high, 63)}
add column dsh
optionable
volume > 50000
close < 450
volume < average volume(30)
dsh > 0

draw h2 3 month high on plot price
draw h2 on plot price
]



On the other hand, adding "dsh < 0" would pick up only those stocks that had been down for quite some time. So they might be good candidates for a quick rebound in the near future (in theory at least).

xarlor
499 posts
msg #159580
Ignore xarlor
9/9/2022 6:10:28 PM

How do I code it where it tells me the 3 month high or 3 month low for that given chart ( 3 months) I would think since the chart-time is 3 months the line would come down to where the 3 month high is on the chart.

I think you're confusing the PRICE 3 month high vs your CMA 3 month high. Two completely different things. The line is your CMA 3 month high, not the price. If you want to know the price 3 month high, add another line:

Fetcher[
chart-time is 3 months
set{h2, cma(high,2)}
set{dsh, days(h2 reached a new 3 month high, 63)}
add column dsh
optionable
volume > 50000
close < 450
volume < average volume(30)

add column high 3 month high
draw price line at high 3 month high

draw h2 3 month high on plot price
do not draw h2
]



dleather25
39 posts
msg #159581
Ignore dleather25
9/10/2022 1:49:59 AM

first question.. Has anyone attempted to make a Rounded Top filter before? According to Bulkowski it is one of the highest return on both bull markets and bear markets.

Another question how do I post a picture in the message? That might help me explain better because sometimes I have a hard time expressing what's in my head.

I appreciate and admire everyone here's ability to code, I took python twice and failed near the end of the class, I am decent at coding but everyone else here is head and shoulders above me. I love stockfecther wish the person who owns it would try and keep improving it.


I think I have made myself more confused, here is my logic. if default settings are 3 months on the chart-time then close, price, low, high 3 month [insert one of those 4 here] would have to be somewhere in the chart that is in front of me, yet somehow the line can be above the 3 month high, or have a line that goes up etc.

What I am trying to do is use 3 months as my start and have the price/close whichever reach a high some where between 20-40 days (there are 63 days in 3 months of trading) so sometime during the middle of this 63 days it reached a high... You could adapt this logic to any time frame but right now trying to just crack the code of a rounded top.


have the close/price < 5 percent above the low of that 3 month period.

a couple other things trying to create a value say 5 percent above the 3 month low and the low between 20 and 40 days ago did not cross below that line.

set{3ml, price 3 month low * 1.05}
low < 3ml between 20 and 40 days ago

if anyone else has any ideas on how to carve out the middle then let me know. I mean I guess you could do it with the coding below.

also trying to create a custom day count to use as the day the 3 month chart's high, using that number you can create a range, dsh can be used for both. so say the high of that 3 month chart was reached 30 days ago then you could use close dsh1 days ago < 5 percent below close dsh days ago and then another one for the day after etc. /

example: ( I think there was a way to do a variable offset, it seems to be slipping my mind as it's almost 1 o clock)

set{dsh, days(price reached a price 3 month high, 63)}
set{dsh1, dsh - 1}
set{dsh2, dsh + 1}

price dsh1 days ago is less than 5 percent below dsh
price dsh2 days ago is less than 5 percent below dsh2
(you could do 5 days of this and increase the percentage difference in order to create a "rounded top" at the top)

This is somewhat what I have now

Fetcher[draw CMA(low,2) on plot price
draw cma(high,2) on plot price
chart-time is 3 months
price < 20
set{rt1, CMA(low,2)}
rt1 price 3 month low is below price
price > price 3 months low
price < 5 percent above price 3 month low
price > 5 percent below price 3 month high
set{rt2, cma(high,2)}
set{dsh, days(price reached a price 3 month high, 90)}
add column dsh
draw 3 month high
set{dsl, days(price reached a 3 month low, 90)}
add column dsl
price reached a new 2 month low with in the last 5 days
Average Volume(5) < Average Volume(30)
Average Volume(100) > 500000
Williams %R(2) < -80
price > 0 percent above price 3 month low
]




I'll try and do a better post soon, I even know this isn't the best at explaining but hoping this can spark something. Thanks again and Roll Tide!





xarlor
499 posts
msg #159582
Ignore xarlor
9/10/2022 9:24:21 AM

Oh you wanted a 3-month Rounded Top filter?
*furious keyboard typing*

Fetcher[
optionable

/* Assign values to the 3 month high and how long ago that occured */
set{3mh,high 3 month high}
set{d3mh,days(high equals 3mh,63)}

/* Assign values to the 3 month low and how long ago that occured */
set{3ml,low 3 month low}
set{d3ml,days(low equals 3ml,63)}

/*
3 month low has to be more than 40 days ago
3 month high has to be between 20 nd 40 days ago
current close has to be above the 3 month low, but not by more than 5%
*/
d3ml > 40
d3mh between 20 and 40

set{5pl,3ml * 1.05}
close > 3ml
close < 5pl

/* Rounded Top visualization */
set{rounded_top,ma(8) * 1.01}
draw rounded_top on plot price

/* 3 month high and 3 month low visualization */

draw price line at 3mh
draw price line at 3ml

/* Debugging */
add column separator
add column 3mh
add column 3ml
add column 5pl
add column separator
add column d3mh
add column d3ml

do not draw d3ml
do not draw d3mh
do not draw 3ml
do not draw 5pl
]



dleather25
39 posts
msg #159583
Ignore dleather25
9/10/2022 11:53:57 AM

That is beautiful. I added in there williams % r 2 is below -75 to find a near bottom. Rounded tops and double bottoms are the two that I am most high on. Never traded options before but if they are similar to how stocks trade then should be awesome gains

StockFetcher Forums · Filter Exchange · Why?<< >>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 2022 - 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


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.