StockFetcher Forums · General Discussion · Difference in MA's<< >>Post Follow-up
jackmack
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.
Cheers

four
5,087 posts
msg #120380
Ignore four
modified
6/3/2014 10:43:43 PM

Fetcher[
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) /* http://www.stockfetcher.com/forums/Indicators/Absolute-Price-Oscillator-APO/170 */
add column diff
add column ppo(10,50) /* http://www.stockfetcher.com/forums/Indicators/Percent-Price-Oscillator-PPO/171 */
]

jackmack
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.

Cheers


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

.

four
5,087 posts
msg #120428
Ignore four
modified
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

---
http://www.stockfetcher.com/forums/Filter-Exchange/A-SIMPLE-MARKET-TIMING-FILTER/103064
The extra code is from the above site
---

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

/*symlist(XLI,XLU,SPY)*/
ADD COLUMN SEPARATOR
ADD COLUMN relstrength {relative strength}

SORT ON COLUMN 6 DESCENDING
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
]



Kevin_in_GA
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.

jackmack
334 posts
msg #120444
Ignore jackmack
modified
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
Cheers


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
Cheers

StockFetcher Forums · General Discussion · Difference in MA's<< >>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.