Professional Documents
Culture Documents
Aula 8 - Alvos Fixos e Stops Fixos
Aula 8 - Alvos Fixos e Stops Fixos
SAÍDA:
ALVO de compra = Preço de entrada + True Range do candle anterior a entrada (Candle
sinal)
STOP de compra = Preço de entrada - True Range do candle anterior a entrada (Candle
sinal)
ALVO de venda = Preço de entrada - True Range do candle anterior a entrada (Candle
sinal)
STOP de venda = Preço de entrada + True Range do candle anterior a entrada (Candle
sinal)
CÓDIGO:
var
candle:integer;
begin
begin
candle:=0;
if (low[1]<low[2])
and (low[2]<low[3])
then
BuyStop(high[1],high[1]);
{if (high[1]>high[2])
and (high[2]>high[1])
then
SellShortStop(low[1],low[1]);
}
end;
begin
candle:=candle+1;
SellToCoverStop((BuyPrice+AvgTrueRange(10,0)[candle])+100000,
(BuyPrice+AvgTrueRange(10,0)[candle]));
SellToCoverStop((BuyPrice-AvgTrueRange(10,0)[candle]),
(BuyPrice+AvgTrueRange(10,0)[candle])-100000);
end;
begin
candle:=candle+1;
BuyToCoverStop((SellPrice-AvgTrueRange(10,0)[candle])-100000,(SellPrice-
AvgTrueRange(10,0)[candle]));
BuyToCoverStop((SellPrice+AvgTrueRange(10,0)[candle]),
(SellPrice+AvgTrueRange(10,0)[candle])+100000);
end;
and (BarType=1)
then
begin
candle:=0;
if (low[0]<low[1])
and (low[1]<low[2])
then
BuyStop(high,high);
{if (high[0]>high[1])
and (high[1]>high[2])
then
SellShortStop(low,low);}
end;
begin
candle:=candle+1;
SellToCoverStop((BuyPrice+AvgTrueRange(10,0)[candle])+100000,
(BuyPrice+AvgTrueRange(10,0)[candle]));
SellToCoverStop((BuyPrice-AvgTrueRange(10,0)[candle]),
(BuyPrice+AvgTrueRange(10,0)[candle])-100000);
end;
begin
candle:=candle+1;
BuyToCoverStop((SellPrice-AvgTrueRange(10,0)[candle])-100000,(SellPrice-
AvgTrueRange(10,0)[candle]));
BuyToCoverStop((SellPrice+AvgTrueRange(10,0)[candle]),
(SellPrice+AvgTrueRange(10,0)[candle])+100000);
end;
end;