Pivot value using PivotHighVS not always valid

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Pivot value using PivotHighVS not always valid

Postby arjfca » 20 Jul 2011

Hello again

I want to kept the value of the last pivot high using the formula

Code: Select all

LSH1 = PivotHighVS(1, High, 1, 1, 21);
This will give me the first occurrence of a high bar price having a lower high on each side for the last 21 bars.

It work great except when the highest price as the same value as the preceding one, IE: a double top. In my view, this is not a pivot because price was not able to go over is last previous price, both high's are equal.

Any idea how I could code to get only a high pivot value for a bar that as a lower high on each side.

Martin
Attachments
PivotHigh.jpg
(31.44 KiB) Downloaded 375 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Pivot value using PivotHighVS not always valid

Postby TJ » 20 Jul 2011

Code: Select all

if LSH1[1] <> PivotHighVS(1, High, 1, 1, 21) then
LSH1 = PivotHighVS(1, High, 1, 1, 21);

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Pivot value using PivotHighVS not always valid

Postby arjfca » 20 Jul 2011

Thanks TJ, I will give it a try. So simple when the nose is placed further than the problem :)

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Pivot value using PivotHighVS not always valid

Postby TJ » 20 Jul 2011

Thanks TJ, I will give it a try. So simple when the nose is placed further than the problem :)
note: I have edited the code.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Pivot value using PivotHighVS not always valid

Postby arjfca » 20 Jul 2011

TJ,

Still give me the same erroneus values. I did modified my code to limit to barnumber lower than the last double top that i found. This way, PivotHighVS is valid and replicate my problem.

A bit of outside bicycling for me before writing a modified of PivotHighVS function
Martin


Return to “MultiCharts”