Escolar Documentos
Profissional Documentos
Cultura Documentos
Aula 6 - Usando Diversos Indicadores para Montar Diferentes Estratégias
Aula 6 - Usando Diversos Indicadores para Montar Diferentes Estratégias
MODALIDADE: Swing-Trade
CÓDIGO:
var
candle : integer;
begin
begin
candle:=-1;
//Condições de compra
if (ADX(7,9)[1]<media(8,ADX(7,9))[1])
and (ADX(7,9)>media(8,ADX(7,9)))
then
BuyAtMarket;
//Condições de venda
{if (ADX(7,9)[1]>media(8,ADX(7,9))[1])
and (ADX(7,9)<media(8,ADX(7,9)))
then
SellShortAtMarket; }
end;
if (BuyPosition = 1) then
begin
candle:=candle+1;
//Alvo
SellToCoverStop(((((high[candle]-low[candle]))*2)+high[candle])+10,
(((high[candle]-low[candle]))*2)+high[candle]);
//Stop
SellToCoverStop(abs(((high[candle]-low[candle])*1)-low[candle]),
abs(((high[candle]-low[candle])*1)-low[candle])-10);
end;
if (SellPosition = 1) then
begin
candle:=candle+1;
//Alvo
BuyToCoverStop(abs(((high[candle]-low[candle])*2)-low[candle])-10,
abs(((high[candle]-low[candle])*2)-low[candle]));
//Stop
BuyToCoverStop(((((high[candle]-low[candle]))*1)+high[candle]),
(((high[candle]-low[candle]))*1)+high[candle]+10);
end;
end;
MODALIDADE: Swing-Trade
CÓDIGO:
var
candle : integer;
begin
begin
candle:=-1;
//Condições de compra
if (close[1]<VWAP(3)[1])
and (close>VWAP(3))
then
BuyAtMarket;
//Condições de venda
{if (ADX(7,9)[1]>media(8,ADX(7,9))[1])
and (ADX(7,9)<media(8,ADX(7,9)))
then
SellShortAtMarket; }
end;
if (BuyPosition = 1) then
begin
candle:=candle+1;
//Alvo
SellToCoverStop(((((high[candle]-low[candle]))*2)+high[candle])+10,
(((high[candle]-low[candle]))*2)+high[candle]);
//Stop
SellToCoverStop(abs(((high[candle]-low[candle])*1)-low[candle]),
abs(((high[candle]-low[candle])*1)-low[candle])-10);
end;
if (SellPosition = 1) then
begin
candle:=candle+1;
//Alvo
BuyToCoverStop(abs(((high[candle]-low[candle])*2)-low[candle])-10,
abs(((high[candle]-low[candle])*2)-low[candle]));
//Stop
BuyToCoverStop(((((high[candle]-low[candle]))*1)+high[candle]),
(((high[candle]-low[candle]))*1)+high[candle]+10);
end;
end;
CARACTERÍSTICA: Taxa de acerto nível médio alto com payoff nível médio.
MODALIDADE: Swing-Trade
CÓDIGO:
var
candle : integer;
begin
begin
candle:=-1;
//Condições de compra
if (MACD(20,10,8)|0|>mediaExp(8,MACD(20,10,8)|0|))
and (close>media(50,close))
then
BuyAtMarket;
//Condições de venda
{if (MACD(20,10,8)|0|<mediaExp(8,MACD(20,10,8)|0|))
and (close<media(50,close))
then
SellShortAtMarket;}
end;
if (BuyPosition = 1) then
begin
candle:=candle+1;
//Alvo
SellToCoverStop(((((high[candle]-low[candle]))*2)+high[candle])+10,
(((high[candle]-low[candle]))*2)+high[candle]);
//Stop
SellToCoverStop(abs(((high[candle]-low[candle])*1)-low[candle]),
abs(((high[candle]-low[candle])*1)-low[candle])-10);
end;
if (SellPosition = 1) then
begin
candle:=candle+1;
//Alvo
BuyToCoverStop(abs(((high[candle]-low[candle])*2)-low[candle])-10,
abs(((high[candle]-low[candle])*2)-low[candle]));
//Stop
BuyToCoverStop(((((high[candle]-low[candle]))*1)+high[candle]),
(((high[candle]-low[candle]))*1)+high[candle]+10);
end;
end;