StockFetcher Forums · Filter Exchange · Plotting Cycles(not Harleys)<< >>Post Follow-up
SAFeTRADE
646 posts
msg #160730
Ignore SAFeTRADE
12/21/2023 4:42:44 PM

Using an inverse MACD to plot up and down cycles (not Harleys). As the trend line rises
to meet price prepare for a new cycle. You also see expansion and contraction.

Comment box open |__________|

Fetcher[

/* CODE FOR MACD233 */
set{f, 4 + 1}
set{s, 3 + 1}
set{fastcoef, 2.00 / f}
set{slowcoef, 2.00 / s}

set{ema3, ema(4)}
set{ema6, ema(3)}

set{a, ema3 * fastcoef}
set{b, ema6 * slowcoef}
set{c, a - b}
set{d, fastcoef - slowcoef}
set{e, c / d}
set{e_ema, cema(e,4)}
set{cls2, close}
set{a1,1 - fastcoef}
set{a2, a1 * ema3}
set{b1,1 - slowcoef}
set{b2, b1 * ema6}
set{c1, a2 - b2}
set{c2, 0 - c1}
set{trend_line, c2 / d}

/* CODE FOR MACD233 */
set{8f, 4 + 1}
set{8s, 3 + 1}
set{8fastcoef, 2.00 / 8f}
set{8slowcoef, 2.00 / 8s}

set{8ema3, ema(8)}
set{8ema6, ema(6)}

set{8a, 8ema3 * 8fastcoef}
set{8b, 8ema6 * 8slowcoef}
set{8c, 8a - 8b}
set{8d, 8fastcoef - 8slowcoef}
set{8e, 8c / 8d}
set{8e_ema, cema(8e,6)}
set{8cls2, close}
set{8a1,1 - 8fastcoef}
set{8a2, 8a1 * 8ema3}
set{8b1,1 - 8slowcoef}
set{8b2, 8b1 * 8ema6}
set{8c1, 8a2 - 8b2}
set{8c2, 0 - 8c1}
set{trend_line8, 8c2 / 8d}

set{cycle_up,count(close > trend_line,1)}
set{confirmation_cycle_up,count(close > trend_line8,1)}

symlist(spy,qqq,xlk,xli,xlv,xlf)

draw trend_line on plot price
draw trend_line8 on plot price
draw cycle_up
draw confirmation_cycle_up
draw Williams %R(3)
]



snappyfrog
731 posts
msg #160732
Ignore snappyfrog
modified
12/23/2023 7:27:57 AM

I'm a simple trader. The more simple the better for me.
I plotted and counted the close above the EMA(12) and came up
with pretty much the same thing.

It is neat to see how some of you manipulate coding in SF,
but I get lost many times and strive to make it as simple as possible.

Fetcher[
/* CODE FOR MACD233 */
set{f, 4 + 1}
set{s, 3 + 1}
set{fastcoef, 2.00 / f}
set{slowcoef, 2.00 / s}

set{ema3, ema(4)}
set{ema6, ema(3)}

set{a, ema3 * fastcoef}
set{b, ema6 * slowcoef}
set{c, a - b}
set{d, fastcoef - slowcoef}
set{e, c / d}
set{e_ema, cema(e,4)}
set{cls2, close}
set{a1,1 - fastcoef}
set{a2, a1 * ema3}
set{b1,1 - slowcoef}
set{b2, b1 * ema6}
set{c1, a2 - b2}
set{c2, 0 - c1}
set{trend_line, c2 / d}

/* CODE FOR MACD233 */
set{8f, 4 + 1}
set{8s, 3 + 1}
set{8fastcoef, 2.00 / 8f}
set{8slowcoef, 2.00 / 8s}

set{8ema3, ema(8)}
set{8ema6, ema(6)}

set{8a, 8ema3 * 8fastcoef}
set{8b, 8ema6 * 8slowcoef}
set{8c, 8a - 8b}
set{8d, 8fastcoef - 8slowcoef}
set{8e, 8c / 8d}
set{8e_ema, cema(8e,6)}
set{8cls2, close}
set{8a1,1 - 8fastcoef}
set{8a2, 8a1 * 8ema3}
set{8b1,1 - 8slowcoef}
set{8b2, 8b1 * 8ema6}
set{8c1, 8a2 - 8b2}
set{8c2, 0 - 8c1}
set{trend_line8, 8c2 / 8d}

set{cycle_up,count(close > trend_line,1)}
set{confirmation_cycle_up,count(close > trend_line8,1)}

symlist(spy,qqq,xlk,xli,xlv,xlf)

draw trend_line on plot price
draw trend_line8 on plot price
draw cycle_up
draw confirmation_cycle_up
draw ema(12)
set{e12, count(close above ema(12),1)}
draw e12
draw Williams %R(3)
]





Mactheriverrat
3,157 posts
msg #160733
Ignore Mactheriverrat
12/23/2023 3:12:03 PM

Interesting Code!!!!

Mactheriverrat
3,157 posts
msg #160734
Ignore Mactheriverrat
modified
12/23/2023 3:13:49 PM

The code for ema 12 .

/* 1212 is number of consecutive days EMA(12) above (+)/below(-) previous EMA(12) */
set{1212b,days( ema(12) is above ema(12) one day ago ,250)}
set{1212a,days( ema(12) is below ema(12) one day ago,250)}
set{12, 1212a - 1212b} and add column 12 {12}

Set{cntema12aboveema12,count( eMA(12) > eMA(12) one day ago,1)}
draw cntema12aboveema12

Set{cntema12aboveema12b,count( eMA(12)< EMA(12) one day ago,1)}

draw cntema12aboveema12b

StockFetcher Forums · Filter Exchange · Plotting Cycles(not Harleys)<< >>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.