Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

kamus

Marney Volume Indicator

Recommended Posts

Hi,

 

Can someone convert below Multichart language to Metatrader MQL4 or MQL5

 

It is indicator from marney that given in fx magazine for july-september 2010.

 

thank you in advance.

 

Marney Volume Indicator

 

input: avgLen(10), mins.

in.session(1440), autobars(True),

upcolor(cyan), dncolor(red);

var: start(0), end1(0), end2(0),

x(0), p(-1), count(0), avg(0),

barsinday(0), DayNumber(0);

array: xv[199,1440](0);

if bartype < 2 then begin

start= (Sessionstarttime(1,1));

end1= (sessionendtime(1,1));

end2= (sessionendtime(1,2));

value1 = timetominutes(start);

value2 = timetominutes(end2);

if start > end2 then

value3 = 1440+(value2-value1);

if start < end2 then

value3 = -(value1-

value2);

if autobars = false then value3 =

mins.in.session;

barsinday = ceiling(value3/

barinterval);

if d<>d[1] then begin

if count=barsInDay then begin

p=iff(p<avgLen-1,p+1,0);

for x=1 to barsInDay

begin

xv[p,x]=ticks[barsInDay+1-x];

end;

end;

count=1;

end else count=count+1;

if xv[avgLen-1,count]>0 then

begin

avg=0;

for x=0 to avgLen-1 begin

avg=avg+xv[x,count];

end;

avg=avg/avgLen;

plot2(ticks,”ticks”,default

,1);

plot1(avg,”avg”,yellow,defau

lt,1);

end;

if close > open then setplotcolor

(2,upcolor);

if close < open then setplotcolor

(2,dncolor);

end;

if bartype > 1 then begin

avg =

averagefc(v,avglen);

plot2(v,”ticks”,default

,1);

plot1(avg,”avg”,yellow,

default,1);

if close > open then setplotcolor

(2,upcolor);

if close < open then setplotcolor

(2,dncolor);

end;

 

MARNEY RANGE INDICATOR

 

input: avgLen(10), mins.

in.session(1440), autobars(True),

upcolor(cyan), dncolor(red);

var: start(0), end1(0), end2(0),

x(0), p(-1), count(0), avg(0),

barsinday(0);

array: xr[50,1440](0);

if bartype < 2 then begin

start= (Sessionstarttime(1,1));

end1= (sessionendtime(1,1));

end2= (sessionendtime(1,2));

value1 = timetominutes(start);

value2 = timetominutes(end2);

if start > end2 then

value3 = 1440+(value2-value1);

if start < end2 then

value3 = -(value1-

value2);

if autobars = false then value3 =

mins.in.session;

barsinday = ceiling(value3/

barinterval);

if d<>d[1] then begin

if count=barsInDay then begin

p=iff(p<avgLen-1,p+1,0);

for x=1 to barsInDay begin

xr[p,x]=truerange[bar

sInDay+1-x];

end;

end;

count=1;

end else count=count+1;

if xr[avgLen-1,count]>0 then begin

avg=0;

for x=0 to avgLen-1 begin

avg=avg+xr[x,count];

end;

avg=avg/avgLen;

plot2(truerange,”range”,defau

lt,1);

plot1(avg,”avg”,yellow,

default,1);

end;

if close > open then setplotcolor

(2,upcolor);

if close < open then setplotcolor

(2,dncolor);

end;

if bartype > 1 then begin

avg = averagefc(trueran

ge,avglen);

plot2(truerange,”range”

,default,1);

plot1(avg,”avg”,yellow,

default,1);

if close > open then setplotcolor

(2,upcolor);

if close < open then setplotcolor

(2,dncolor);

end;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.