Pivot Points as dots

 
Has anybody converted the following to MT4 format?

/*[[
Name := Pivot Daily
Author := Copyright © 2004, MetaQuotes Software Corp.
Link := Groups.yahoo.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 #
// # Further Modified by aghent #
// ##############################


input: formula(0);
input: show_comment(1);
input: how_long(720);
input: drw(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),Q(0),S(0),R(0),M2(0),M3(0),S1(0),R1(0),M1(0),M4(0),S2(0),R2(0),M0(0),M5(0),S3(0),R3(0),L3(0),L4(0),H3(0),H4(0),nQ(0);
var: timeShift(0);

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;

Q = (yesterday_high - yesterday_low);
P = (yesterday_high + yesterday_low + yesterday_close) / 3;
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);
};
};

if Q > 5 then
{
nQ = Q;
}
else
{
nQ = Q*10000;
};
};

if show_comment = 1 then
{
H4 = (Q*0.55)+yesterday_close;
H3 = (Q*0.27)+yesterday_close;
R3 = (2*P)+(yesterday_high-(2*yesterday_low));
M5 = (R2+R3)/2;
R2 = P-S1+R1;
M4 = (R1+R2)/2;
R1 = (2*P)-yesterday_low;
M3 = (P+R1)/2;
P = (yesterday_high + yesterday_low + yesterday_close)/3;
M2 = (P+S1)/2;
S1 = (2*P)-yesterday_high;
M1 = (S1+S2)/2;
S2 = P-R1+S1;
M0 = (S2+S3)/2;
S3 = (2*P)-((2* yesterday_high)-yesterday_low);
L3 = yesterday_close-(Q*0.27);
L4 = yesterday_close-(Q*0.55);


Comment("High= ",yesterday_high,"\nLow= ",yesterday_low,"\nClose= ",yesterday_close,"\nPrevious Days Range= ",nQ,"\nAverage Daily Range= ");

MoveObject("H4_Line",OBJ_HLINE,time[cnt],H4,time[cnt],H4,Black,1,STYLE_DOT);
MoveObject("H3_Line",OBJ_HLINE,time[cnt],H3,time[cnt],H3,Black,1,STYLE_DOT);
MoveObject("R3_line",OBJ_HLINE,time[cnt],R3,time[cnt],R3,BlackGreen,1,STYLE_DOT);
MoveObject("M5_line",OBJ_HLINE,time[cnt],M5,time[cnt],M5,SkyBlue,1,STYLE_DOT);
MoveObject("R2_line",OBJ_HLINE,time[cnt],R2,time[cnt],R2,BlackGreen,1,STYLE_DOT);
MoveObject("M4_line",OBJ_HLINE,time[cnt],M4,time[cnt],M4,SkyBlue,1,STYLE_DOT);
MoveObject("R1_line",OBJ_HLINE,time[cnt],R1,time[cnt],R1,BlackGreen,1,STYLE_DOT);
MoveObject("M3_line",OBJ_HLINE,time[cnt],M3,time[cnt],M3,SkyBlue,1,STYLE_DOT);
MoveObject("P_line",OBJ_HLINE,time[cnt],P,time[cnt],P,Magenta,1,STYLE_DASH);
MoveObject("M2_line",OBJ_HLINE,time[cnt],M2,time[cnt],M2,SkyBlue,1,STYLE_DOT);
MoveObject("S1_line",OBJ_HLINE,time[cnt],S1,time[cnt],S1,Red,1,STYLE_DOT);
MoveObject("M1_line",OBJ_HLINE,time[cnt],M1,time[cnt],M1,SkyBlue,1,STYLE_DOT);
MoveObject("S2_line",OBJ_HLINE,time[cnt],S2,time[cnt],S2,Red,1,STYLE_DOT);
MoveObject("M0_line",OBJ_HLINE,time[cnt],M0,time[cnt],M0,SkyBlue,1,STYLE_DOT);
MoveObject("S3_line",OBJ_HLINE,time[cnt],S3,time[cnt],S3,Red,1,STYLE_DOT);
MoveObject("L3_Line",OBJ_HLINE,time[cnt],L3,time[cnt],L3,Black,1,STYLE_DOT);
MoveObject("L4_Line",OBJ_HLINE,time[cnt],L4,time[cnt],L4,Black,1,STYLE_DOT);

SetObjectText("H4_txt"," H4 ","Arial",9,White);
MoveObject("H4_txt",OBJ_TEXT,time[0],H4,time[0],H4,White);
SetObjectText("H3_txt"," H3 ","Arial",9,White);
MoveObject("H3_txt",OBJ_TEXT,time[0],H3,time[0],H3,White);
SetObjectText("R3_txt"," R3 ","Arial",9,White);
MoveObject("R3_txt",OBJ_TEXT,time[0],R3,time[0],R3,White);
SetObjectText("M5_txt"," M5 ","Arial",9,White);
MoveObject("M5_txt",OBJ_TEXT,time[0],M5,time[0],M5,White);
SetObjectText("R2_txt"," R2 ","Arial",9,White);
MoveObject("R2_txt",OBJ_TEXT,time[0],R2,time[0],R2,White);
SetObjectText("M4_txt"," M4 ","Arial",9,White);
MoveObject("M4_txt",OBJ_TEXT,time[0],M4,time[0],M4,White);
SetObjectText("R1_txt"," R1 ","Arial",9,White);
MoveObject("R1_txt",OBJ_TEXT,time[0],R1,time[0],R1,White);
SetObjectText("M3_txt"," M3 ","Arial",9,White);
MoveObject("M3_txt",OBJ_TEXT,time[0],M3,time[0],M3,White);
SetObjectText("M2_txt"," M2 ","Arial",9,White);
MoveObject("M2_txt",OBJ_TEXT,time[0],M2,time[0],M2,White);
SetObjectText("S1_txt"," S1 ","Arial",9,White);
MoveObject("S1_txt",OBJ_TEXT,time[0],S1,time[0],S1,White);
SetObjectText("M1_txt"," M1 ","Arial",9,White);
MoveObject("M1_txt",OBJ_TEXT,time[0],M1,time[0],M1,White);
SetObjectText("S2_txt"," S2 ","Arial",9,White);
MoveObject("S2_txt",OBJ_TEXT,time[0],S2,time[0],S2,White);
SetObjectText("M0_txt"," M0 ","Arial",9,White);
MoveObject("M0_txt",OBJ_TEXT,time[0],M0,time[0],M0,White);
SetObjectText("S3_txt"," S3 ","Arial",9,White);
MoveObject("S3_txt",OBJ_TEXT,time[0],S3,time[0],S3,White);
SetObjectText("L3_txt"," L3 ","Arial",9,White);
MoveObject("L3_txt",OBJ_TEXT,time[0],L3,time[0],L3,White);
SetObjectText("L4_txt"," L4 ","Arial",9,White);
MoveObject("L4_txt",OBJ_TEXT,time[0],L4,time[0],L4,White);

};