Pivot Analysis

Jedster
Trader
Posts: 26
Joined: Wed Aug 08, 2012 3:38 pm

Pivot Analysis

Post by Jedster »

Guys,

Before I go off and do a bunch of work, has anyone published any tools to calculate the statistical probabilities of pivot levels being hit. The sort of thing where it says, over x period of time, R1 was hit 52%, R2 was hit 46% of the time and R3 21%, etc, etc.

I have searched the forums but can't find anything. Perhaps it was my search criteria, or perhaps it hasn't been done in depth.

Thanks
J
fxarun
Trader
Posts: 41
Joined: Tue Feb 07, 2012 10:21 am
Location: Chennai India

Re: Pivot Analysis

Post by fxarun »

Statistical analysis of daily pivots, support and resistance levels for EURUSD.
http://www.mql5.com/en/forum/2724

Regards,

Arun
"It's not the strongest species that survive, nor the most intelligent, but the one most responsive to change"
-- Darwin.
Jedster
Trader
Posts: 26
Joined: Wed Aug 08, 2012 3:38 pm

Re: Pivot Analysis

Post by Jedster »

Thanks for your reply. I guess that no one else has done it so I'll post mine when i'm done.
Jedster
Trader
Posts: 26
Joined: Wed Aug 08, 2012 3:38 pm

Re: Pivot Analysis

Post by Jedster »

Ok, so attached is an indicator I wrote to calculate the % probabilities that pivot levels will get hit.

The indicator works in two modes. Originally I wrote it to look at pivot levels on an hourly basis. I was looking to trade reversals at pivot levels using binaries, hence I needed to know what would happen within an hour of a pivot level being hit. I then changed it to calculate the daily stats, hence why there are two modes. Make sure you leave CalculateDaily set true and CalculateHourly to false.

The rest of the properties you should probably also leave at their defaults. The ones that might be worth tweaking are:

TolerencePips Default = 2 The value that price must be within to be considered a hit on the level. Set to zero if a precise and absolute hit is required.

BarsToProcess Default = 0 means every bar. Set to x to only process the most recent x bars
UseStartDate default = false Set to true to use a date range instead of bar count. Note this overrides BarsToProcess
StartDate = "2012.04.01";
EndDate = "2012.12.31";

IncludeSundaysInStats default= false. We don't really want to include data from sunday, but you can if you want.

Here is a screeen shot of the spreadsheet it produces.
PP analysis.png
The way to read this is as follows:

The first column lists the level we are referring to and the "Hit" Column is how many times that level was hit. So the green highlighted cell is the beginning of the row for the pivot point (daily pivot). The yellow cell is simply the number of hits there were. So out of 1672 days where the DO > PP, the pivot was actually hit 1319 times. The rest of the "Count" cells tell you how many times other levels were hit AFTERwards. So for this example row, we are referring to the PP. These are the useful numbers.

So for example, the blue cell tells us that after the PP was hit, price went back to R1 514 times and the dark orange cell tells us price went to R2 244 times.

Note that the red/pink highlighted cell is zero. When a level is hit, I don't count further hits to that level. So if price hit the PP, then to R1 and then went back to the PP, we don't capture that second hit. So, the value for PP on that row is zero.

There are also a whole bunch of percentage columns which I simply find easier to read, rather than looking at raw numbers. They are more telling. The Pivot is hit nearly 80% of the time!

I don't think there are any bugs, I've been through it and tested it out on random selections of data, to be sure it is counting and calculating correctly. Of couse, you never can be too sure, it looks ok to me, but if you notice anything please let me know.
You do not have the required permissions to view the files attached to this post.
User avatar
blazko
Trader
Posts: 86
Joined: Thu Dec 01, 2011 10:57 am

Re: Pivot Analysis

Post by blazko »

thank a lot!!
cheers
User avatar
MurphyMan
Trader
Posts: 345
Joined: Tue Nov 15, 2011 2:35 pm
Location: Southern Illinois, USA

Re: Pivot Analysis

Post by MurphyMan »

Fantastic work! Now, all I have to do is figure out to work it to my advantage!

Sam
fxarun
Trader
Posts: 41
Joined: Tue Feb 07, 2012 10:21 am
Location: Chennai India

Re: Pivot Analysis

Post by fxarun »

Nice one Jedster !
Have been Looking for this kind of stuff ! Thanks a lot Mate .

Arun
"It's not the strongest species that survive, nor the most intelligent, but the one most responsive to change"
-- Darwin.
davidg29
Posts: 1
Joined: Sat Dec 22, 2012 12:51 am

Re: Pivot Analysis

Post by davidg29 »

Thanks Jedster, How did you go using Pivot Analysis with BO?

David
User avatar
Jemook
Trader
Posts: 1085
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Re: Pivot Analysis

Post by Jemook »

Really liking the progress of this thread and your work Jedster.. I can imagine NB would be alllll over this research.
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
Lifesys
Trader
Posts: 126
Joined: Wed Apr 25, 2012 2:05 am
Location: Echuca Victoria. Australia

Re: Pivot Analysis

Post by Lifesys »

Well done Jedster.
As mentioned in PM, my observations have been that, not only for ranging times (>70%), price reverts DO to DP far more times than away and it is NB's skillful management that gets him the pips.
'Reversion to mean' is majority by definition.
I compiled an EA (not bullet proof) which scalps Abs(DP - DO) when > (spread+slippage+MinTrade) for pairs each day at (real) D1 start.
Many small +ve trades net av. > 350pip/day, but challenge is protection against trends.

Success ratio >80% but R:R is poor, hence TP (or +ve close) av. must be > 1/4 SL (or -ve close) av.
Included TMA in reverse. No trade if daily open H1 TMASlope is >0.4 or all ADX-MTF same direction.
Not sure this or D1 iAtr() ratio SL helps much as Abs(DP -DO) size depends on larger move prev. day (or last hour) but then usually comes a lull & vice versa.
If consistent, net av. > 100pip/day then workable.

Was really interested in Jedster's indi. to run through and back test above on numerous pairs.

Paul
Post Reply

Return to “General Forex Discussion”