Help - Search - Members - Calendar
Full Version: Pivot points - Alternate Indicator Included (by Forum Admin)
Visual Trading Systems User Forums > VTTRADER INDICATORS > NEW INDICATORS POSTINGS
jackap
Hello all,

I just would like to mention that it looks like the pivot points indicator (the one included in latest version) has a bug in my opinion.

The problem shows up after weekend - I guess the on bar which forms after 5 pm EST makes the problem. Look at the attached picture - the numbers are not pivots for today - if you go to some sites which provide them or calculate yourself you will find out. It looks like at the first bar after the weekend they are OK but then they get corrupted.

On weekdays everything is OK.

Jacek

Pivots for EURUSD today:
Resist-3 Resist-2 Resist-1 Pivot Supp-1 Supp-2 Supp-3
1.2404 1.2356 1.2295 1.2247 1.2186 1.2138 1.2077

* ADMINISTRATOR NOTE: I included a recoded pivot point indicator farther down is this topic to address this issue. It is available for those you that wish to use it. However, I will most likely not be changing the included pivot point indicator in VTtrader since that would affect its ability to work as expected for anyone using other times than the default 5PM EST for pivot calculations. Thank you.
cskidmore
Hello,

This appears to be only an issue when the market gaps because, depending on your broker, the opening candle on Sunday evening has a 17:00 timestamp so the pivots recalculate at that time (instead of continueing to use Friday's 17:00 pivot calculation). Thank you for the report.

Regards,
Chris
jackap
Hello,

This seems to happen all over after weekend - sometimes the pivots are closer to the proper values, sometimes farther.

Is there a way to avoid these things? To program it in a different way? I made today a wrong decision because of the misleading pivot indicator.

Jacek
cskidmore
Hello,

Here is a pivot point indicator that should better account for weekend openings when there is a gap. However, for Sunday evening and Monday's pivots I had to use some code that effectively takes the StartHour (17 = 5PM EST) and subtracts 1 from it ( = 4PM EST) because the market typically closes at 4 PM EST on Friday. Without this modification, it is pratically impossible to properly account for weekend data when calculating the pivots at 5PM EST each day.

Please download it to your PC, import into VTtader and test.

Regards,
Chris
jackap
Hi,

Is there a difference between the indicator you just supplied and the standard Pivot Points indicator? It draws the same lines and the code appears to be identical.

Jacek
cskidmore
Hello,

Yes. There is a difference. The indicator supplied will handle calculating the pivots more accurately on Sunday evening and during Monday (before they are recalculated).

The code that was changed in the new indicator is below...

StartHour and StartMinute are defined in Eastern Standard Time...
Default is to calculate pivots at 5:00 PM EST each day}

H1:= if(
DayOfWeek()=7 OR (DayOfWeek()=1 and Hour()<StartHour),
valuewhen(1, DayOfWeek()=5 AND Hour()=(StartHour - 1) AND minute()=StartMinute, HHV(H,LookBackPeriods)),
valuewhen(1, Hour()=StartHour AND minute()=StartMinute, HHV(H,LookBackPeriods))
);

L1:= if(
DayOfWeek()=7 OR (DayOfWeek()=1 and Hour()<StartHour),
valuewhen(1, DayOfWeek()=5 AND Hour()=(StartHour - 1) AND minute()=StartMinute, LLV(L,LookBackPeriods)),
valuewhen(1, Hour()=StartHour AND minute()=StartMinute, LLV(L,LookBackPeriods))
);

C1:= if(
DayOfWeek()=7 OR (DayOfWeek()=1 and Hour()<StartHour),
valuewhen(1, DayOfWeek()=5 AND Hour()=(StartHour - 1) AND minute()=StartMinute, C),
valuewhen(1, Hour()=StartHour AND minute()=StartMinute, C),
);

This code is different from the original code in that it uses a slightly different method to determine the High, Low, and Close price to calculate pivots on Sunday and during Monday.

You mentioned that you did not think the pivot indicator was accurate enough on Sunday and Monday. This is because when there is a gap in the markets that is noticeable, there pivot indicator was using the Close price from Sunday evening (shortly after market open) to calculate the pivots. I changed this so that it uses Friday at (StartHour() - 1) 4 PM EST by default. This eliminates issues with large gaps throwing the pivots so far off for Monday.

Regards,
Chris
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.