You are on page 1of 12

Estátisticas Backtesting

Gain 40 pontos e stop 20 pontos

Gain 30 stop 20
Gain 50 Stop 40

Gain 60 Stop 50
Gain 60, stop 50 filtro EMA 50 – melhor resultado

Gain 450 Stop 350


Gain 500 Stop 500 3 MM Melhor de Todos

Milho IFR14 MM13 – Somente Compra


Gráfico de 4 Horas somente compra
var

numa : integer;

alvoxx,stopxx : float;

compra,venda : boolean;

begin

//definindo as condições de compra e venda

//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));

//fazendo o código da estratégia

if (buyposition = 0) and (sellposition = 0) then

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

alvoxx := ((high[1] - low[1]) * 2) + high[1];


stopxx := abs(low[1]);

end;

//alvo

selltocoverstop(alvoxx,alvoxx);

//stop

selltocoverstop(stopxx,stopxx);

if (close > alvoxx) or (close < stopxx) then

ClosePosition;

end;

if (sellposition = 1) then

begin

numa := numa + 1;

if (numa = 1) then

begin

alvoxx := abs(((high[1] - low[1]) * 2) - low[1]);

stopxx := (high[1]);

end;

//alvo

buytocoverstop(alvoxx,alvoxx);

//stop

buytocoverstop(stopxx,stopxx);

if (close < alvoxx) or (close > stopxx) then

ClosePosition;

end;

end;

 Mesmo código de cima somente renomeado!!!


*************************************************************************************************
EMA5>EMA21
***********************************************************************
begin

// SETUP PREÇO DE FECHAMENTO DE REVERSÃO PARA DAY TRADE

// Código Livre - Arthur 777

// Bloco de entrada nas operações

if (BuyPosition = 0) and (SellPosition = 0) and (time <= 1200) then

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;

//Bloco de saída (compra e outro de venda)

if (BuyPosition = 1) then

begin

SellToCoverStop(BuyPrice + 400,BuyPrice + 400);

SellToCoverStop(BuyPrice - 300,BuyPrice - 300);

end;

if (SellPosition = 1) then

begin
BuyToCoverStop(SellPrice - 400,SellPrice - 400);

BuyToCoverStop(SellPrice + 300,SellPrice + 300);

end;

// INTERVALO DE ENCERRAMENTO

if (time >= 1630) then

ClosePosition;

begin

plot(mediaexp(50,close));

end;

end;

You might also like