###Auto Pivot - /+-+ /| AutoPivotIndicator.mq4 ver 4.02 by...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
//+------------------------------------------------------------------+ //| AutoPivotIndicator.mq4 ver 4.02 by Habeeb | //| | //| This version solves the Sunday Bar problem. | //| Ver4 calculated daily pivots incorrectly when Use_Sunday_Data | //| was set to "False". Fixed in this version. | //+------------------------------------------------------------------+ / #property indicator_chart_window # extern bool Use_Sunday_Data = True; extern bool Daily = True; extern bool Daily_SR_Levels = True; extern bool Weekly = True; extern bool Weekly_SR_Levels = False; extern bool Monthly = True; extern bool Monthly_SR_Levels = False; double YesterdayHigh; double YesterdayLow; double YesterdayClose; double Day_Price[][6]; double Pivot,S1,S2,S3,R1,R2,R3; double WeekHigh; double WeekLow; double WeekClose; double Weekly_Price[][6]; double WeekPivot,WS1,WS2,WS3,WR1,WR2,WR3; double MonthHigh; double MonthLow; double MonthClose; double Month_Price[][6]; double MonthPivot,MS1,MS2,MS3,MR1,MR2,MR3; int init() { return(0); } //-------------------------------------------------------- int deinit() { ObjectDelete("PivotLine"); O ObjectDelete("R1_Line"); ObjectDelete("R2_Line"); ObjectDelete("R3_Line"); O ObjectDelete("S1_Line"); ObjectDelete("S2_Line"); ObjectDelete("S3_Line"); O //-------------------------------- / ObjectDelete("PivotLabel"); O
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ObjectDelete("R1_Label"); ObjectDelete("R2_Label"); ObjectDelete("R3_Label"); O ObjectDelete("S1_Label"); ObjectDelete("S2_Label"); ObjectDelete("S3_Label"); O //-------------------------------------------------------- / ObjectDelete("WeekPivotLine"); O ObjectDelete("WR1_Line"); ObjectDelete("WR2_Line"); ObjectDelete("WR3_Line"); O ObjectDelete("WS1_Line"); ObjectDelete("WS2_Line"); ObjectDelete("WS3_Line"); O //-------------------------------- / ObjectDelete("WeekPivotLabel"); O ObjectDelete("WR1_Label"); ObjectDelete("WR2_Label"); ObjectDelete("WR3_Label"); O ObjectDelete("WS1_Label"); ObjectDelete("WS2_Label"); ObjectDelete("WS3_Label"); O //-------------------------------------------------------- / ObjectDelete("MonthPivotLine"); O ObjectDelete("MR1_Line"); ObjectDelete("MR2_Line"); ObjectDelete("MR3_Line"); O ObjectDelete("MS1_Line"); ObjectDelete("MS2_Line"); ObjectDelete("MS3_Line"); O //-------------------------------- / ObjectDelete("MonthPivotLabel"); O ObjectDelete("MR1_Label"); ObjectDelete("MR2_Label"); ObjectDelete("MR3_Label"); O ObjectDelete("MS1_Label"); ObjectDelete("MS2_Label"); ObjectDelete("MS3_Label"); O return(0); } //---------------------------------------------------------
Background image of page 2
/ int start() { ArrayCopyRates(Day_Price,(Symbol()), 1440); A YesterdayHigh = Day_Price[1][3]; YesterdayLow = Day_Price[1][2]; YesterdayClose = Day_Price[1][4]; Pivot = ((YesterdayHigh + YesterdayLow + YesterdayClose)/3); R1 = (2*Pivot)-YesterdayLow; S1 = (2*Pivot)-YesterdayHigh; R2 = Pivot+(R1-S1); S2 = Pivot-(R1-S1); R3 = (YesterdayHigh + (2*(Pivot-YesterdayLow))); S3 = (YesterdayLow - (2*(YesterdayHigh-Pivot))); if (Use_Sunday_Data == false)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/02/2010 for the course ACCOUNTING 10835 taught by Professor 123 during the Spring '10 term at Abu Dhabi University.

Page1 / 10

###Auto Pivot - /+-+ /| AutoPivotIndicator.mq4 ver 4.02 by...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online