var
pGrandePlayers,mm : float;
begin
mm := media(20,close);
if (volume > highest(volume,20)[1]) and (volume > media(20,volume)) then
begin
pGrandePlayers := (high + low) / 2;
end;
if (close > media(20,close)) then
PaintBar(clverde)
else if (close < media(20,close)) then
PaintBar(clmarrom);
if (close < media(20,close)) and (close > pGrandePlayers) and (media(20,close) < media(20,close)[1]) then
PaintBar(RGB(200,100,50))
else if (close > media(20,close)) and (close < pGrandePlayers) and (media(20,close) > media(20,close)[1]) then
PaintBar(cllime);
plot(pGrandePlayers);
plot2(media(20,close));
end;
CÓDIGO DA REGRA DE COLORAÇÃO
MH COLOR
VAR
mh,m,m2 : float;
compra,venda,alta,baixa : boolean;
BEGIN
mh := MACD(20,10,12)|1|;
m := mediaexp(20,close);
m2 := mediaexp(50,close);
compra := (mh > mh[1]) and (mh[1] > mh[2]) and (close > m) and (mh > 0) and (m > m2);
venda := (mh < mh[1]) and (mh[1] < mh[2]) and (close < m) and (mh < 0) and (m < m2);
alta := (close > m) and (mh > 0) and (m > m2);
baixa := (close < m) and (mh < 0) and (m < m2);
paintbar(clwhite);
if (alta) then
PaintBar(rgb(0,200,145));
if (baixa) then
PaintBar(RGB(200,0,145));
if (compra) then
PaintBar(cllime);
if (venda) then
PaintBar(clred);
end;
CÓDIGO DA REGRA DE COLORAÇÃO
AROON COLOR
var
a, b, aron: float;
compra,venda : boolean;
x:integer;
begin
aron:=AroonLin(5);
//obtendo os indicadores
a:=media(20,close);
b:=media(9,close);
//condições de compra e venda
compra := (aron>60) and (close>a) and (close>b);
venda := (aron<40) and (close<a) and (close<b);
//coloração de compra
if (x=1) and (close>b)then PaintBar(cllime);
if (x=2) and (close<b)then PaintBar(clfuchsia);
if (compra) then
begin
x:=1;
PaintBar(clverde);
end;
//coloração de venda
if (venda) then
begin
x:=2;
PaintBar(clmarrom);
end;
plot(a);
end;
var
sup,inf,mid : float;
compra,venda,primeiro : boolean;
begin
primeiro := (time[1] > 1400) and (time < 1400);
sup := KeltnerCh(1.20,20,1)|0|;
inf := KeltnerCh(1.20,20,1)|1|;
mid := (sup + inf) / 2;
compra := (close > sup) and (close[1] < open[1]) and (close[0] > close[1]) and (close > open) and not (primeiro);
venda := (close < inf) and (close[1] > open[1]) and (close[0] < close[1]) and (close < open) and not (primeiro);
if (close > mid) then
paintBar(clverde);
if (close < mid) then
paintBar(clpurple);
if (compra) then
begin
plottext("*",clwhite,0,8);
PaintBar(cllime);
end;
if (venda) then
begin
plottext("*",clwhite,-1,8);
PaintBar(clred);
end;
plot(sup);
plot3(mid);
plot2(inf);
end;
begin
if (media(9,close)>media(10,close)) and (close>open) then PaintBar(claqua);
if (media(9,close)>media(10,close)) and (close<open) then PaintBar(clblue);
if (media(9,close)<media(10,close)) and (close>open) then PaintBar(clfuchsia);
if (media(9,close)<media(10,close)) and (close<open) then PaintBar(clpurple);
end;
var
mm9,mm20,dist,mh : float;
begin
mm9 := mediaexp(9,close);
mm20 := mediaexp(20,close);
dist := abs(mm20 - mm9);
mh := macd(20,10,9)|1|;
if (close > open + 70) and (close[1] < mm9[1]) and (close[0] > mm9[0]) and (mm9 < mm20) and (dist < 100) and (mh > 0) then
begin
plottext("POSSÍVEL REVERSÃO",CLWHITE,0,5);
PaintBar(cllime);
end;
if (close < open - 70) and (close[1] > mm9[1]) and (close[0] < mm9[0]) and (mm9 > mm20) and (dist < 100) and (mh < 0) then
begin
plottext("POSSÍVEL REVERSÃO",CLWHITE,-1,5);
PaintBar(clRED);
end;
end;