Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thanks much, Mike
/*[[ Name := 1a Pivot Author := Copyright © 2004, Interbank FX, LLC Link := www.itnerbankfx.com Separate Window := No First Color := Blue First Draw Type := Line First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ // ############################## // # Originally posted by umanm # // # Modified by bc_4x_1 # // ############################## input: formula(0); input: show_comment(1); input: how_long(720); input: drw(1); defines: linethickness(1); var: cnt(0); var: begin_bar(0); var: prev_day(0), cur_day(0); var: day_high(0); var: day_low(0); var: yesterday_high(0); var: yesterday_low(0); var: yesterday_close(0); var: today_open(0); var: textvar(""); var: P(0),S(0),R(0),S0.5(0),R0.5(0),S1(0),R1(0),S1.5(0),R1.5(0),S2(0),R2(0),S2.5(0),R2.5(0),S3(0),R3(0) ; var: timeShift(0); if ServerAddress != "66.114.105.84" and ServerAddress != "66.114.106.68" and ServerAddress != "66.114.105.85" and ServerAddress != "66.114.105.87" and ServerAddress != "66.114.105.84" and ServerAddress != "66.219.199.106" then ( Exit; }; for cnt = bars downto 0 { SetIndexValue(cnt, 0); SetIndexValue2(cnt, 0); }; if Period > 60 then exit; timeShift = 0; if formula < 0 or formula > 3 then exit; if how_long = -1 then { begin_bar = bars; } else { begin_bar = how_long; }; for cnt = begin_bar downto 1 { cur_day = TimeDay(time[cnt]); if prev_day != cur_day then { yesterday_close = CLOSE[cnt+1]; today_open = OPEN[cnt]; yesterday_high = day_high; yesterday_low = day_low; P = (yesterday_high + yesterday_low + yesterday_close + today_open) / 4; if formula = 1 then { R = P + P - yesterday_low; S = P + P - yesterday_high; } else if formula = 2 then { R = P + yesterday_high - yesterday_low; S = P - yesterday_high + yesterday_low; } else if formula = 3 then { R = P + P - yesterday_low - yesterday_low + yesterday_high; S = P + P - yesterday_high - yesterday_high + yesterday_low; }; day_high = HIGH[cnt]; day_low = LOW[cnt]; prev_day = cur_day; }; day_high = max(day_high, HIGH[cnt]); day_low = min(day_low, LOW[cnt]); if formula = 0 then { //if drw = 1 then SetIndexValue(cnt, P); if drw = 1 then SetIndexValue(cnt, 0); } else { if drw = 1 then { SetIndexValue(cnt, R); SetIndexValue2(cnt, S); }; }; textVar = TimeHour(time[0])+":"+TimeMinute(time[0])+" "+(60-Minute)+"R"; SetObjectText("Time",textVar,"Arial",9,White); MoveObject("Time",OBJ_TEXT,time[25],P,time[25],P,White); }; if show_comment = 1 then { P = (yesterday_high + yesterday_low + yesterday_close)/3; // + today_open) / 4; R0.5=(P+R1)/2; S0.5=(P+S1)/2; R1 = (2*P)-yesterday_low; S1 = (2*P)-yesterday_high; R1.5=(R1+R2)/2; S1.5=(S1+S2)/2; R2 = P+(yesterday_high - yesterday_low); S2 = P-(yesterday_high - yesterday_low); R2.5=(R2+R3)/2; S2.5=(S2+S3)/2; R3 = (2*P)+(yesterday_high-(2*yesterday_low)); S3 = (2*P)-((2* yesterday_high)-yesterday_low); Comment("High= ",yesterday_high,"\nLow= ",yesterday_low,"\nClose= ",yesterday_close,"\n R3.0= ",R3,"\n R2.5= ",R2.5,"\n R2.0= ",R2,"\n R1.5= ",R1.5,"\n R1.0= ",R1,"\n R0.5= ",R0.5,"\nPivot= ",P,"\n S0.5= ",S0.5,"\n S1.0= ",S1,"\n S1.5= ",S1.5,"\n S2.0= ",S2,"\n S2.5= ",S2.5,"\n S3.0= ",S3); MoveObject("R0.5_line",OBJ_HLINE,time[cnt],R0.5,time[cnt],R0.5,GreenYellow,linethickness,STYLE_DOT); MoveObject("R1_line",OBJ_HLINE,time[cnt],R1,time[cnt],R1,YellowGreen,linethickness,STYLE_DOT); MoveObject("R1.5_line",OBJ_HLINE,time[cnt],R1.5,time[cnt],R1.5,GreenYellow,linethickness,STYLE_DOT); MoveObject("R2_line",OBJ_HLINE,time[cnt],R2,time[cnt],R2,YellowGreen,linethickness,STYLE_DOT); MoveObject("R2.5_line",OBJ_HLINE,time[cnt],R2.5,time[cnt],R2.5,GreenYellow,linethickness,STYLE_DOT); MoveObject("R3_line",OBJ_HLINE,time[cnt],R3,time[cnt],R3,YellowGreen,linethickness,STYLE_DOT); MoveObject("P_line",OBJ_HLINE,time[cnt],P,time[cnt],P,Yellow,linethickness,STYLE_DASH); MoveObject("S0.5_line",OBJ_HLINE,time[cnt],S0.5,time[cnt],S0.5,Salmon,linethickness,STYLE_DOT); MoveObject("S1_line",OBJ_HLINE,time[cnt],S1,time[cnt],S1,Red,linethickness,STYLE_DOT); MoveObject("S1.5_line",OBJ_HLINE,time[cnt],S1.5,time[cnt],S1.5,salmon,linethickness,STYLE_DOT); MoveObject("S2_line",OBJ_HLINE,time[cnt],S2,time[cnt],S2,Red,linethickness,STYLE_DOT); MoveObject("S2.5_line",OBJ_HLINE,time[cnt],S2.5,time[cnt],S2.5,Salmon,linethickness,STYLE_DOT); MoveObject("S3_line",OBJ_HLINE,time[cnt],S3,time[cnt],S3,Red,linethickness,STYLE_DOT); SetObjectText("R0.5_txt","R0.5 "+R0.5,"Arial",8,White); MoveObject("R0.5_txt",OBJ_TEXT,time[25],R0.5,time[25],R0.5,White); SetObjectText("R1_txt","R1.0 "+R1,"Arial",8,White); MoveObject("R1_txt",OBJ_TEXT,time[25],R1,time[25],R1,White); SetObjectText("R1.5_txt","R1.5 "+R1.5,"Arial",8,White); MoveObject("R1.5_txt",OBJ_TEXT,time[25],R1.5,time[25],R1.5,White); SetObjectText("R2_txt","R2.0 "+R2,"Arial",8,White); MoveObject("R2_txt",OBJ_TEXT,time[25],R2,time[25],R2,White); SetObjectText("R2.5_txt","R2.5 "+R2.5,"Arial",8,White); MoveObject("R2.5_txt",OBJ_TEXT,time[25],R2.5,time[25],R2.5,White); SetObjectText("R3_txt","R3.0 "+R3,"Arial",8,White); MoveObject("R3_txt",OBJ_TEXT,time[25],R3,time[25],R3,White); SetObjectText("S0.5_txt","S0.5 "+S0.5,"Arial",8,White); MoveObject("S0.5_txt",OBJ_TEXT,time[25],S0.5,time[25],S0.5,White); SetObjectText("S1_txt","S1.0 "+S1,"Arial",8,White); MoveObject("S1_txt",OBJ_TEXT,time[25],S1,time[25],S1,White); SetObjectText("S1.5_txt","S1.5 "+S1.5,"Arial",8,White); MoveObject("S1.5_txt",OBJ_TEXT,time[25],S1.5,time[25],S1.5,White); SetObjectText("S2_txt","S2.0 "+S2,"Arial",8,White); MoveObject("S2_txt",OBJ_TEXT,time[25],S2,time[25],S2,White); SetObjectText("S2.5_txt","S2.5 "+S2.5,"Arial",8,White); MoveObject("S2.5_txt",OBJ_TEXT,time[25],S2.5,time[25],S2.5,White); SetObjectText("S3_txt","S3.0 "+S3,"Arial",8,White); MoveObject("S3_txt",OBJ_TEXT,time[25],S3,time[25],S3,White); };