Professional Documents
Culture Documents
Gain 30 stop 20
Gain 50 Stop 40
Gain 60 Stop 50
Gain 60, stop 50 filtro EMA 50 – melhor resultado
numa : integer;
alvoxx,stopxx : float;
compra,venda : boolean;
begin
//intraday
compra := (close > close[1]) and (lowest(low,2) < lowest(low,2)[1]) and (close > mediaexp(21,close)) and
(mediaexp(9,close) > mediaexp(21,close)) and (mediaexp(21,close) > mediaexp(50,close));
venda := (close < close[1]) and (highest(high,2) > highest(high,2)[1]) and (close < mediaexp(21,close)) and
(mediaexp(9,close) < mediaexp(21,close)) and (mediaexp(21,close) < mediaexp(50,close));
begin
numa := 0;
if (compra) then
BuyStop(high[0],high[0]);
if (venda) then
sellshortstop(low[0],low[0]);
end;
if (buyposition = 1) then
begin
numa := numa + 1;
if (numa = 1) then
begin
end;
//alvo
selltocoverstop(alvoxx,alvoxx);
//stop
selltocoverstop(stopxx,stopxx);
ClosePosition;
end;
if (sellposition = 1) then
begin
numa := numa + 1;
if (numa = 1) then
begin
stopxx := (high[1]);
end;
//alvo
buytocoverstop(alvoxx,alvoxx);
//stop
buytocoverstop(stopxx,stopxx);
ClosePosition;
end;
end;
begin
//Condições de compra
if (close > close[1]) and (lowest(low,2) < lowest(low,2)[1]) and (close > mediaexp(50,close)) and (mediaexp(9,close) >
mediaexp(21,close)) and (mediaexp(21,close) > mediaexp(200,close)) and (ifr(14) < 70) and (SlowStochastic(14) <
mediaexp(3,close)) then
BuyStop(high,high);
//Condições de venda
if (close < close[1]) e (highest(High,2) > highest(High,2)[1]) and (close < mediaexp(50,close)) and (mediaexp(9,close)
< mediaexp(21,close)) and (mediaexp(21,close) < mediaexp(200,close)) and (ifr(14) > 30) and (SlowStochastic(14) >
mediaexp(3,close)) then
SellShortStop(low,low);
end;
if (BuyPosition = 1) then
begin
end;
if (SellPosition = 1) then
begin
BuyToCoverStop(SellPrice - 400,SellPrice - 400);
end;
// INTERVALO DE ENCERRAMENTO
ClosePosition;
begin
plot(mediaexp(50,close));
end;
end;