|
|
|
|
|||||||
| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
||||
|
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; |
![]() |
LinkBacks (?)
LinkBack to this Thread: http://www.traderslaboratory.com/forums/f56/auto-pivot-points-with-price-3355.html
|
||||
| Posted By | For | Type | Date | |
| Traders Laboratory | This thread | Refback | 01-30-2008 05:24 PM | |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| S/R and PIVOT POINTS | john15689 | Beginners Forum | 4 | 02-01-2008 08:26 AM |
| Entry using pivot points | Mr.Money | Technical Analysis | 4 | 01-26-2008 11:57 AM |
| Auto Pivot Point Indicator with Labels | Soultrader | Trading Indicators | 3 | 09-29-2007 11:08 AM |
| An Auto Pivot Level Indicator | GCB | Trading Indicators | 8 | 07-31-2007 09:17 AM |
| ATR and Pivot Points | earsha | Technical Analysis | 12 | 01-22-2007 03:26 PM |