Welcome to the Traders Laboratory.

Coding Forum Collaborate, receive help, or discuss indicators and other coding-related topics

Reply
Old 01-30-2008, 06:23 PM   #1

Join Date: Jan 2008
Location: Dallas
Posts: 8
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts

Auto-Pivot Points with Price

Hello Guys

I found this indicator and seems very promising. It automatically calculates pivots for Daily/weekly and monthly. It also shows the price at the axis.

If anybody could code the mid-ranges for the daily pivots will be nice.

Here's the code for the pivot point


[LegacyColorValue = TRUE];

{ Support and Resistance Pivot Indicator
Written by: HamFon
Contact: ncrowle@sprintmail.com
Date: 06/11/2004, original 12/02/2002
Revision: 1.04
Status: Gnu Public License - this indicator may be used or shared freely with
no fee, as long as this original header comment is included.
Purpose: Displays Support and Resistance values based on "Pivot" (Typical Price).
}

{ Unfortunately, tradestation only will plot four simultaneous lines per Indicator instance.
Yes - I know all about creating TrendLines - but they have their own limitations, and use
more resources that must be carefully tracked.

Therefore - since we want to plot five lines, you need to load two different indicators:
Ham Pivot Lines, and Ham Pivot Lines2.

The code below is for both - one section or the other is commented out.
}

inputs: Day0Week1Month2 (0);

vars: Support1(0), Support2(0), RSPivot(0), Resistance1(0), Resistance2(0);
vars: SaveHigh(0), SaveLow(0), SaveClose(0), SaveSession(0);

SaveSession = CurrentSession(0);
if SaveSession <> SaveSession[1] and (
Day0Week1Month2 = 0 or
(Day0Week1Month2 = 1 and DayOfWeek (Date) < DayOfWeek (Date[1])) or
(Day0Week1Month2 = 2 and DayOfMonth (Date) < DayOfMonth (Date[1]))
) then begin
RSPivot = (SaveHigh + SaveLow + SaveClose) / 3;
Resistance1 = 2 * RSPivot - SaveLow;
Support1 = 2 * RSPivot - SaveHigh;
Resistance2 = RSPivot + SaveHigh - SaveLow; { equivalent to Pivot+(Resistance1-Support1) }
Support2 = RSPivot - SaveHigh + SaveLow; { equivalent to Pivot-(Resistance1-Support1) }
SaveHigh = 0;
SaveLow = 0;
SaveClose = 0;
end;

if SaveHigh = 0 or high > SaveHigh then
SaveHigh = high;
if SaveLow = 0 or low < SaveLow then
SaveLow = low;
SaveClose = close;

if Support1 > 0 then begin

{ This code is for Ham Pivot Lines2 - comment out for Ham Pivot Lines }
plot1 (RSPivot, "Pivot");
{}

{ This code is for Ham Pivot Lines - comment out for Ham Pivot Lines2
plot1 (Resistance2, "R2");
plot2 (Resistance1, "R1");
plot3 (Support1, "S1");
plot4 (Support2, "S2");
}
end;


here's the code for S/R lines
[LegacyColorValue = TRUE];

{ Support and Resistance Pivot Indicator
Written by: HamFon
Contact: ncrowle@sprintmail.com
Date: 06/11/2004, original 12/02/2002
Revision: 1.04
Status: Gnu Public License - this indicator may be used or shared freely with
no fee, as long as this original header comment is included.
Purpose: Displays Support and Resistance values based on "Pivot" (Typical Price).
}

{ Unfortunately, tradestation only will plot four simultaneous lines per Indicator instance.
Yes - I know all about creating TrendLines - but they have their own limitations, and use
more resources that must be carefully tracked.

Therefore - since we want to plot five lines, you need to load two different indicators:
Ham Pivot Lines, and Ham Pivot Lines2.

The code below is for both - one section or the other is commented out.
}

inputs: Day0Week1Month2 (0);

vars: Support1(0), Support2(0), RSPivot(0), Resistance1(0), Resistance2(0);
vars: SaveHigh(0), SaveLow(0), SaveClose(0), SaveSession(0);

SaveSession = CurrentSession(0);
if SaveSession <> SaveSession[1] and (
Day0Week1Month2 = 0 or
(Day0Week1Month2 = 1 and DayOfWeek (Date) < DayOfWeek (Date[1])) or
(Day0Week1Month2 = 2 and DayOfMonth (Date) < DayOfMonth (Date[1]))
) then begin
RSPivot = (SaveHigh + SaveLow + SaveClose) / 3;
Resistance1 = 2 * RSPivot - SaveLow;
Support1 = 2 * RSPivot - SaveHigh;
Resistance2 = RSPivot + SaveHigh - SaveLow; { equivalent to Pivot+(Resistance1-Support1) }
Support2 = RSPivot - SaveHigh + SaveLow; { equivalent to Pivot-(Resistance1-Support1) }
SaveHigh = 0;
SaveLow = 0;
SaveClose = 0;
end;

if SaveHigh = 0 or high > SaveHigh then
SaveHigh = high;
if SaveLow = 0 or low < SaveLow then
SaveLow = low;
SaveClose = close;

if Support1 > 0 then begin

{ This code is for Ham Pivot Lines2 - comment out for Ham Pivot Lines
plot1 (RSPivot, "Pivot");
}

{ This code is for Ham Pivot Lines - comment out for Ham Pivot Lines2 }
plot1 (Resistance2, "R2");
plot2 (Resistance1, "R1");
plot3 (Support1, "S1");
plot4 (Support2, "S2");

end;
Mr.Money is offline  
Reply With Quote
Old 03-01-2016, 04:17 AM   #2

Join Date: Aug 2011
Posts: 116
Ignore this user

Thanks: 128
Thanked 32 Times in 27 Posts

Re: Auto-Pivot Points with Price

Another HamFon indicator is the ZigZag Fib Points !
Attached Thumbnails
Auto-Pivot Points with Price-zigzag-fib-points-3-1-16.jpg  
Attached Files
File Type: eld ZIGZAG FIB POINTS.ELD (22.1 KB, 40 views)
johnnydaymon is offline  
Reply With Quote
Old 03-01-2016, 04:43 AM   #3

Join Date: Aug 2011
Posts: 116
Ignore this user

Thanks: 128
Thanked 32 Times in 27 Posts

Re: Auto-Pivot Points with Price

Seems like dude pasted the code above twice without the code box ! If you look closely it's the same code posted twice . Hamfon's eld of the original post
Attached Thumbnails
Auto-Pivot Points with Price-auto-pivot-points-price-3-1  
Attached Files
File Type: eld AUTO-PIVOT POINTS WITH PRICE.ELD (11.1 KB, 38 views)
johnnydaymon is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:

Similar Threads
Thread Thread Starter Forum Replies Last Post
An Auto Pivot Level Indicator GCB Trading Indicators 16 12-26-2011 03:41 AM
Auto Pivot Point Indicator with Labels Soultrader Trading Indicators 4 04-30-2009 09:50 AM
S/R and PIVOT POINTS john15689 Beginners Forum 4 02-01-2008 09:26 AM
Entry using pivot points Mr.Money Technical Analysis 4 01-26-2008 12:57 PM
ATR and Pivot Points earsha Technical Analysis 12 01-22-2007 04:26 PM

All times are GMT -4. The time now is 11:13 AM.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
2006-2011 Traders Laboratory, All Rights Reserved.