StockFetcher Forums · General Discussion · Work around for monthly pivot lines<< 1 2 >>Post Follow-up
15minoffame
131 posts
msg #112796
Ignore 15minoffame
4/16/2013 7:53:24 PM

Hi SF master level technicians,
I know SF doesn't offer monthly numbers but is it possible nonetheless to do a work around? I like how stockcharts.com has it that the pivot levels remain the same for the entire month. This month's pivot levels are based on March's high, low, & close.

Much appreciated in advance!

Tuan

Cheese
1,374 posts
msg #112807
Ignore Cheese
4/17/2013 1:56:14 AM

I would use the new sF date-based features at
http://www.stockfetcher.com/sfforums/?q=view&fid=1004&tid=112556&qrid=

Fetcher[

set{prior_monthend_PP, DATE(MONTHEND,PP)}
add column prior_monthend_PP
draw prior_monthend_PP on plot price

set{prior_monthend_R1, DATE(MONTHEND,R1)}
add column prior_monthend_R1
draw prior_monthend_R1 on plot price

set{prior_monthend_S1, DATE(MONTHEND,S1)}
add column prior_monthend_S1
draw prior_monthend_S1 on plot price

symlist(SPY)
]



mahkoh
1,065 posts
msg #112808
Ignore mahkoh
modified
4/17/2013 7:16:44 AM

I think that shows the daily pivots on the last day of the prior month.
For monthly lines try this:

Fetcher[
Symlist(spy)

set{mh,date(monthend,high 20 day high)}
set{ml,date(monthend,low 20 day low)}
set{cl,date(monthend,close)}


set{mp1,cl + mh}
set{mp,mp1 + ml}
set{mpp,mp/3}

set{mr1x,mpp*2}
set{mr1,mr1x - ml}
set{ms1,mr1x - mh}

set{mrange,mh - ml}
set{mr2,mpp + mrange}
set{ms2,mpp - mrange}

set{m2r,mrange*2}
set{mr3,mpp + m2r}
set{ms3,mpp - m2r}

draw price line at mr2
draw price line at ms1
draw price line at ms2
draw price line at mr1
draw price line at mpp

]



You will need to adjust the number of trading days of the prior month each new month.

15minoffame
131 posts
msg #112811
Ignore 15minoffame
4/17/2013 10:22:05 AM

Thank you very much Cheese & Mahkoh! I'm so glad there's people here on SF that can write codes with ease because even though I've been with SF for 5 years now, I've barely graduated beyond the filter builder...lol. You two keep this up & soon you'll be in the SF pantheon of great code contributors!

Mahkoh, your code is exactly what I'm looking for! The pivots are only off by a penny to Stockchart's when I use 22 days.

Thanks again for your help!

Now, my next request is can either of you two able to write codes that can predict correct lotto numbers...ha! :-)

mahkoh
1,065 posts
msg #112814
Ignore mahkoh
4/17/2013 1:29:01 PM

The pivots being slightly off may have to do with calculation of monthly high and low. I never thought of this before but it could be that you have to use the monthly high close rather that the intraday high.

Fetcher[
Symlist(spy)

set{mh,date(monthend,close 20 day high)}
set{ml,date(monthend,close 20 day low)}
set{cl,date(monthend,close)}


set{mp1,cl + mh}
set{mp,mp1 + ml}
set{mpp,mp/3}

set{mr1x,mpp*2}
set{mr1,mr1x - ml}
set{ms1,mr1x - mh}

set{mrange,mh - ml}
set{mr2,mpp + mrange}
set{ms2,mpp - mrange}

set{m2r,mrange*2}
set{mr3,mpp + m2r}
set{ms3,mpp - m2r}

draw price line at mr2
draw price line at ms1
draw price line at ms2
draw price line at mr1
draw price line at mpp

]



Could you check these values?

15minoffame
131 posts
msg #112822
Ignore 15minoffame
4/17/2013 3:55:13 PM

Hi Mahkoh,
Now it's way off even after I entered 22 days. Stockchart's April Spy pivot levels: S2 147.32, S1 151.99, P 154.42, R1 159.10, R2 161.53.

Thanks!

Tuan

mahkoh
1,065 posts
msg #112823
Ignore mahkoh
modified
4/17/2013 4:38:32 PM

It must have to do with SPY going ex-dividend March 15. If you replace SPY with a non dividend paying stock like DTV the values match (when using high 20 day high version))
Stockcharts is known to adjust for dividends.

15minoffame
131 posts
msg #112829
Ignore 15minoffame
4/17/2013 10:32:03 PM

Mahkoh,
I tried to say close crossed above ms1, mpp, etc., but it's not working. Would you by chance know how I can go about doing this?

Thanks again!

Tuan

mahkoh
1,065 posts
msg #112835
Ignore mahkoh
4/18/2013 1:16:04 PM

You can use to give you stocks that are up to 1 % above ms1

set{x,price/ms1}
x between 1 and 1.01

or

Count(price above ms1,6) above 4
price below ms1

to show stocks that crossed below ms 1 after having been above for at least the last 5 days



15minoffame
131 posts
msg #112836
Ignore 15minoffame
4/18/2013 3:56:53 PM

Mahkoh,
So I can't say close crossed above ms1 within last 1 day?

StockFetcher Forums · General Discussion · Work around for monthly pivot lines<< 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.