StockFetcher Forums · General Discussion · What's the most elegant way?<< 1 2 >>Post Follow-up
dashover
226 posts
msg #155705
Ignore dashover
2/11/2021 2:08:44 PM

To show Price converging with the 10,46, and 230 moving averages?
All close together..


Thanks!
I use this over that and this over that, but I know there's a better way...

graftonian
1,089 posts
msg #155708
Ignore graftonian
2/11/2021 4:57:38 PM

This is not very elegant, but it works.
Graf
Fetcher[
/*To show Price converging with the 10,46, and 230 moving averages?
All close together..*/
optionable
close > .50
/*** lowest MA ***/
set{var1, min(ma(10), ma(46))}
set{var2, min(var1, ma(230))}
/*** highest MA ***/
set{var3, max(ma(10), ma(46))}
set{var4, max(var3, ma(230))}
/*** % difference ***/
set{var5, var4 - var2}
set{var6, var5 / var2}
set{PctRange, var6 * 100}
add column PctRange
sort on column 5 ascending
]



lis
37 posts
msg #155723
Ignore lis
2/12/2021 12:15:19 PM

Is this too simple?

Fetcher[
show stocks where price 1 day ago is approaching MA(10) 1 day ago
and price 1 day ago is approaching MA(46) 1 day ago
and price 1 day ago is approaching MA(230) 1 day ago

and price is near MA(10)
and price is near MA(46)
and price is near MA(230)
]



yepher
359 posts
msg #155726
Ignore yepher
modified
2/12/2021 6:21:17 PM

Nice answers.

I am not sure this is the "most elegant" way.

The first thing that pops in my mind is to use the MACD Histogram since what you asked is nearly the definition of it. I would wrap it in absolute value to make the comparison easier. I also tend to look for relative relationships so converging and mean something. So look for a new low or something like that.

Fetcher[
ABS(MACD Histogram(10, 46)) has reached a new 1 month low
AND ABS(MACD Histogram(46, 230)) has reached a new 1 month low

/** Clean up results a little **/
AND market is not OTCBB
AND close > 10
AND volume(30) > 100000

/** Make it easier to see what is going on **/
AND draw ABS(MACD Histogram(46, 230))
AND draw ABS(MACD Histogram(10, 46))

AND draw MA(10)
AND draw MA(46)
AND draw MA(230)
]



nibor100
1,042 posts
msg #155727
Ignore nibor100
2/13/2021 12:17:15 AM

@yepher,
If you are the Yepher who authored the alternate SF user manual years ago, Thanks for doing so and welcome back.

I joined SF years after you left but have used your version of the user manual many times to help with coding.

Ed S.

SAFeTRADE
645 posts
msg #155728
Ignore SAFeTRADE
2/13/2021 12:41:50 AM

Here is a filter TRO wrote back in 2007. See if it fits what you are trying to accomplish.

Fetcher[

/* THREE MOVING AVERAGES WITHIN .20 OF EACH OTHER */

set{E513b,days(ma(5) is above ma(46),100)}
set{E513a,days(ma(5) is below ma(46),100)}
set{M1X, E513a - E513b}


set{E534b,days(ma(10) is above ma(230),100)}
set{E534a,days(ma(10) is below ma(230),100)}
set{M2X, E534a - E534b}


set{E1334b,days(ma(46) is above ma(230),100)}
set{E1334a,days(ma(46) is below ma(230),100)}
set{M3X, E1334a - E1334b}

set{diff1, abs(ma(10) minus ma(46) )}
set{diff2, abs(ma(46) minus ma(230) )}
set{diff3, abs(ma(10) minus ma(230) )}



add column diff1
add column diff2
add column diff3
add column pctdiff

add column SEPARATOR

add column M1X
add column M2X
add column M3X

/* change .21 to whatever you want */

diff1 below .21
diff2 below .21
diff3 below .21

DRAW MA(10)
DRAW MA(46)
DRAW MA(230)

close above 20
volume above 1000000

sort column 5 ascending
]



nibor100
1,042 posts
msg #155729
Ignore nibor100
2/13/2021 12:56:44 AM

Perhaps simpler is elegant....using SF's converging command
Ed S.

Fetcher[
MA(10) is converging towards the MA(46) over the last 2 weeks
MA(46) is converging towards the MA(230) over the last 2 weeks
MA(1) is converging towards the MA(46) over the last 2 weeks
]



Cheese
1,374 posts
msg #155734
Ignore Cheese
2/13/2021 12:06:36 PM

dash,

So far, filters from different contributors show different 10,46,230 convergences.

If you don't miind, could you post some filter examples of your favorite
10,46,230 convergences ?

Thank you

Mactheriverrat
3,156 posts
msg #155736
Ignore Mactheriverrat
2/13/2021 12:15:50 PM

Yepher

Talk about a blast from the past!

dashover
226 posts
msg #155768
Ignore dashover
2/14/2021 1:41:01 PM

Cheese, I am looking for stocks that converged in the last 7-14 days, and then have dropped further...
and are heading towards a support level..

See CBOE and perhaps MRK, AZN and AKAM..

At some point when those hit support, I'll add some OTM June or July call spreads for $1
and I'll look to sell them when they hit $1.25 for a tidy 25%...

I'm looking for dormant volcano's for this strategy...

My .00000000002c

StockFetcher Forums · General Discussion · What's the most elegant way?<< 1 2 >>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.