Neo traderBot

Neo traderBot

Você sabia?

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Fórum aberto da Comunidade NeoTraderBot

Notifications
Clear all

Erro: Compilando ... Parser[5,1]: O código deve começar com begin Erro de Sintaxe

2 Posts
1 Usuários
0 Reactions
1 Visualizações
(@florisvaldo-rios)
Novo membro
Registrou: 9 horas atrás
Posts: 2
Iniciador do tópico  

// Robô de tendência com stop móvel, alvo e auto reverse
// Evita operar em mercado lateral usando ADX

// Definição de parâmetros de entrada
Inputs:
PeriodoMME(20),
PeriodoADX(14),
LimiteADX(20),
AlvoTicks(38),
StopTicks(20);

// Declaração de variáveis
Vars:
MediaMME(0.0),
ValorADX(0.0),
TendenciaAlta(false),
TendenciaBaixa(false);

begin
// Cálculo da MME e do ADX
MediaMME = XAverage(Close, PeriodoMME);
ValorADX = ADX(PeriodoADX);

// Verifica se mercado está com tendência
if ValorADX > LimiteADX then
begin
TendenciaAlta = Close > MediaMME;
TendenciaBaixa = Close < MediaMME;

// Se não estiver posicionado
if MarketPosition = 0 then
begin
if TendenciaAlta then
Buy ("Compra") next bar at market
else if TendenciaBaixa then
SellShort ("Venda") next bar at market;
end;
end;

// Se estiver comprado, aplica alvo, stop móvel e auto reverse
if MarketPosition = 1 then
begin
Sell ("StopMovel") next bar at EntryPrice - StopTicks * MinMove / PriceScale stop;
Sell ("Alvo") next bar at EntryPrice + AlvoTicks * MinMove / PriceScale limit;

// Auto reverse
if Close <= EntryPrice - StopTicks * MinMove / PriceScale then
SellShort ("AutoReverseV") next bar at market
else if Close >= EntryPrice + AlvoTicks * MinMove / PriceScale then
SellShort ("AutoReverseV") next bar at market;
end;

// Se estiver vendido, aplica alvo, stop móvel e auto reverse
if MarketPosition = -1 then
begin
BuyToCover ("StopMovel") next bar at EntryPrice + StopTicks * MinMove / PriceScale stop;
BuyToCover ("Alvo") next bar at EntryPrice - AlvoTicks * MinMove / PriceScale limit;

// Auto reverse
if Close >= EntryPrice + StopTicks * MinMove / PriceScale then
Buy ("AutoReverseC") next bar at market
else if Close <= EntryPrice - AlvoTicks * MinMove / PriceScale then
Buy ("AutoReverseC") next bar at market;
end;
end;


   
Citar
(@florisvaldo-rios)
Novo membro
Registrou: 9 horas atrás
Posts: 2
Iniciador do tópico  

Alguém pode ajudar? Grato


   
ReplyCitar