StockFetcher Forums · General Discussion · draw pivot lines<< 1 2 >>Post Follow-up
mahkoh
1,065 posts
msg #97786
Ignore mahkoh
12/3/2010 4:04:49 PM

I would like to draw monthly pivot lines on a chart and came up with this:

set { x1 ,high of the previous month + low of the previous month }
set {x2 , x1 + close of the previous month }
set { monthlypivot , x2 / 3 }
draw monthlypivot

Obviously SF has a problem with this syntax. Anyone know if there is a correct phrase or a workaround ?

mahkoh
1,065 posts
msg #97834
Ignore mahkoh
12/5/2010 11:42:18 AM

No luck so far, thought it may be a good idea to focus on a shorter timeframe first. Weekly pivotnumbers in the columns are working, however plotting them on the chart does not give expected results. First of all they are not plotted on the correct values and second I would expect to see horizontal lines that are as long as one week, after all weekly pivots are valid for one week and don't change during that period.
Anybody got a clue to what I can do to solve this?

Fetcher[

symlist (bac)

set{wp, weekly high 1 week ago + weekly low 1 week ago}
set{wp1,weekly close 1 week ago + wp}
set{wpp, wp1/3}

set{wr1x,wpp*2}
set {wr1,wr1x-weekly low 1 week ago}
set {ws1,wr1x-weekly high 1 week ago}

set{range,weekly high 1 week ago - weekly low 1 week ago}
set {wr2,wpp+range}
set {ws2,wpp-range}

set {2r,range*2}
set {wr3,wpp+2r}
set{ws3,wpp-2r}
and add column ws3
and add column ws2
and add column ws1
and add column wpp
and add column wr1
and add column wr2
and add column wr3

and draw wr3 on plot price
and draw wr2 on plot price
and draw wr1 on plot price
and draw wpp on plot price
and draw ws1 on plot price
and draw ws2 on plot price
and draw ws3 on plot price
]





four
5,087 posts
msg #97835
Ignore four
12/5/2010 1:09:20 PM

http://forums.stockfetcher.com/sfforums/?q=view&fid=1001&tid=69903&qrid=&isiframe=


If your interested, Fibonacci lines.

wkloss
231 posts
msg #97836
Ignore wkloss
12/5/2010 1:50:25 PM

mahkoh,

John Person offers some solutions.

His Persons Pivots and PPS studies are available at thinkorswim. You can open a paper trading account for free.

He suggests that you limit yourself to three lines at any one time. S1 and R1 should always be on your chart. If you think you are in a down market, add S2. If you think you are in an up market, add R2.

Bill


mahkoh
1,065 posts
msg #97842
Ignore mahkoh
12/5/2010 6:09:35 PM

Fetcher[

set{wp, weekly high 1 week ago + weekly low 1 week ago}
set{wp1,weekly close 1 week ago + wp}
set{wpp, wp1/3}

set{wr1x,wpp*2}
set {wr1,wr1x-weekly low 1 week ago}
set {ws1,wr1x-weekly high 1 week ago}

set{range,weekly high 1 week ago - weekly low 1 week ago}
set {wr2,wpp+range}
set {ws2,wpp-range}

set {2r,range*2}
set {wr3,wpp+2r}
set{ws3,wpp-2r}

and add column ws3
and add column ws2
and add column ws1
and add column wpp
and add column wr1
and add column wr2
and add column wr3

and draw ma(20)
and draw ma(50)
and draw ma(200)

set{c1,count(price near ws3,1)}
set{c2,count(price near ws2,1)}
set{c3,count(price near ws1,1)}
set{c4,count(price near wpp,1)}
set{c5,count(price near wr1,1)}
set{c6,count(price near wr2,1)}
set{c7,count(price near wr3,1)}

set {var1,c1+c2}
set{var2,var1+c3}
set{var3,var2+c4}
set{var4,var3+c5}
set{var5,var4+c6}
set{var6,var5+c7}

var6 above .5

add column c1
add column c2
add column c3
add column c4
add column c5
add column c6
add column c7
]



Still needs some work, but I am getting somewhere.

Bill, thanks for your help, I'll check it out.






mahkoh
1,065 posts
msg #97856
Ignore mahkoh
12/6/2010 6:27:21 PM

Another try at the monthly's

Fetcher[
set{mp, monthly high 1 month ago + monthly low 1 month ago}
set{mp1,monthly close 1 month ago + mp}
set{mpp, mp1/3}

set{mr1x,mpp*2}
set {mr1,mr1x-monthly low 1 month ago}
set {ms1,mr1x-monthly high 1 month ago}

set{mrange,monthly high 1 month ago - monthly low 1 month ago}
set {mr2,mpp+mrange}
set {ms2,mpp-mrange}

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

and add column ms3
and add column ms2
and add column ms1
and add column mpp
and add column mr1
and add column mr2
and add column mr3
]



I think my problem is that SF does not know what to do with "monthly" and just disregards this input and uses "high one month ago".
Does someone have experience with setting a specified period?

Kevin_in_GA
4,599 posts
msg #97857
Ignore Kevin_in_GA
12/6/2010 7:03:15 PM

SF only stores daily and weekly data - shoter or longer timeframes are not available.

mahkoh
1,065 posts
msg #97880
Ignore mahkoh
12/7/2010 4:54:27 PM

I was thinking about using the "max" syntax. Taking the max from 30 and 29 days ago, then using that value against 28 days ago and so on until one day ago will get me last month's high on the first day of the new month (if last month had 30 days). The next day I would need another filter that goes from 31 until 2 days ago, then 32 until 3 days ago and so on.
A better way yet would be to build a filter for 62 days to 1 and then every day shift the range by excluding periods with */ /* . As SF excludes weekends, about 45 days back would be enough.

Well, better get to work, if there are suggestions please post.

mahkoh
1,065 posts
msg #97912
Ignore mahkoh
modified
12/9/2010 8:40:50 PM

Got it! :]]

Fetcher[

set{cl,close 7 days ago}
set{mh,high 21 day high 7 days ago}
set{ml,low 21 day low 7 days ago}

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}

and add column ms3
and add column ms2
and add column ms1
and add column mpp
and add column mr1
and add column mr2
and add column mr3
]



Just need to add one day to look back every morning in the three lines on top, and every new month set the number of trading days of the previous month .



mahkoh
1,065 posts
msg #97975
Ignore mahkoh
modified
12/12/2010 1:14:20 PM

I've enhanced the monthly filter a bit so that all I need to do is change the date offset and the number of trading days to look back each first of the month. The date offset affects the whole filter, therefore I use it as my global filter instead of embedding it in my regular filters.
However, if I run the filter by itself and click "debug" it shows a number of syntax errors. I cannot figure out what is wrong, does anyone have an idea?

Fetcher[
date offset 12/01/10
set{mh,high 21 day high 1 days ago}
set{ml,low 21 day low 1 days ago}
set{cl,close 1 days ago}


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}

and add column ms3
and add column ms2
and add column ms1
and add column mpp
and add column mr1
and add column mr2
and add column mr3
]





edit: found the problem, "-" and "+" need a space. Funny that "*" and "/" do not.





StockFetcher Forums · General Discussion · draw 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.