StockFetcher Forums · General Discussion · determine when a moving average changed directions<< >>Post Follow-up
sammyn
81 posts
msg #145241
Ignore sammyn
11/11/2018 7:20:32 PM

hi all,
I'm drawing a blank here.

I need to determine when a MA change from downward to upward.

What is the most efficient way to do this?

Just compare the current and last 2 days MAs?


sammyn
81 posts
msg #145242
Ignore sammyn
11/11/2018 8:52:19 PM

fyi...this is what I have. But, if someone has a better way of doing this, let me know.

Fetcher[market is etf

and ema(50) > ema(50) 1 days ago
and ema(50) 1 days ago < ema(50) 2 days ago

set{ emaUp, count(ema(50) > ema(50) 1 days ago, 1)}
draw emaUp
]



Cheese
1,374 posts
msg #145311
Ignore Cheese
11/19/2018 10:36:41 AM

@ sammyn

Your code is perfect.

Once you've got the picks from your filter, the Charting Wealth posts by Mac and graf
may give you a bit more decision support if you need it

https://www.stockfetcher.com/sf/search.php?q=Charting%20Wealth&filter=&sort=

Best.


nibor100
1,031 posts
msg #145314
Ignore nibor100
11/19/2018 1:07:40 PM

These are 2 possible alternatives to choose from:

The first uses the "add column" phrase to provide data as well as filter the results; while the 2nd is kind of a shortcut one liner to reduce overall filter size

Fetcher[
market is etf

add column ema(50) > ema(50) 1 day ago
add column ema(50) 2 days ago > ema(50) 1 day ago

set{ emaUp, count(ema(50) > ema(50) 1 days ago, 1)}
draw emaUp
]



Fetcher[
market is etf

ema(50) > ema(50) 1 day ago < ema(50) 2 days ago

set{ emaUp, count(ema(50) > ema(50) 1 days ago, 1)}
draw emaUp
]



Ed S.



mahkoh
1,065 posts
msg #145315
Ignore mahkoh
11/19/2018 2:49:53 PM

Fetcher[
2 day slope of ma(50) above 0
2 day slope of ma(50) 1 days ago below 0
russell2000
]



StockFetcher Forums · General Discussion · determine when a moving average changed directions<< >>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.