V1.0 released 08-15-09
V1.1 released 08-18-09
V1.2 not released
V1.3 released 08-29-09
V1.31 released 08-30-09
V1.4 released 09-04-09
V1.5 released 09-08-09
Source code is posted!!!! (I found a back up )
This is my version of a popular indicator.
Features:
- Calculate Pivots from any timezone starting at any hour.
- Calculate Traditional pivots or Fibo Extension pivots (or both).
- Graph Monthly, Weekly or daily (or all) pivots plus mid pivots.
- Graph 50% of yesterdays High/Low.
- Graph High and Low of yesterday and prior days range also today's open.
- Graph dynamic Sweet Spots (round numbers).
- Graph a daily candle.
- Graph two Daily SMAs.
- Ability to make major variables global for use in other indicators or EAs.
- All/None/Any of the graphs can be enabled.
The indi *should* be able to figure out what GMT is from any computer anywhere. Using GMT it can then calculate what different time offsets are need to correctly display the start of days on your computer with your broker. So no setting are needed for your particular location.
The correct way to set CalcInWhatTimeZone and CalcFromWhatHour are by setting CalcInWhatTimeZone to the GMT offset for the calculation region and CalcFromWhatHour to the hour you wish to start the calculations from in that region.
Examples are more clear:
New York:
CalcInWhatTimeZone = -4 (EST)
CalcFromWhatHour = 17 (Hour of NYSE Close)
or
CalcFromWhatHour = 0 (Midnight EST)
London:
CalcInWhatTimeZone = 0 (GMT)
CalcFromWhatHour = 8 (Hour of London Open)
Toyko:
CalcInWhatTimeZone = 9 (Toyko GMT Offset)
CalcFromWhatHour = 18 (Hour of Tokyo Close)
My intention is to have the indi self adjust all the parameters for your particular location and broker and all you need to figure out is the timezone and the hour in that timezone of how you want the pivots calculated. It also should adjust for DST on your computer. Currently it does not for the CalcInWhatTimeZone so you may need to change that when the time changes for DST. Unless I can code it in
It defaults to New York Close and if that is what you want no changes are needed.
Traditional pivots are based on the (H+L+C)/3 formula.
Fibo Extension Pivots are fibo extensions of the previous days high to low and then extended off today's pivot point. For example; Draw a fibo extension from high to low of yesterday then place the third data point at the pivot line of today. To get the extension to the other direction draw the fibo extension from low to high of yesterday and the third point at today's pivot.
Weekly and monthly pivots are drawn in the color scheme of the daily pivot type (traditional or fibo) only in a different line style.
Dynamic Sweet Spots show only around current PA. With the upper and lower 00 and the 50.
Daily candle is graphed on the PA of today at the zero bar.
Two SMA based on daily close are graphed for today,yesterday and the prior day.
Global Variables are available to other Indicators or EAs with out having to recalculate the data. (See GlobalVariableGet() function info)
All variables start with Symbol() and then an identifier. i.e. ERUUSDp = today's pivot point.Use the attached GlobalVars indicators to show the values and names. (GlobalVars indi is for demo purposes do not leave on your chart).
Symbol()+<below>:
p,r1,r2,r3,s1,s2,s3 = traditional daily pivot levels
pmr1,pmr2,pmr3,pms1,pms2,pms3 = traditional daily pivot mid levels
fr1,fr2,fr3,fs1,fs2,fs3 = Fibo daily pivot levels
fmr1,fmr2,fmr3,fms1,fms2,fms3 = Fibo daily pivot mid levels
uss,lss,mss = upper,lower and mid Sweet Spot
yh,yl,yo = yesterdays high, yesterday low, yesterday open
st,sy,sp = start today, start yesterday ,start prior day (datetime vars)
Also, I tested this on demo accounts only. So I need feedback on whether the timezone adjustment works from different areas of the world. And, please tell me if anything else doesn't work.
----------------------------------------------------------------------------------------------
V1.0 Aug 15, 2009
I think this is close to being bug free. Please let me know if something does not seem right.
Added ability to change colors and line styles on just about every line.
Added ability to changes font sizes.
Added the ability to enable/disable more lines.
Added 3 more daily candles for a total of 4 candles including real-time painting of today's candle.
Fixed bug(s) with how weekends and start/end of market are handled.
Fixed bug with start of days sometimes being off by one bar.
Plus minor changes in display.
----------------------------------------------------------------------------------------------
V1.1 Aug18, 2009
A situation occurs when the market opens for the new week and is only a few hours before what would be the start of a normal trade day. According to the indicator, it would call those few prior hours a day.
It was using those few hours to calculate the pivots for today. This should be fixed. Now it should just add those few hours to the start of the day and calculate the pivots with the bonus hours included.
Fixed the daily bar not drawing correctly on weekend borders.
----------------------------------------------------------------------------------------------
V1.2 - V1.3 Aug 29,2009
Changed the GlobalVars names a bit for brokers that use odd names for 5 digit pricing.
Changed the way after market hours are detected. I hope this will solve any issues with different time zones. It is all based off of GMT now and should be universal.
----------------------------------------------------------------------------------------------
V1.31 Aug 30, 2009
Made a typo in the market hours range causing market hours to off by 1 hour.
----------------------------------------------------------------------------------------------
V1.4 Sep 4, 2009
H4 candle charts were causing trouble with the calculations. When a candle would straddle the CalcFromWhatHour time the indicator could not get the correct price to calc from. Now all time references and price values are derived from M1 charts and transposed to the viewed chart. This keeps values consistent from TF to TF.
Divide by zero error came up with decimal places of 2. Fixed.
Note: There is a known bug that will show up when DST changes in NZ and US. It should only cause trouble for the last hour on Friday or the first hour on Sunday. I wanted to get the new version out while I research the time changes.
Another know bug is that the indicator seems to lock up when there is insufficient data for the chart. I'm not sure if it is me or MT4 but the work-around is to go to History Center (F2) and do a download of the pair. Do it twice so it recalculates the time frames. I'm also looking into a fix for this.
----------------------------------------------------------------------------------------------
V1.5 Sep, 8 2009
This version is much less resource intensive. After making the indicator use M1 bars situations could arise where not enough bars were loaded and the indicator would lock up the platform. I expect that is all fixed now and multiple copies of the indicator should not slow the platform as bad.
I added two more inputs to manually define the end and start of the market week.
I created a PDF documentation for the indicator as well as a PDF on how to load bars when they are insufficient.
----------------------------------------------------------------------------------------------
April 25, 2011
A couple years ago my laptop with the source code was stolen and I thought that was the only copy I had. It turns out I did make a backup and just recently found it. It is now attached for you to do as you please with it. I no longer trade FOREX and release all rights to the code. I also have not programed in a very long time and can not remember what/how I did. The code is pretty well documented and it should not be too difficult for some one to figure out.
Best of luck. And thanks for the encouraging comments.
Tony