Pivot points

How to create strategies and indicators
Message
Author
forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

Pivot points

#1 Postby forextester » Sun Apr 19, 2009 3:13 pm

Dear Mike,

hope you are best of health.

I need a weekly/monthly pivot points indicator. Since havent' written it yet so i would write it myself.

I studied your "Pivot Points" indicator which plots daily pivot points. I need help understanding the function Trunc().

Code: Select all

day := trunc(Time(index));



Why did you use this function. If it truncates the datetime variable then what does it output? If it only outputs "the Day" the could i use Dayof(time(i)) or Dateof(time(0)) instead?

Thanks and regards

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Pivot points

#2 Postby Terranin » Tue Apr 21, 2009 9:51 pm

forextester wrote:Dear Mike,

hope you are best of health.

I need a weekly/monthly pivot points indicator. Since havent' written it yet so i would write it myself.

I studied your "Pivot Points" indicator which plots daily pivot points. I need help understanding the function Trunc().

Code: Select all

day := trunc(Time(index));



Why did you use this function. If it truncates the datetime variable then what does it output? If it only outputs "the Day" the could i use Dayof(time(i)) or Dateof(time(0)) instead?

Thanks and regards


Yes, it could be. Just trunc is a little bit faster.

I am working on Pivot Points now, so it will be ready soon. You can try new version attached.
Attachments
PivotPoints.zip
(49.58 KiB) Downloaded 978 times
Hasta la vista
Mike

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

Re: Pivot points

#3 Postby forextester » Wed Apr 22, 2009 11:30 am

I am working on Pivot Points now, so it will be ready soon. You can try new version attached.


Thanks a lot Mike,

Since you are already working on the pivot points indicator, Please be kind enough to add the option of "Weekly, monthly pivots".

PS: The new version you attached is apparently the same. What modifications did you make?

regards

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Pivot points

#4 Postby Terranin » Wed Apr 22, 2009 11:36 am

forextester wrote:
I am working on Pivot Points now, so it will be ready soon. You can try new version attached.


Thanks a lot Mike,

Since you are already working on the pivot points indicator, Please be kind enough to add the option of "Weekly, monthly pivots".

PS: The new version you attached is apparently the same. What modifications did you make?

regards


It should work as weekly and monthly pivots if you place it on higher timeframes.
Hasta la vista

Mike

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

Re: Pivot points

#5 Postby forextester » Wed Apr 22, 2009 12:10 pm

It should work as weekly and monthly pivots if you place it on higher timeframes.

[/quote]

works only upto 4hrs time frame and displays only upto daily pivots.
Doesn't show any output when applied to daily or weekly charts.

If there is problem on my end then please let me know.

I would appreciate if you could please provide the code as well for the new pivot points indicator which displays weekly, monthly pivots.

thanks and regards,

PS: how do onei make the weekly pivots visible on any other lesser time frame?

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Pivot points

#6 Postby Terranin » Wed Apr 22, 2009 12:23 pm

forextester wrote:
It should work as weekly and monthly pivots if you place it on higher timeframes.



works only upto 4hrs time frame and displays only upto daily pivots.
Doesn't show any output when applied to daily or weekly charts.

If there is problem on my end then please let me know.

I would appreciate if you could please provide the code as well for the new pivot points indicator which displays weekly, monthly pivots.

thanks and regards,

PS: how do onei make the weekly pivots visible on any other lesser time frame?[/quote]

How did you install it? It works on my computer.
Attachments
img.gif
img.gif (28.91 KiB) Viewed 22834 times
Hasta la vista

Mike

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#7 Postby Terranin » Wed Apr 22, 2009 1:11 pm

Try new version attached, there is an option to choose pivot type - daily/weekly/monthly/yearly
Attachments
PivotPoints.zip
(49.73 KiB) Downloaded 928 times
Hasta la vista

Mike

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

#8 Postby forextester » Wed Apr 22, 2009 1:55 pm

Try new version attached, there is an option to choose pivot type - daily/weekly/monthly/yearly


it works perfectly. A job well done.

Thanks a lot Mike.

However when i manually calculated the points, they were absolutely wrong both daily and weekly.


The original pivot points indicator with the Forextester calculates the correct pivot points(daily) whereas the latest pivot points indicator attached above calculates false ones(both daily and weekly).

In the picture attached the old and correct indicator pivot line(PP) is Black, whereas the latest and false indicator line(PP) is red.

Please solve the problem and please post the code as well after you are done so we can benefit from it.

looking forward to your reply.

great work, regards
Attachments
pivot points.jpg
red, latest indicator, false;

black, old indicator, correct;
pivot points.jpg (58.01 KiB) Viewed 22827 times

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#9 Postby Terranin » Wed Apr 22, 2009 3:53 pm

I checked and it works correctly, see attached image. If you have your image with calculation I would like to see. On image Pivot Point is bold red line.
Attachments
img1.png
img1.png (26.54 KiB) Viewed 22826 times
Hasta la vista

Mike

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

#10 Postby forextester » Wed Apr 22, 2009 5:26 pm

I checked and it works correctly, see attached image. If you have your image with calculation I would like to see. On image Pivot Point is bold red line.


After applying daily pivots, i move to daily chart where each candle contains all the data (its high, low and close) sufficient enough to calculate the next day's pivot point ie (high+low+close)/3. then i move to 1 hour chart and see whether the displayed and manually calculated pivots are the same.

after 23 weeks of correct daily pivot points, the latest indicator started giving erroneous results. As you will see in the 3 screen shots attached, there is huge difference between the correct and displayed pivot points. And as the chart moves ahead the gap between correct and displayed pivot points gets wider and wider.

I haven't tested the weekly pivots yet but suspect the gaps to get even wider than those by daily pivots.

looking forward to a solution soon.

regards
Attachments
hour 1 chart.gif
hourly analysis of daily PP
hour 1 chart.gif (31.48 KiB) Viewed 22815 times
day2.gif
Second daily candle's high, low and close.
day2.gif (24.06 KiB) Viewed 22814 times
day1.gif
first daily candle's high, low and close.
day1.gif (30.62 KiB) Viewed 22814 times

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

#11 Postby forextester » Wed Apr 22, 2009 5:28 pm

I couldn't add more than three screen shots. the attached archive contains all 4 vital screen shots to explain what i feel is the problem.

regards
Attachments
pivots.rar
this archive contains 4 screenshots to show the irregularities.
(109.42 KiB) Downloaded 860 times

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#12 Postby Terranin » Sun Apr 26, 2009 11:03 am

forextester wrote:I couldn't add more than three screen shots. the attached archive contains all 4 vital screen shots to explain what i feel is the problem.

regards


On version 2 this indicator works correctly. I checked bars with your method and result is always correct.
Hasta la vista

Mike

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

#13 Postby forextester » Sun Apr 26, 2009 11:21 am

On version 2 this indicator works correctly. I checked bars with your method and result is always correct.


heard great things about ver 2.0.

If you'd be kind enough to share the source code of this latest indicator, maybe i'll put in some time and adjust it to my needs and learn from it at the same time.

regards and thanks.
Sheraz

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#14 Postby Terranin » Sun Apr 26, 2009 2:29 pm

forextester wrote:
On version 2 this indicator works correctly. I checked bars with your method and result is always correct.


heard great things about ver 2.0.

If you'd be kind enough to share the source code of this latest indicator, maybe i'll put in some time and adjust it to my needs and learn from it at the same time.

regards and thanks.
Sheraz
Attachments
PivotPoints.zip
(1.64 KiB) Downloaded 969 times
Hasta la vista

Mike

forextester
Posts: 33
Joined: Thu Feb 19, 2009 8:40 am

#15 Postby forextester » Sun Apr 26, 2009 2:39 pm

thanks Mike.


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 16 guests