
Envoyé par
mzz9
السلام عليكم
ارجوكم يا اخواني من لديه مؤشر bam_atz_timecorridor فهو مؤشر لبلخياط
ان يمدني به وجزكم الله الف خير
ومن استطاع من الاخوة ان يحوله الى mq4 ها هو الكود :
{title: _ggtimechannels ()
*******************************************
date programmer ref description
07-29-2007 a bruno time channels to determine ranges by time
04-21-2009 a bruno converted to atz format or 48 zones
10-22-2009 a bruno compare 4 datas by time zone 1,2,3,4,5,6,8,10,12,15,20,30,60
built for exchange time only
last update: 10-22-2009 10:39
*******************************************}
{the ideal indicateur would have a input variable
allowing one to define the start time corridor and its end time
for example between 9h30 to 10h30
and i can change manually to check all the time corridors ,
another input could be the atr, volume, hpi }
{ this indicator averages the collection data over an extended period
change this input
input: Useformula_12345 (?);
2. {range}
3. {longest ray from open or close[1]}
1. {atr}
4. {tick or volume total}
5. {tick or volume difference}
}
input: Useformula_12345 (2);
input: Number_of_datas (1);
input: Plot_size (1);
input: __ (.);
input: Formula_1_atr (.);
input: Formula_2_range (.);
input: Formula_3_ray (.);
input: Formula_4_ticktotal (.);
input: Formula_5_tickdifference(.);
{input: Eurusd_green (1);
input: Gbpjpy_darkgreen (1);
input: Eurgbp_darkred (1);
input: Usdjpy_red (1);}
var: Im(text);im = ("atz_timec," +numtostr(d,0)+ ", "+numtostr(t,0)+","+getsymbolname+":"+numtostr (bar interval,0)+", ");
var: Im2(text);im2 = ("atz_timec," +numtostr(d,0)+ ", "+numtostr(t,0)+", ");
var: Atz(0);
var: F#(0);
array: Intrabarpersist rng [4,2401,10] (0); {collection of raw values}
array: Intrabarpersist sym [4,89,10] (0); {all symbol data}
var: Index (0); {circular array marker}
var: Tindex (0); {time index marker}
var: Dat# (0); {data stream number}
var: Symbolmax (0); {set high for max number of symbols}
var: Symfldmax (10); {max field in circular array}
var: Lbmax (89); {lookback max field in circular array}
{input to var pass}
f# = useformula_12345;
symbolmax = number_of_datas;
array: Ptx[4](0);
var: Pt(0), bpv(0), _fx(0), ps(0), bp(0);
if currentbar = 1 then begin
ps = pricescale;
bp = bigpointvalue;
pt = minmove/pricescale;{determine smallest price increment i.e 1/10 or .25 }
bpv = minmove/pricescale * bigpointvalue;
for dat# = 1 to symbolmax begin
ptx[dat#] = (minmove/pricescale)data(dat#);
end;
end;{currentbar = 1}
var: Color (0);
var: Arraytmax (0);
if currentbar = 1 then begin
array: Timec[2400,2] (0);
var: Fldtmax(0),barint(0);
barint = barinterval;
{build array with select synthetic minutes}
arraytmax = _ggtimearray_fn(timec,barint,0,2401); {populate time array }
fldtmax = ((60 /barint) * 24);
end; {of currentbar = 1}
array: Zone[2401,5](0);
var: Intrabarpersist atr (0);
var: Intrabarpersist atr1 (0);
var: Intrabarpersist atr2 (0);
var: Intrabarpersist atr3 (0);
var: Intrabarpersist atr4 (0);
var: Intrabarpersist atr5 (0);
var: C_news (0);
var: Z (0);
var: Switch_on (true);
var: Atzz (0);
var: Atzz2 (0);
c_news = 0;
{atr calculation~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }
array: P[3,10] (0);
var: X(0);
{convert to us dollars}
if barstatus(1) = 2 or barstatus(1) = 1 then begin
for dat# = 1 to symbolmax begin
if dat# = 1 then begin {for circular arrays}
index = index + 1;
if index > lbmax then index = 1;
end;
if barstatus(dat#) = 2 then begin
sym[dat#,index,1] = profitcf data(dat#)* 100000; {fx profitcf all data's each bar}
end else begin
break;
end;
end;
end;
{get all data from symbols}
if barstatus(1) = 2 or barstatus(1)= 2 then begin
{sync time}
for z = 1 to fldtmax begin
if z= 1 and t = timec[tindex+1 ,1] then begin
tindex = tindex+1; break;
end;
if t = timec[z,1] then begin
tindex = z; break;
end;
end;
for dat# = 1 to symbolmax begin
sym[dat#,index,2] =(d) data(dat#);
sym[dat#,index,3] =(t) data(dat#);
sym[dat#,index,4] =(o) data(dat#);
sym[dat#,index,5] =(h) data(dat#);
sym[dat#,index,6] =(l) data(dat#);
sym[dat#,index,7] =(c) data(dat#);
sym[dat#,index,8] =(upticks) data(dat#);
sym[dat#,index,9] =(downticks) data(dat#);
{atr1 = maxlist (h-l, h-c[1], c[1]-l) *fib_factor; {atr}
atr2 = absvalue(c-o) *fib_factor; {range}
atr3 = maxlist (absvalue(o-l),h-o, h-c[1], c[1]-l) *fib_factor; {longest ray from open or close[1]}
atr4 = (upticks+ downticks); {tick or volume total}
atr5 = absvalue(upticks-downticks); {tick or volume difference}}
{standard}
atr1 = maxlist(sym[dat#,index,5]-sym[dat#,index,6],sym[dat#,index,5]-sym[dat#,index,6][1], sym[dat#,index,6][1]-sym[dat#,index,6]);
atr2 = absvalue(sym[dat#,index,7]-sym[dat#,index,4]);
atr3 = maxlist(absvalue(sym[dat#,index,7]-sym[dat#,index,6]),sym[dat#,index,5]-sym[dat#,index,7], sym[dat#,index,5]-sym[dat#,index,6][1], sym[dat#,index,6][1]-sym[dat#,index,6]);
atr4 = (sym[dat#,index,8] + sym[dat#,index,9]);
atr5 = absvalue(sym[dat#,index,8] - sym[dat#,index,9]);
rng[dat#,tindex,1] = rng[dat#,tindex,1] + atr1; {atr}
rng[dat#,tindex,2] = rng[dat#,tindex,2] + atr2; {range}
rng[dat#,tindex,3] = rng[dat#,tindex,3] + atr3; {longest ray from open or close[1]}
rng[dat#,tindex,4] = rng[dat#,tindex,4] + atr4; {tick or volume total}
rng[dat#,tindex,5] = rng[dat#,tindex,5] + atr5; {tick or volume difference}
rng[dat#,tindex,6] = rng[dat#,tindex,6] + 1; {counter for division}
end;{dat#}
for dat# = 1 to symbolmax begin
if f# = 1 then begin
if dat# = 1 then plot30( (rng[1,tindex,f#]/rng[1,tindex,6])/ptx[1] ,"data1",green, 0,plot_size);
if dat# = 2 then plot31( (rng[2,tindex,f#]/rng[2,tindex,6])/ptx[2] ,"data2",darkgreen,0,plot_size);
if dat# = 3 then plot32( (rng[3,tindex,f#]/rng[3,tindex,6])/ptx[3] ,"data3",red, 0,plot_size);
if dat# = 4 then plot33( (rng[4,tindex,f#]/rng[4,tindex,6])/ptx[4] ,"data4",darkred, 0,plot_size);
end;
if f# = 2 then begin
if dat# = 1 then plot30( (rng[1,tindex,f#]/rng[1,tindex,6])/ptx[1] ,"data1",green, 0,plot_size);
if dat# = 2 then plot31( (rng[2,tindex,f#]/rng[2,tindex,6])/ptx[2] ,"data2",darkgreen,0,plot_size);
if dat# = 3 then plot32( (rng[3,tindex,f#]/rng[3,tindex,6])/ptx[3] ,"data3",red, 0,plot_size);
if dat# = 4 then plot33( (rng[4,tindex,f#]/rng[4,tindex,6])/ptx[4] ,"data4",darkred, 0,plot_size);
end;
if f# = 3 then begin
if dat# = 1 then plot30( (rng[1,tindex,f#]/rng[1,tindex,6])/ptx[1] ,"data1",green, 0,plot_size);
if dat# = 2 then plot31( (rng[2,tindex,f#]/rng[2,tindex,6])/ptx[2] ,"data2",darkgreen,0,plot_size);
if dat# = 3 then plot32( (rng[3,tindex,f#]/rng[3,tindex,6])/ptx[3] ,"data3",red, 0,plot_size);
if dat# = 4 then plot33( (rng[4,tindex,f#]/rng[4,tindex,6])/ptx[4] ,"data4",darkred, 0,plot_size);
end;
if f# = 4 then begin
if dat# = 1 then plot30( (rng[1,tindex,f#]/rng[1,tindex,6]) ,"data1",green, 0,plot_size);
if dat# = 2 then plot31( (rng[2,tindex,f#]/rng[2,tindex,6]) ,"data2",darkgreen,0,plot_size);
if dat# = 3 then plot32( (rng[3,tindex,f#]/rng[3,tindex,6]) ,"data3",red, 0,plot_size);
if dat# = 4 then plot33( (rng[4,tindex,f#]/rng[4,tindex,6]) ,"data4",darkred, 0,plot_size);
end;
if f# = 5 then begin
if dat# = 1 then plot30( (rng[1,tindex,f#]/rng[1,tindex,6]) ,"data1",green, 0,plot_size);
if dat# = 2 then plot31( (rng[2,tindex,f#]/rng[2,tindex,6]) ,"data2",darkgreen,0,plot_size);
if dat# = 3 then plot32( (rng[3,tindex,f#]/rng[3,tindex,6]) ,"data3",red, 0,plot_size);
if dat# = 4 then plot33( (rng[4,tindex,f#]/rng[4,tindex,6]) ,"data4",darkred, 0,plot_size);
end;
end;
end;{barstatus}
plot99(0,"0",darkbrown,0,0);