StockFetcher Forums · General Discussion · Difference in MA's<< >>Post Follow-up
334 posts
msg #120374
Ignore jackmack
6/3/2014 5:01:53 PM

Help if you can please
How do you get SF to list the difference in moving averages?
Looking for the difference in a filter to list the difference between the ma(50) and MA(10).
Thank you if you are able to help.

4,377 posts
msg #120380
Ignore four
6/3/2014 10:43:43 PM

set{diff, ma(10) - MA(50)}

draw apo(10,50) line at 0 /* Price, $, difference */
draw diff line at 0 /* Notice APO = DIFF */
draw ppo(10,50) line at 0 /* Percent difference*/

add column apo(10,50) /* */
add column diff
add column ppo(10,50) /* */

334 posts
msg #120399
Ignore jackmack
6/4/2014 10:03:50 AM

Thank you for the reply

Your work is great here - again thank you.


334 posts
msg #120410
Ignore jackmack
6/4/2014 11:01:21 AM


4,377 posts
msg #120428
Ignore four
6/4/2014 12:40:44 PM

In answering your questions (deleted above)...

I believe you asked about : back testing
Answer: something I don't automate

Using Kevin's code will adjust the original intent of how you use the code you wished to improve.

I always have trouble working the exit strategy for gain/loss

Hope this helps, Four

The extra code is from the above site

market is djia
set{relstrength, roc(11,1) - ind(SPY, roc(11,1))}

ADD COLUMN relstrength {relative strength}

do not draw relstrength
draw ind(XLU, relstrength) on plot ind(XLI, relstrength)

ROC(11,1) above 0

set {m51,close/close 5 days ago}
set {m5 ,m51*2}
set {m251,close/close 25 days ago}
set {m25 ,m251*2}
set {m40,close/close 40 days ago}
set{opsz1,m5+m25 }
set{opsz2, opsz1+m40}
set{STT, opsz2/5}
and high below ma(10)
add column STT
draw STT
draw stt line at 1.2
draw stt line at 1
draw stt line at 0.9

sort on column 5

4,599 posts
msg #120434
Ignore Kevin_in_GA
6/4/2014 1:26:35 PM

you need to determine if you are sorting on column 5 ascending or descending.

You are asking how to tweak this, but you are sorting on a momentum-based custom indicator - unless you change that indicator, you'll always end up taking the same trade as the original filter.

What is your exit? Is it when the current stock is no longer the top spot? I think you need to consider optimization of your exit as much as your entry.

334 posts
msg #120444
Ignore jackmack
6/4/2014 1:49:23 PM

To Kevin -
It would be sorting lowest stt to highest as they are returned (currently it is set to return lowest to highest)
Then that one stock would be selected - bought the next day at the open (run at end of month)
Sell stop set at 5%.
I see your point to the fact that this is short term momentum filter but was also
wondering if there wasn't something that would help increase the odds for favorable returns
when the market isn't always going up ;-)
The optimized exit would be 5% - BUT - to that point if 5% is not met then a sell the
last day of the month in order to roll into the next trade the following month.
I hope that helps explain what I was originally after and/or if this is as good as it will get.

To four
I will review your post - Thank You

Kevin - I guess what I meant to ask all along is if there are any supporting indicators that would
"back up" the first selected (returned) stock - like CCI(20) or RSI(14) ect that would say yes or no
to the first returned (lowest stt) stock sort of a confirming (or denying) indication(or) to back up
the original first returned - since the first returned DOES NOT always wind up being the winner
for that month - and so I was just thinking maybe there is something else that would narrow
the field and help in the returns.
Thank you

StockFetcher Forums · General Discussion · Difference in MA's<< >>Post Follow-up

*** Disclaimer *** 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. does not recommend particular securities., 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 2018 - 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